Public report of xunyud/Earth-Online, published 17 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 17 November 2026, 06:28 UTC · Survey ID cd_cefb4a1cac4647779bf743412fb8485b

xunyud/Earth-Online

Measured 17 November 2026, 06:27 UTC, at code version 0a10f7b

First survey, so nothing to compare with yet Code coverage: not measured

Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).

CAI score 43.2out of 100 At risk

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: 52,486 lines of product code in 14 projects, tests not counted · Estimated rebuild effort: about 0.4 person-years · Weakest lens: Production Readiness, 34.0

Findings by how serious they are

49 critical 614 serious 46 minor

12 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

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

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. 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 ▸

71of 71 dimensions measured by tools.
697of 709 findings point to an exact file and line, so you can open each one in the code. The other 12 concern the repository as a whole, such as missing documentation.
71dimensions across 7 lenses, read from 52,486 lines of product code in 14 projects.
Chapters

Executive summary

xunyud/Earth-Online is rated At risk because critical security findings are open. Its score is held back because we found no logging, tracing or health checks in the code and no automated security scanning of the code, its secrets or its dependencies. It scores 43.2 out of 100, which the At risk rating leaves unchanged.

Production Readiness, at 34.0, is the weakest lens and counts most in the score. The best first step is fixing the password or key in the code, worth about 6.5 points. Adopting a logging library would lift Production Readiness itself, worth about 4.2 points. Raising Production Readiness to 70 would lift the score to about 50.5.

Twenty pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Nineteen known security holes in the packages the code depends on can be used by attackers, and five weaknesses in the code could be used by an attacker. Pinning each tool to an exact version, updating the vulnerable packages and fixing the weaknesses the scanner points to would close these risks. The two controls that only work with a mouse need to work with the keyboard, or to become a real button.

The product code is 52,486 lines, about €65,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 34.0 · counts for 46%Accessibility 39.5 · counts for 25%Code Health 53.2 · counts for 14%Security and Compliance 54.1 · counts for 8%Architecture 74.8 · counts for 4%Maturity 80.1 · counts for 2%Performance 100.0 · counts for 1%

If Production Readiness rose from 34.0 to 70, the lowest score rated Strong, the score would rise from 43.2 to about 50.5.

Code composition: what the lines of code are
Product code 77%Tests 23%
Rebuild cost: about €65,000 · Estimate
Cost to rebuild€22,000 to €110,000, for 359 to 1,140 hours of work, about 0.4 person-years for one engineer
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 43. 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.
SizeMedium: 52,486 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.
Raises the score by about 6.5 points · Low effort · Secret Scanning
2
Adopt `package:logging` (or `package:logger`) and log at meaningful points in the apps and servers you run.
Raises the score by about 4.2 points · Medium effort · Observability
3
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.
Raises the score by about 4.2 points · Medium effort · Security & performance tooling

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 €65,000 to build again, about 0.4 person-years of work. Its weakest lens is Production Readiness, at 34.0 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 6.5 points for low effort, because it clears the 1 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.6 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 3% to 8% on every change. The history of the code shows how much it changes: about 117,391 lines over the last 90 days, which is about 476,086 lines a year. At that pace, the extra work comes to an estimated 40.3 to 241.8 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch :app :app android android backend backend deno.json json earth-online-promo-video earth-online-promo-video frontend frontend supabase/functions/evermemos-proxy/deno.json json supabase/functions/evermemos-proxy/deno.json->deno.json supabase/functions/feishu-notifier/deno.json json supabase/functions/feishu-notifier/deno.json->deno.json supabase/functions/feishu-webhook/deno.json json supabase/functions/parse-document/deno.json json supabase/functions/sync-user-memory/deno.json json supabase/functions/sync-user-memory/deno.json->deno.json supabase/functions/task-reminder/deno.json json supabase/functions/task-reminder/deno.json->deno.json supabase/functions/wechat-webhook/deno.json json supabase/functions/wechat-webhook/deno.json->deno.json supabase/functions/weekly-summary/deno.json json supabase/functions/weekly-summary/deno.json->deno.json

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.

41 modules, with 17 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 1 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 (global)2 backend.src.auth3 com.xunyud.earthonline4 frontend.assets.web5 promo-video.src6 promo-video.src.EarthOnlineCompetition7 promo-video.src.EarthOnlinePromo8 promo-video.src.evermemos-scenes9 promo-video.src.scenes10 repository.models11 repository.shared12 supabase.functions._shared.agent_planner13 supabase.functions._shared.agent_types14 supabase.functions._shared.auth_guard15 supabase.functions._shared.breakpoint_memory16 supabase.functions._shared.collective_memory17 supabase.functions._shared.evermemos_client18 supabase.functions._shared.guide_ai19 supabase.functions._shared.guide_memory20 supabase.functions._shared.memory_achievements21 supabase.functions.agent-run-status22 supabase.functions.agent-step-approve23 supabase.functions.agent-turn24 supabase.functions.breakpoint-detector25 supabase.functions.guide-portrait-generate26 supabase.functions.memory-recommender27 supabase.functions.parse-quest28 supabase.functions.wechat-webhook29 supabase.functions.weekly-report-push30 backend31 backend.src32 repository.features33 repository.widgets34 supabase.functions35 supabase.functions._shared36 supabase.functions.agent-step-complete37 supabase.functions.generate-breakpoint-boost38 supabase.functions.pregenerate-breakpoint39 repository.core40 repository
1 (global)
2 backend.src.auth
3 com.xunyud.earthonline
4 frontend.assets.web
5 promo-video.src
6 promo-video.src.EarthOnlineCompetition
7 promo-video.src.EarthOnlinePromo
8 promo-video.src.evermemos-scenes
9 promo-video.src.scenes
10 repository.models
11 repository.shared
12 supabase.functions._shared.agent_planner
13 supabase.functions._shared.agent_types
14 supabase.functions._shared.auth_guard
15 supabase.functions._shared.breakpoint_memory
16 supabase.functions._shared.collective_memory
17 supabase.functions._shared.evermemos_client
18 supabase.functions._shared.guide_ai
19 supabase.functions._shared.guide_memory
20 supabase.functions._shared.memory_achievements
21 supabase.functions.agent-run-status
22 supabase.functions.agent-step-approve
23 supabase.functions.agent-turn
24 supabase.functions.breakpoint-detector
25 supabase.functions.guide-portrait-generate
26 supabase.functions.memory-recommender
27 supabase.functions.parse-quest
28 supabase.functions.wechat-webhook
29 supabase.functions.weekly-report-push
30 backend1
31 backend.src1
32 repository.features42
33 repository.widgets1
34 supabase.functions1
35 supabase.functions._shared514141
36 supabase.functions.agent-step-complete1
37 supabase.functions.generate-breakpoint-boost1
38 supabase.functions.pregenerate-breakpoint1
39 repository.core4
40 repository12
Uses a module listed above itPart of a loopThe module itself
1 (global)2 backend.src.auth3 com.xunyud.earthonline4 frontend.assets.web5 promo-video.src6 promo-video.src.EarthOnlineCompetition7 promo-video.src.EarthOnlinePromo8 promo-video.src.evermemos-scenes9 promo-video.src.scenes10 repository.models11 repository.shared12 supabase.functions._shared.agent_planner13 supabase.functions._shared.agent_types14 supabase.functions._shared.auth_guard15 supabase.functions._shared.breakpoint_memory16 supabase.functions._shared.collective_memory17 supabase.functions._shared.evermemos_client18 supabase.functions._shared.guide_ai19 supabase.functions._shared.guide_memory20 supabase.functions._shared.memory_achievements21 supabase.functions.agent-run-status22 supabase.functions.agent-step-approve23 supabase.functions.agent-turn24 supabase.functions.breakpoint-detector25 supabase.functions.guide-portrait-generate26 supabase.functions.memory-recommender27 supabase.functions.parse-quest28 supabase.functions.wechat-webhook29 supabase.functions.weekly-report-push30 backend31 backend.src32 repository.features33 repository.widgets34 supabase.functions35 supabase.functions._shared36 supabase.functions.agent-step-complete37 supabase.functions.generate-breakpoint-boost38 supabase.functions.pregenerate-breakpoint39 repository.core40 repository(global)1backend.src.auth2com.xunyud.earthonline3frontend.assets.web4promo-video.src5promo-video.src.EarthOnlineCompetition6promo-video.src.EarthOnlinePromo7promo-video.src.evermemos-scenes8promo-video.src.scenes9repository.models10repository.shared11supabase.functions._shared.agent_planner12supabase.functions._shared.agent_types13supabase.functions._shared.auth_guard14supabase.functions._shared.breakpoint_memory15supabase.functions._shared.collective_memory16supabase.functions._shared.evermemos_client17supabase.functions._shared.guide_ai18supabase.functions._shared.guide_memory19supabase.functions._shared.memory_achievements20supabase.functions.agent-run-status21supabase.functions.agent-step-approve22supabase.functions.agent-turn23supabase.functions.breakpoint-detector24supabase.functions.guide-portrait-generate25supabase.functions.memory-recommender26supabase.functions.parse-quest27supabase.functions.wechat-webhook28supabase.functions.weekly-report-push29backend30backend.src31repository.features32repository.widgets33supabase.functions34supabase.functions._shared35supabase.functions.agent-step-complete36supabase.functions.generate-breakpoint-boost37supabase.functions.pregenerate-breakpoint38repository.core39repository40114211514141111412+1 more modules (most-connected shown)

At a glance — Code Health · 53.2 · Adequate · gated by R10, R3 ·

At a glance — Architecture · 74.8 · Adequate · gated by AX7 ·

At a glance — Maturity · 80.1 · Strong ·

At a glance — Readiness · 34.0 · Weak · gated by R4, P2, P3 ·

At a glance — Security · 54.1 · Checked 4 of 10 · gated by D29, D36 ·

At a glance — Accessibility · 39.5 · Weak · gated by AC4 ·

At a glance — Performance · 100.0 · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection43High / Critical
A03:2025 — Software Supply Chain Failures33High / Critical
A07:2025 — Authentication Failures1High / Critical

Roadmap

Top priorities: Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED; Adopt `package:logging` (or `package:logger`) and log at meaningful points in the apps and servers you run; 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.

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

Do thisHelpsEffortDimension
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.+6.5 ptsLowSecret Scanning
Adopt `package:logging` (or `package:logger`) and log at meaningful points in the apps and servers you run.+4.2 ptsMediumObservability
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.+4.2 ptsMediumSecurity & performance tooling
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+3.9 ptsMediumKeyboard semantics
Add tests that import the unreached modules (directly or through their public entry).+3.1 ptsMediumTest Coverage
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.+1.8 ptsMediumDeployment & Rollback
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+1.5 ptsMediumForms & labels
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+1.3 ptsMediumPage structure

File quality

Per-file score 0–10 — a quality signature. Of 96 files carrying findings, judged against the Production bar: 4% slop · 68% mixed · 28% near-clean.

FileScoreBandWorst signal
REDACTED0.7SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.3SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.3MixedStatic Analysis (SAST): Medium: REDACTED
frontend/lib/features/quest/controllers/guide_controller.dart5.5MixedCyclomatic Complexity: GuideController.matchGuideAction (cyclomatic 59)
frontend/lib/features/quest/controllers/quest_controller.dart5.5MixedCyclomatic Complexity: QuestController.simulateAIParsing (cyclomatic 36)
frontend/lib/features/quest/widgets/guide_panel_dialog.dart5.5MixedCyclomatic Complexity: _GuideComposerState._handleKeyEvent (cyclomatic 16)
frontend/lib/features/auth/screens/login_screen.dart5.7MixedGod Classes: FileTooLong: screens/login_screen.dart
REDACTED5.7MixedSecret Scanning: Leaked secret: REDACTED
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.8MixedDependency Vulnerabilities: High CVE: REDACTED
REDACTED6.5MixedStatic Analysis (SAST): High: REDACTED
frontend/lib/features/quest/screens/home_page.dart7.0MixedCyclomatic Complexity: _HomePageState._handleGuideModifyTask (cyclomatic 39)
frontend/lib/features/reward/screens/reward_shop_page.dart7.0MixedCyclomatic Complexity: _RewardShopPageState._openAddReward (cyclomatic 22)
frontend/lib/features/reward/screens/inventory_page.dart7.0MixedCognitive Complexity: _InventoryPageState.build (cognitive 17)

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 49

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

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

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

Could not be resolved — 12

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 71 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

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

What we checked — 71 dimensions across the health lenses
D1D2D3D4D5D6D10D13D14D15D17D19D20D24D26D28D29D30D34D35D36D43D44AC1AC2AC3AC4AC6AX10AX3AX5AX6AX7AX9GD1IC1M1M2M3M4P1P10P2P3P4P6P8PF3R1R10R2R3R4R5R6R7R8R9X1X12X16X17X18X2X21X25X27X29X3X30X5

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 697 of 709 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

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

Every finding is locatable in findings.md. Run 01a1e830-b317-7ecd-918d-17279947b4bf.

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

Run transparency — what happened this run

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

  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 13 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 75 test source file(s) (.dart) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • 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 reliability NOT SCORED: this repository's production source includes .dart, and the built-in reliability runner cannot re-run the .dart test suite(s) — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `npm ci --ignore-scripts` in backend/ (13 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted.
  • 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 — 2 Maven/Gradle manifest(s) were read, stating a version for 0 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 npm package 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. Single-maintainer repository — bus factor is not applicable (2 contributor(s) across 94 commit(s) sampled, automation and bot accounts excluded). One of them holds 99% of the history; the other 1 hold 1% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (backend/package.json), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • D24 Comment Value — 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. D24 compares a comment's words with the identifiers, literals and constructs of the code it annotates, using English function-word and rationale lexicons. Comments in another script or language were left unread rather than counted as clean.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • 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.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `REDACTED` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • 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. 'package:supabase_flutter' is imported (frontend/lib/main.dart:8), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • 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. 'package:supabase_flutter' is imported (frontend/lib/main.dart:8), but this repository stands up no server and carries no migration or rules file this check reads, so who may read and write its data could not be decided.
  • 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. 'package:supabase_flutter' is imported (frontend/lib/main.dart:8), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • 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. 'package:supabase_flutter' is imported (frontend/lib/main.dart:8), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • 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. 'package:supabase_flutter' is imported (frontend/lib/main.dart:8), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • 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.
  • R10 Code Duplication — 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. 47 further occurrence(s) are not listed individually; the score already reflects all 87.
  • R2 Cyclomatic Complexity — 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. 11 further occurrence(s) are not listed individually; the score already reflects all 51.
  • R4 Test Coverage — 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. 22 further occurrence(s) are not listed individually; the score already reflects all 62.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X24 Document value interpolated into markup unescaped — 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.
  • X27 Collection changed while being enumerated — 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 check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.

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.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • 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.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • 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.

Dimensions

D1 · Cyclomatic Complexity6.3 / 10Adequate✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

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

47 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was GuideController.matchGuideAction at 59. A further 1 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 agent_planner.isTaskCreateIntent at 21 — they are counted neither in the figure above nor in this dimension's score.

index.Deno.serve() (cyclomatic 17) · ×3supabase/functions/guide-freeform-chat/index.ts:26
GuideController.matchGuideAction (cyclomatic 59)frontend/lib/features/quest/controllers/guide_controller.dart:1410
guide_memory.gatherGuideMemoryBundle (cyclomatic 53)supabase/functions/_shared/guide_memory.ts:902
_HomePageState._handleGuideModifyTask (cyclomatic 39)frontend/lib/features/quest/screens/home_page.dart:2285
_QuestItemState.build (cyclomatic 37)frontend/lib/features/quest/widgets/quest_item.dart:119

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

What to do

  1. Bring the 8 bodies over 30 down to 30 or less in Cyclomatic Complexity — start with GuideController.matchGuideAction (cyclomatic 59), guide_memory.gatherGuideMemoryBundle (cyclomatic 53), _HomePageState._handleGuideModifyTask (cyclomatic 39). — 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 8 together lifts Cyclomatic Complexity from 6.3 to about 7.1/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.

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

D2 · Cognitive Complexity4.9 / 10Weak✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

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

68 method(s) exceeded the cognitive complexity threshold of 15; the worst was QuestController.simulateAIParsing at 81.

QuestController.simulateAIParsing (cognitive 81)frontend/lib/features/quest/controllers/quest_controller.dart:1958
guide_memory.gatherGuideMemoryBundle (cognitive 70)supabase/functions/_shared/guide_memory.ts:902
refactor_home.find_method_body_end (cognitive 59)refactor_home.py:16
GuideController.matchGuideAction (cognitive 58)frontend/lib/features/quest/controllers/guide_controller.dart:1410
_HomePageState._handleGuideModifyTask (cognitive 56)frontend/lib/features/quest/screens/home_page.dart:2285

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

What to do

  1. Bring the 2 bodies over 60 down to 60 or less in Cognitive Complexity — start with QuestController.simulateAIParsing (cognitive 81), guide_memory.gatherGuideMemoryBundle (cognitive 70). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cognitive Complexity from 4.9 to about 5.5/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.

D3 · God Classes7.0 / 10Adequate✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

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

68 god class(es) detected.

MethodTooLong: _HomePageState.build · ×28frontend/lib/features/quest/screens/home_page.dart:4125
FileTooLong: screens/home_page.dart · ×18frontend/lib/features/quest/screens/home_page.dart
FunctionTooLong: EarthOnlinePromo.PosterComposition · ×10promo-video/src/EarthOnlinePromo.tsx:1242
ClassTooLong: _HomePageState · ×7frontend/lib/features/quest/screens/home_page.dart:74
TooManyMethods: GuideController · ×5frontend/lib/features/quest/controllers/guide_controller.dart:98

What to do

  1. Resolve the 28 MethodTooLong finding(s) in God Classes — start with home_page.dart (6), guide_panel_dialog.dart (3), login_screen.dart (2). — One of this dimension's main actionable groups (28 warning-level).
  2. Resolve the 18 FileTooLong finding(s) in God Classes — start with home_page.dart, guide_controller.dart, quest_controller.dart. — One of this dimension's main actionable groups (18 warning-level).
  3. Resolve the 10 FunctionTooLong finding(s) in God Classes — start with REDACTED (4), EarthOnlinePromo.tsx (2), REDACTED. — One of this dimension's main actionable groups (10 warning-level).

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

D4 · Code Duplication6.1 / 10Adequate✓ Tool-verified

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

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

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

104 duplicated block group(s) detected. 9.7 % of the production lines (5,106 of 52,486) are in a reported copy. A further 60 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. Measured on part of this repository only: .ts (23% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Duplicated block (12 lines × 2) · ×15frontend/lib/core/services/evermemos_service.dart:721
Duplicated block (14 lines × 2) · ×5frontend/lib/features/binding/screens/binding_view.dart:1273
Duplicated block (10 lines × 2) · ×5frontend/lib/features/auth/widgets/forest_atmosphere.dart:493
Edited copy of a member (15 corresponding lines) · ×4frontend/lib/features/quest/controllers/quest_controller.dart:1647
Duplicated block (21 lines × 2) · ×4frontend/lib/features/memory/screens/memory_detail_page.dart:259

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

What to do

  1. Resolve the 15 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with guide_controller.dart (3), forest_atmosphere.dart (2), home_page.dart (2). — One of this dimension's main actionable groups (15 warning-level).
  2. Resolve the 5 Duplicated block (14 lines × 2) finding(s) in Code Duplication — start with home_page.dart (2), binding_view.dart, life_diary_page.dart. — One of this dimension's main actionable groups (5 warning-level).
  3. Resolve the 5 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with forest_atmosphere.dart, forest_particles.dart, binding_view.dart. — One of this dimension's main actionable groups (5 warning-level).

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

D5 · Coupling9.4 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

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

14 production modules (Gradle+npm+pub+Deno), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 1 module(s) off the main sequence, with abstractness counted on 13 of the 14 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: deno.json

What to do

  1. Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).

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

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

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

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

5 of 85 classes have LCOM4 above 3.

Low cohesion: _AuthCopy (LCOM4 9) · ×5frontend/lib/features/auth/screens/login_screen.dart:1197

What to do

  1. Resolve the 5 Low cohesion finding(s) in Cohesion (LCOM4) — start with login_screen.dart, supabase_auth_service.dart, guide_controller.dart. — One of this dimension's main actionable groups (5 warning-level).

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

D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 13 tests. Measured on the JavaScript/TypeScript suite only — at least 75 test source file(s) (.dart) went unread, so its test quality is unmeasured and is not in these counts.

Mock-dominated test: rejects request when Supabase returns errorbackend/test/auth.test.ts:49

✓ On the Gold path — maintain.

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

D13 · Secret Scanning5.0 / 10Adequate✓ Tool-verified

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

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

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

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

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

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

0 of 130 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 130 package(s) this repository's committed lockfile installs for a consumer — its 11 production, optional and peer dependency(ies), across 3 product package.json manifest(s), and everything those install in turn. Its 15 `devDependencies` declaration(s), and every package only they reach, are excluded: a consumer installs none of them. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. 1 of them publish no licence this pass can read on registry.npmjs.org — an absent field, `UNLICENSED`, or a `SEE LICENSE IN <file>` pointer into a tarball this pass does not download; that is missing data, not a violation, and none of them is charged. No third-party code was found shipping without a manifest entry (vendored or copied-in directories, licence comments preserved in committed bundles, bundled module paths, compiled wasm modules). This repository publishes itself under ISC, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's npm package 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.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.4 / 10Stronggated by 10 serious findings✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

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

Top hotspots: frontend/lib/features/quest/screens/home_page.dart (19×39=741); frontend/lib/features/quest/controllers/quest_controller.dart (7×31=217); supabase/functions/_shared/guide_memory.ts (4×53=212)

Hotspot: frontend/lib/features/quest/screens/home_page.dart · ×10frontend/lib/features/quest/screens/home_page.dart:2285

What to do

  1. Resolve the 10 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (6), home_page.dart, quest_controller.dart. — One of this dimension's main actionable groups (10 warning-level).

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

D17 · Explicit Debt10.0 / 10Stronggated by 2 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

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

2 deducted task-comment markers across 52486 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.

TodoComment · ×2frontend/lib/main.dart:91

What to do

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

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

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

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

1 of 1 documentation facets pass in full. 23 document(s) read across 3 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

No architecture decision records were found.

No ADRs foundfrontend/lib/main.dart:24

What to do

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

D24 · Comment Value10.0 1.1 / 10Critical○ Nothing flagged

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 1.1 / 10 · rule-coverage 11% · ceiling Documented

0 of 45 judged comments only repeat the code they sit on (0.0 %). 960 comment(s) in another language or script were not judged.

Detailed fixes: d24_recommendation.md.

D26 · Project Cohesion6.9 / 10Adequate✓ Tool-verified

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

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

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

2 of 13 build units (Deno, Gradle, npm, pub) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×2frontend/pubspec.yaml:1

What to do

  1. Resolve the 2 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with pubspec.yaml, package.json. — One of this dimension's main actionable groups (2 recommendation-level).

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

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

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)1.7 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

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

44 finding(s): 0 critical, 25 high, 18 medium, 0 low. 20 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) — `REDACTED` (line 47, line 71) — 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 1 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

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

What to do

  1. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  2. 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).
  3. No action in Static Analysis (SAST) — all 20 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 (20 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

24 finding(s): 1 critical, 18 high, 5 medium, 0 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 18 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (18). — One of this dimension's main actionable groups (18 issue-level).
  2. Resolve the 5 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (5). — One of this dimension's main actionable groups (5 warning-level).
  3. Resolve the 1 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

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.

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

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 134 of the 188 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

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

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

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

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
  3. 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.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

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

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 2 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives5.5 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. — REDACTED:496

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels5.0 / 10Adequate✓ Tool-verified

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

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

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

  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×2) — REDACTED:526, REDACTED:531

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure5.4 / 10Adequate✓ Tool-verified

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

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

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

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

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics1.0 / 10Critical✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. (×2) — REDACTED:536, REDACTED:558

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC6 · Visual & motion safety6.2 / 10Adequate✓ Tool-verified

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

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

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

  • `.sun` moves (`animation: sunPulse 4s ease-in-out infinite alternate`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:29
  • `.sun-halo` moves (`animation: sunPulse 4s ease-in-out infinite alternate`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:34
  • `.sun-flare` moves (`animation: flareDrift 5s ease-in-out infinite alternate`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:40
  • `.mist` moves (`animation: mistDrift 25s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:104
  • `.grass-blade` moves (`animation: grassSway 3s ease-in-out infinite alternate`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:124
  • `.amb-icon` moves (`animation: ambFloat 12s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:137
  • `.glow-orb` moves (`animation: glowDrift 6s ease-in-out infinite alternate`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:149
  • `.login-card` moves (`animation: cardIn 0.9s cubic-bezier(0.2,0.8,0.2,1) 0.3s both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:178
  • `.vine.top-left` moves (`animation: vineGrow 1.2s cubic-bezier(0.2,0.8,0.2,1) 0.6s both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:192
  • `.vine.top-right` moves (`animation: vineGrow 1.2s cubic-bezier(0.2,0.8,0.2,1) 0.8s both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:197
  • `.vine.bot-right` moves (`animation: vineGrow 1.2s cubic-bezier(0.2,0.8,0.2,1) 1.0s both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:202
  • `.primary-btn` moves (`transition: transform 0.15s, box-shadow 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:289
  • `.toast` moves (`transition: opacity 0.3s, transform 0.3s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:312
  • `.view-enter` moves (`animation: viewSlideIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:344
  • `.view-exit` moves (`animation: viewSlideOut 0.28s cubic-bezier(0.55, 0, 1, 0.45) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:345
  • `.privacy-card` moves (`animation: cardIn 0.6s cubic-bezier(0.2,0.8,0.2,1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — REDACTED:386
  • `.input-row input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — REDACTED:267
  • `.auth-btn.active` sets color: #fff on background-color: #2F8A43 — 4.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — REDACTED:249
  • The inline foreground/background colours fall below the 4.5:1 WCAG AA minimum for normal text. Darken/lighten one of them. — promo-video/src/EarthOnlinePromo.tsx:1297

What to do

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

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

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

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

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.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

AX7 · Slice cohesion2.7 / 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.

  • `QuestController` (slice 'quest') depends on `AchievementController` from slice 'achievement'. — frontend/lib/features/quest/controllers/quest_controller.dart:84
  • `RewardController` (slice 'reward') depends on `QuestController` from slice 'quest'. — frontend/lib/features/reward/controllers/reward_controller.dart:14
  • `InventoryPage` (slice 'reward') depends on `QuestController` from slice 'quest'. — frontend/lib/features/reward/screens/inventory_page.dart:12
  • `RewardShopPage` (slice 'reward') depends on `QuestController` from slice 'quest'. — frontend/lib/features/reward/screens/reward_shop_page.dart:18
  • `StatsController` (slice 'stats') depends on `QuestController` from slice 'quest'. — frontend/lib/features/stats/controllers/stats_controller.dart:10
  • `StatsPage` (slice 'stats') depends on `QuestController` from slice 'quest'. — frontend/lib/features/stats/screens/stats_page.dart:19

What to do

  • Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.
AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

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.

GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

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.

IC1 · Incompleteness & stubs10.0 / 10Exemplary○ Nothing flagged

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.

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

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

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

M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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

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

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

What to do

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

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

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

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

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

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

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

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.

P2 · Observability0.0 / 10Critical✓ Tool-verified

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

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

  • No logging call was found in the 185 Python, JavaScript/TypeScript, Dart, JVM production file(s) this check read across 6 module(s). Each was searched for its ecosystem's logging libraries (JVM: SLF4J, Log4j2, java.util.logging, Logback, kotlin-logging, scala-logging; Python: logging, structlog, loguru; JavaScript/TypeScript: pino, winston, bunyan, log4js, loglevel, consola, the NestJS Logger; Dart: package:logging, package:logger, dart:developer's log()) and for a call on a receiver named `log`/`logger` (or ending in `Logger`/`_logger`) with a level verb. It cannot see logging through a repo-local wrapper named otherwise, or in source it did not read — this is 'no logging found by this walk', not a verdict that nothing here logs. If it is right, production issues will be hard to diagnose.

What to do

  • Adopt `package:logging` (or `package:logger`) and log at meaningful points in the apps and servers you run.
  • Add a health-check endpoint (a /health route on your shelf router) so orchestrators and load balancers can probe liveness/readiness.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • 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 3 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
  • `package.json` 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`. — package.json:6

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.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

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.

  • The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release. — REDACTED:142

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

P8 · Schema migrations10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.

Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

R1 · Type Safety10.0 / 10Exemplary✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

R10 · Code Duplication3.9 / 10Weak✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • 52 duplicated blocks under supabase/functions/ have copies in at least two of the sibling directories _shared, agent-run-status, agent-step-approve, agent-step-complete, agent-turn, evermemos-proxy (+24 more sibling(s) not listed) — 46 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 52 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 52 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 52 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — REDACTED:14
  • REDACTED:14 · REDACTED:11 — the two spans are one implementation copied and then locally edited — 446 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — REDACTED:14
  • supabase/functions/generate-breakpoint-boost/index.ts:59 · supabase/functions/pregenerate-breakpoint/index.ts:58 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — supabase/functions/generate-breakpoint-boost/index.ts:59
  • supabase/functions/agent-step-complete/index.ts:31 · supabase/functions/agent-turn/index.ts:31 — the two spans are one implementation copied and then locally edited — 449 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — supabase/functions/agent-step-complete/index.ts:31
  • REDACTED:20 · REDACTED:20 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:20
  • supabase/functions/_shared/guide_engine.ts:126 · REDACTED:34 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/_shared/guide_engine.ts:126
  • supabase/functions/agent-step-complete/index.ts:116 · supabase/functions/agent-turn/index.ts:110 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — supabase/functions/agent-step-complete/index.ts:116
  • supabase/functions/guide-bootstrap/index.ts:7 · supabase/functions/guide-event-generate/index.ts:7 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/guide-bootstrap/index.ts:7
  • supabase/functions/guide-portrait-generate/index.ts:377 · supabase/functions/knowledge-extraction/index.ts:28 — the two spans are one implementation copied and then locally edited — 251 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — supabase/functions/guide-portrait-generate/index.ts:377
  • supabase/functions/guide-event-accept/index.ts:8 · supabase/functions/guide-night-reflection/index.ts:16 — the two spans are one implementation copied and then locally edited — 197 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — supabase/functions/guide-event-accept/index.ts:8
  • supabase/functions/feishu-webhook/index.ts:4 · REDACTED:5 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — supabase/functions/feishu-webhook/index.ts:4
  • REDACTED:120 · supabase/functions/sync-user-memory/index.ts:29 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — REDACTED:120
  • promo-video/src/EarthOnlineCompetition.tsx:347 · promo-video/src/EverMemOSDemo.tsx:134 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — promo-video/src/EarthOnlineCompetition.tsx:347
  • supabase/functions/agent-run-status/index.ts:37 · supabase/functions/agent-step-approve/index.ts:76 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/agent-run-status/index.ts:37
  • supabase/functions/agent-step-approve/index.ts:49 · supabase/functions/agent-step-complete/index.ts:82 · supabase/functions/agent-turn/index.ts:77 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/agent-step-approve/index.ts:49
  • supabase/functions/agent-step-complete/index_test.ts:172 · supabase/functions/agent-turn/index_test.ts:121 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — supabase/functions/agent-step-complete/index_test.ts:172
  • supabase/functions/sync-user-memory/index.ts:339 · REDACTED:448 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/sync-user-memory/index.ts:339
  • supabase/functions/_shared/collective_memory.ts:28 · supabase/functions/_shared/guide_memory.ts:77 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — supabase/functions/_shared/collective_memory.ts:28
  • supabase/functions/_shared/breakpoint_helpers.ts:324 · supabase/functions/_shared/guide_ai.ts:87 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/_shared/breakpoint_helpers.ts:324
  • supabase/functions/feishu-webhook/index.ts:143 · REDACTED:376 — the two spans are one implementation copied and then locally edited — 62 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — supabase/functions/feishu-webhook/index.ts:143
  • promo-video/src/EarthOnlinePromo.tsx:437 · promo-video/src/EverMemOSDemo.tsx:328 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — promo-video/src/EarthOnlinePromo.tsx:437
  • supabase/functions/_shared/breakpoint_helpers.ts:95 · supabase/functions/_shared/breakpoint_helpers.ts:173 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/_shared/breakpoint_helpers.ts:95
  • supabase/functions/agent-step-approve/index.ts:129 · supabase/functions/agent-step-complete/index.ts:307 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/agent-step-approve/index.ts:129
  • REDACTED:29 · supabase/functions/weekly-report-push/index.ts:13 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:29
  • REDACTED:334 · supabase/functions/weekly-report-push/index.ts:111 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:334
  • supabase/functions/_shared/agent_planner_test.ts:32 · supabase/functions/_shared/agent_planner_test.ts:47 · supabase/functions/_shared/agent_planner_test.ts:62 · supabase/functions/_shared/agent_planner_test.ts:88 — 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. — supabase/functions/_shared/agent_planner_test.ts:32
  • supabase/functions/_shared/agent_tool_execution_test.ts:316 · supabase/functions/_shared/agent_tool_execution_test.ts:331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — supabase/functions/_shared/agent_tool_execution_test.ts:316
  • supabase/functions/_shared/agent_engine.ts:223 · supabase/functions/_shared/agent_engine.ts:260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — supabase/functions/_shared/agent_engine.ts:223
  • supabase/functions/_shared/agent_tool_execution_test.ts:257 · supabase/functions/_shared/agent_tool_execution_test.ts:287 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/_shared/agent_tool_execution_test.ts:257
  • supabase/functions/agent-step-complete/index_test.ts:14 · supabase/functions/agent-step-complete/index_test.ts:71 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/agent-step-complete/index_test.ts:14
  • supabase/functions/_shared/agent_tool_execution_test.ts:132 · supabase/functions/_shared/agent_tool_execution_test.ts:152 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/_shared/agent_tool_execution_test.ts:132
  • supabase/functions/_shared/guide_ai.ts:98 · supabase/functions/_shared/guide_ai.ts:168 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/_shared/guide_ai.ts:98
  • supabase/functions/_shared/weekly_summary_jobs.ts:60 · REDACTED:63 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — supabase/functions/_shared/weekly_summary_jobs.ts:60
  • supabase/functions/agent-run-status/index.ts:69 · supabase/functions/agent-step-approve/index.ts:133 · supabase/functions/agent-step-complete/index.ts:311 · supabase/functions/agent-turn/index.ts:228 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/agent-run-status/index.ts:69
  • supabase/functions/agent-run-status/index_test.ts:28 · supabase/functions/agent-run-status/index_test.ts:48 · supabase/functions/agent-turn/index_test.ts:32 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/agent-run-status/index_test.ts:28
  • supabase/functions/agent-step-approve/index_test.ts:10 · supabase/functions/agent-step-approve/index_test.ts:33 · supabase/functions/agent-step-complete/index_test.ts:12 · supabase/functions/agent-step-complete/index_test.ts:39 · +1 more site(s) not listed — the 5 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/agent-step-approve/index_test.ts:10
  • supabase/functions/guide-freeform-chat/index.ts:23 · supabase/functions/guide-portrait-generate/index.ts:376 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/guide-freeform-chat/index.ts:23
  • REDACTED:58 · supabase/functions/weekly-report-push/index.ts:55 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — REDACTED:58
  • supabase/functions/parse-quest/index.ts:143 · REDACTED:403 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/parse-quest/index.ts:143
  • supabase/functions/weekly-report-push/index.ts:95 · REDACTED:21 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — supabase/functions/weekly-report-push/index.ts:95

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R2 · Cyclomatic Complexity5.1 / 10Adequate✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • gatherGuideMemoryBundle has cyclomatic complexity 42 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/_shared/guide_memory.ts:902
  • planAgentGoal has cyclomatic complexity 30 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:195
  • (anonymous) has cyclomatic complexity 28 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/weekly-report-push/index.ts:115
  • inferAgentRiskLevel has cyclomatic complexity 28 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/_shared/agent_policy.ts:32
  • (anonymous) has cyclomatic complexity 26 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/agent-step-complete/index.ts:157
  • (anonymous) has cyclomatic complexity 25 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:142
  • (anonymous) has cyclomatic complexity 23 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/guide-portrait-generate/index.ts:379
  • generateImageViaOpenAI has cyclomatic complexity 22 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/guide-portrait-generate/index.ts:96
  • (anonymous) has cyclomatic complexity 20 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/guide-freeform-chat/index.ts:26
  • tryDetectMemoryAchievements has cyclomatic complexity 19 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/sync-user-memory/index.ts:252
  • (anonymous) has cyclomatic complexity 18 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/sync-user-memory/index.ts:343
  • replanAfterToolCompletion has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:575
  • (anonymous) has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/parse-document/index.ts:137
  • isChainBreaking has cyclomatic complexity 16 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/_shared/guide_memory.ts:786
  • patrolUser has cyclomatic complexity 16 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:196
  • (anonymous) has cyclomatic complexity 16 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:338
  • searchMemories has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:383
  • (anonymous) has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:181
  • normalizeLlmPayload has cyclomatic complexity 15 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/parse-quest/index.ts:48
  • (anonymous) has cyclomatic complexity 15 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — supabase/functions/knowledge-extraction/index.ts:30, REDACTED:318
  • acceptOrDismissDailyEvent has cyclomatic complexity 15 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/_shared/guide_engine.ts:175
  • generateBoostContent has cyclomatic complexity 15 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/_shared/breakpoint_helpers.ts:238
  • getActiveHabits has cyclomatic complexity 14 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/_shared/breakpoint_helpers.ts:101
  • buildBehaviorSignals has cyclomatic complexity 14 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/_shared/guide_memory.ts:210
  • (anonymous) has cyclomatic complexity 14 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/guide-event-accept/index.ts:7
  • appendAgentStep has cyclomatic complexity 14 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/_shared/agent_engine.ts:145
  • detectPatrolSignals has cyclomatic complexity 13 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:95
  • (anonymous) has cyclomatic complexity 13 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/agent-step-approve/index.ts:83
  • (anonymous) has cyclomatic complexity 13 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/agent-turn/index.ts:151
  • detectTimeSlotChains has cyclomatic complexity 12 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/_shared/guide_memory.ts:544
  • parseRecommendations has cyclomatic complexity 12 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/memory-recommender/helpers.ts:67
  • (anonymous) has cyclomatic complexity 12 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/feishu-webhook/index.ts:101
  • inferRunStatusFromSteps has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/_shared/agent_engine.ts:418
  • (anonymous) has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×4) — supabase/functions/guide-bootstrap/index.ts:7, supabase/functions/guide-chat/index.ts:7, supabase/functions/guide-event-generate/index.ts:7, …
  • normalizeSuggestedTask has cyclomatic complexity 12 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/_shared/guide_engine.ts:639
  • detectWeeklyCycleChains has cyclomatic complexity 11 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — supabase/functions/_shared/guide_memory.ts:611
R3 · Large Files3.8 / 10Weak✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • promo-video/src/EarthOnlinePromo.tsx has 1465 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — promo-video/src/EarthOnlinePromo.tsx:1
  • supabase/functions/_shared/guide_memory.ts has 1249 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — supabase/functions/_shared/guide_memory.ts:1
  • promo-video/src/EarthOnlineCompetition.tsx has 860 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — promo-video/src/EarthOnlineCompetition.tsx:1
  • promo-video/src/EverMemOSDemo.tsx has 777 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — promo-video/src/EverMemOSDemo.tsx:1
  • REDACTED has 701 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • supabase/functions/_shared/guide_ai.ts has 683 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — supabase/functions/_shared/guide_ai.ts:1
  • supabase/functions/_shared/guide_engine.ts has 616 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — supabase/functions/_shared/guide_engine.ts:1
  • REDACTED has 573 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • REDACTED has 541 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • supabase/functions/guide-portrait-generate/index.ts has 430 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — supabase/functions/guide-portrait-generate/index.ts:1
  • supabase/functions/sync-user-memory/index.ts has 422 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — supabase/functions/sync-user-memory/index.ts:1
  • supabase/functions/_shared/agent_engine.ts has 412 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — supabase/functions/_shared/agent_engine.ts:1
  • REDACTED has 401 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage2.2 / 10Critical✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • backend/vitest.config.ts declares environment "node", and no package here declares a DOM implementation (jsdom / happy-dom), a component testing library or a browser runner — so none of the 4 unreached component module(s) can be tested as written, however the suite is authored: promo-video/src/EarthOnlinePromo.tsx, promo-video/src/EarthOnlineCompetition.tsx, promo-video/src/EverMemOSDemo.tsx, promo-video/src/Root.tsx. Add a DOM environment and a component testing library (for example jsdom + @testing-library, or the runner's browser mode), then test the components. Reported once because these files share one cause, not one omission each. — backend/vitest.config.ts:1
  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×39) — REDACTED:1, REDACTED:1, supabase/functions/guide-portrait-generate/index.ts:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness9.8 / 10Exemplary✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

R6 · Tooling6.7 / 10Adequate✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

  • test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.

What to do

  • Add eslint as package.json scripts and run them in CI.
R7 · Dead Code6.3 / 10Adequate✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • Unreachable from the 39 application, 1 tooling and 38 test entry point(s) detected in this repo. Nothing this repository declares compiles or type-checks these files, so a wrong deletion here would raise no compile error — gate removals on `npm test`, which loads the modules, and note that it only covers what it exercises. An undetected custom entry would make these reachable.
  • no import path from any entry point (39 application, 1 tooling, 38 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (supabase/functions/generate-breakpoint-boost/index.ts, supabase/functions/pregenerate-breakpoint/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — supabase/functions/_shared/breakpoint_helpers.ts
  • no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×15) — supabase/functions/_shared/agent_tool_execution_test.ts, supabase/functions/_shared/guide_engine_test.ts, REDACTED, …
  • no import path from any entry point (39 application, 1 tooling, 38 test roots considered), but 5 in-repo import(s) from 5 other file(s) do name it (supabase/functions/_shared/breakpoint_helpers.ts, supabase/functions/_shared/breakpoint_memory_test.ts, REDACTED and 2 more) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — supabase/functions/_shared/breakpoint_memory.ts
  • Nothing imports this binding — it is safe to review for removal. (×2) — supabase/functions/_shared/agent_types.ts:150, supabase/functions/_shared/guide_ai.ts:198
  • This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×3) — supabase/functions/guide-portrait-generate/index.ts:79, supabase/functions/guide-portrait-generate/index.ts:224, supabase/functions/tests/habit_chain_detection_property_test.ts:28

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene9.5 / 10Exemplary✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. — package.json:8

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

  • `toAgentJson` is exported and takes `value: unknown` from its caller, and it calls itself at line 107 (`toAgentJson`) with a piece of `value` (and at line 112) — and nowhere in `toAgentJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `toAgentJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — supabase/functions/_shared/agent_types.ts:107

What to do

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

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.

  • `_QuestItemState` carries a disposal duty — a `State`, so the framework calls its `dispose()` when it leaves the tree — and it creates `_controller` itself (line 44, `AnimationController`), which makes that instance its own. Nothing in the class releases it — no `_controller.dispose()`, no tear-off of it, on any path — nothing elsewhere in the library releases it through another instance, and it is never handed on as a value (passed positionally, returned, stored, collected), so no other owner can be ending it. Passing it as a named argument does not: a widget or animation never disposes a controller it was given. On what was read, `AnimationController` outlives the object that made it — its listeners, and through them this object and everything it references, stay reachable, and a ticker, timer or subscription keeps calling into a disposed object. Release it where the duty is discharged: `_controller.dispose();` in `dispose()` before `super.dispose()`. — frontend/lib/features/quest/widgets/quest_item.dart:44

What to do

  • Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
X2 · Cancellation propagation7.7 / 10Strong✓ Tool-verified

Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).

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

  • Only 11/18 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `getToken` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×3) — REDACTED:23, supabase/functions/feishu-webhook/index.ts:21, REDACTED:26
  • `sendCard` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×3) — REDACTED:58, supabase/functions/feishu-webhook/index.ts:50, REDACTED:66
  • `callParseQuest` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — supabase/functions/parse-document/index.ts:63

What to do

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

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

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

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

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

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

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

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen. Whether a `for … 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.

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

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

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

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

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

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

  • 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. (×13) — REDACTED:275, REDACTED:292, REDACTED:326, …
  • `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. (×20) — frontend/lib/features/reward/controllers/reward_controller.dart:139, frontend/lib/features/reward/controllers/reward_controller.dart:170, frontend/lib/features/reward/controllers/reward_controller.dart:292, …

What to do

  • Swallowed exception (empty catch)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

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

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.

WCAG coverage — what static analysis assessed

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

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

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

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health53.2Adequate — gated by R10, R3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture74.8Adequate — gated by AX7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity80.1StrongSolid.
Readiness34.0Weak — gated by R4, P2, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security54.1Checked 4 of 10Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility39.5Weak — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance100.0ExemplaryStrongest area.
Unscored — 2 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 23 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 3 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: this repository stores data through 'package:supabase_flutter' (frontend/lib/main.dart:8) but declares no persisted model this check reads (Drift tables, ObjectBox/Floor @Entity, Isar @collection and Hive @HiveType classes, Serverpod table models). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
  • C4 Data Retention — Not assessed: this repository stores data through 'package:supabase_flutter' (frontend/lib/main.dart:8) but declares no persisted model this check reads (Drift tables, ObjectBox/Floor @Entity, Isar @collection and Hive @HiveType classes, Serverpod table models). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
  • C5 Data-Subject Rights — Not assessed: this repository stores data through 'package:supabase_flutter' (frontend/lib/main.dart:8) but declares no persisted model this check reads (Drift tables, ObjectBox/Floor @Entity, Isar @collection and Hive @HiveType classes, Serverpod table models). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 52 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.

  • AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
  • AX1 Captive dependencies — Not applicable: this repository's Dart imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Kotlin imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No class in this 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. Dart isolates share no mutable memory, so no two requests write one object at the same instant. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX4 Dependency direction — not applicable to a vertical-slice architecture (the inward-dependency rule is for layered/clean styles)
  • AX8 Test isolation — no test/production split to check
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the dev server (`npm run start`) exited before it served a page. Likely cause (the repository): package.json has no "start" script, so `npm run start` could not start the app. Last output: "npm error Missing script: "start" / npm error / npm error Did you mean one of these? / npm error npm star # Mark your favorite packages / npm error npm stars # View packages marked as favorites / npm error / npm error To see a list of scripts, run: / npm error npm run / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered. The cause is in the repository, not in our sandbox: package.json has no "start" script, so `npm run start` could not start the app. Nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: this repository stores data through 'package:supabase_flutter' (frontend/lib/main.dart:8) but declares no persisted model this check reads (Drift tables, Isar/ObjectBox/Floor/Hive entities, Serverpod table models). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
  • C2 Access Controls — Not assessed: this is a Flutter or Dart application whose data is served by a hosted backend ('package:supabase_flutter', frontend/lib/main.dart:8). Its access control is that backend's configuration — Supabase row-level security, Firebase security rules, Appwrite permissions — and this repository carries none of it that this check reads (no Supabase migration, no server code). A client-side route guard hides a page; it authorizes nothing. Whether access is authorized by default could not be established, and its absence is not scored.
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half has no runner
  • D12 Dependency Hygiene — Not scored — 2 Maven/Gradle manifest(s) were read, stating a version for 0 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency does not read html yet; not measured.
  • 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"]`.
  • 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.
  • 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) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — backend/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
  • DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
  • 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 — no outbound HTTP usage detected — no HTTP client call or construction in the Dart, JVM, JavaScript/TypeScript, Python source (service entry point: REDACTED:12 (express()))
  • 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.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — X24 reached only 31% of this repository's production lines — dart (36,699 lines), cpp (380 lines), c (133 lines), kotlin (3 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's 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.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 49 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×18
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <input> without a programmatic label · ×2
  • <input> without a programmatic label REDACTED:526 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label REDACTED:531 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×2
  • Click handler on a non-interactive <div> REDACTED:536 — A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
  • Click handler on a non-interactive <div> REDACTED:558 — A script attaches a click listener to this <div>, but it has no role, no tabindex and no key handler, so it can only be operated with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D13 · Secret Scanning · Leaked secret · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×1
  • REDACTED
Serious — 614 finding(s)
R4 · Test Coverage · No test reaches this file · ×39
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/guide-portrait-generate/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/sync-user-memory/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/_shared/agent_engine.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/_shared/breakpoint_helpers.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/_shared/agent_tool_execution_test.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/weekly-report-push/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/agent-step-complete/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/_shared/guide_engine_test.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/memory-recommender/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/agent-turn/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/parse-quest/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file promo-video/src/evermemos-scenes.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/agent-step-complete/index_test.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/feishu-webhook/index.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/_shared/breakpoint_memory.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file supabase/functions/agent-step-approve/index_test.ts:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • + 14 more in this group — see findings.md.
D3 · God Classes · MethodTooLong · ×28
  • MethodTooLong: _HomePageState.build frontend/lib/features/quest/screens/home_page.dart:4125 — MethodTooLong — build runs 301 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 201 over it, 3.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _HomePageState._handleGuideModifyTask frontend/lib/features/quest/screens/home_page.dart:2285 — MethodTooLong — _handleGuideModifyTask runs 296 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 196 over it, 2.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _HomePageState._openUnifiedSettings frontend/lib/features/quest/screens/home_page.dart:3768 — MethodTooLong — _openUnifiedSettings runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× 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: _HomePageState._handlePendingGuideTaskEdit frontend/lib/features/quest/screens/home_page.dart:1871 — MethodTooLong — _handlePendingGuideTaskEdit runs 235 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 135 over it, 2.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _QuestEditSheetState.build frontend/lib/features/quest/widgets/quest_edit_sheet.dart:152 — MethodTooLong — build runs 225 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 125 over it, 2.25× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _QuestItemState.build frontend/lib/features/quest/widgets/quest_item.dart:119 — MethodTooLong — build runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _LoginPanel.build frontend/lib/features/auth/screens/login_screen.dart:486 — MethodTooLong — build runs 183 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 83 over it, 1.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _RewardShopPageState._openAddReward frontend/lib/features/reward/screens/reward_shop_page.dart:73 — MethodTooLong — _openAddReward runs 182 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 82 over it, 1.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _HomePageState._openGuidePanel frontend/lib/features/quest/screens/home_page.dart:2905 — MethodTooLong — _openGuidePanel runs 165 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× 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: _AppDrawerState.build frontend/lib/core/widgets/app_drawer.dart:90 — MethodTooLong — build runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _MemoryCardState.build frontend/lib/features/memory/widgets/memory_card.dart:43 — MethodTooLong — build runs 154 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 54 over it, 1.54× 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: _HomePageState._generateUserProfile frontend/lib/features/quest/screens/home_page.dart:3556 — MethodTooLong — _generateUserProfile runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _QuickCreateDialogBodyState.build frontend/lib/features/quest/widgets/quick_create_dialog_content.dart:229 — MethodTooLong — build runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: XpCurveChart.build frontend/lib/features/stats/widgets/xp_curve_chart.dart:27 — MethodTooLong — build runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _AppDrawerState._buildUserHeader frontend/lib/core/widgets/app_drawer.dart:298 — MethodTooLong — _buildUserHeader runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _FeishuBindPanelState.build frontend/lib/features/settings/widgets/feishu_bind_panel.dart:115 — MethodTooLong — build runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _LoginScreenState.build frontend/lib/features/auth/screens/login_screen.dart:247 — MethodTooLong — build runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: EvermemosService.buildUserProfileFromMemories frontend/lib/core/services/evermemos_service.dart:445 — MethodTooLong — buildUserProfileFromMemories runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: GuidePanelDialog.build frontend/lib/features/quest/widgets/guide_panel_dialog.dart:94 — MethodTooLong — build 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: _GuideHeader.build frontend/lib/features/quest/widgets/guide_panel_dialog.dart:306 — MethodTooLong — build runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _QuickCreateDialogBodyState._buildAttachToExistingMainPanel frontend/lib/features/quest/widgets/quick_create_dialog_content.dart:496 — MethodTooLong — _buildAttachToExistingMainPanel runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: QuestController.simulateAIParsing frontend/lib/features/quest/controllers/quest_controller.dart:1958 — MethodTooLong — simulateAIParsing runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _GuideMessageBubbleState.build frontend/lib/features/quest/widgets/guide_panel_dialog.dart:592 — MethodTooLong — build runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _QuestBoardState._buildEntry frontend/lib/features/quest/widgets/quest_board.dart:215 — MethodTooLong — _buildEntry runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: QuestDialogShell.build frontend/lib/shared/widgets/quest_dialog_shell.dart:78 — MethodTooLong — build runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 3 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×20
  • Swallowed exception (caught, then discarded) frontend/lib/features/reward/controllers/reward_controller.dart:139 — `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) frontend/lib/features/reward/controllers/reward_controller.dart:170 — `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) frontend/lib/features/reward/controllers/reward_controller.dart:292 — `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) frontend/lib/features/reward/controllers/reward_controller.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.
  • Swallowed exception (caught, then discarded) frontend/lib/features/quest/screens/home_page.dart:435 — `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) frontend/lib/features/quest/screens/home_page.dart:577 — `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) frontend/lib/features/quest/controllers/guide_controller.dart:1791 — `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) frontend/lib/features/quest/controllers/quest_controller.dart:295 — `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) frontend/lib/features/profile/controllers/user_profile_controller.dart:91 — `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) frontend/lib/features/memory/controllers/memory_controller.dart:236 — `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) frontend/lib/features/memory/controllers/memory_controller.dart:374 — `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) frontend/lib/features/auth/screens/forest_login_web_page_web.dart:74 — `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) frontend/lib/core/widgets/app_drawer.dart:85 — `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) frontend/lib/core/services/agent_service.dart:18 — `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) frontend/lib/core/services/evermemos_service.dart:947 — `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) frontend/lib/core/services/guide_service.dart:547 — `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) frontend/lib/core/services/memory_service.dart:82 — `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) frontend/lib/core/services/memory_service.dart:99 — `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) frontend/lib/core/services/memory_service.dart:138 — `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) frontend/lib/core/services/memory_service.dart:227 — `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.
D3 · God Classes · FileTooLong · ×18
  • FileTooLong: screens/home_page.dart frontend/lib/features/quest/screens/home_page.dart — FileTooLong — 3369 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: _HomePageState (74-4537). The bar is 500 significant lines; this is 2869 over it, 6.74× 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: controllers/guide_controller.dart frontend/lib/features/quest/controllers/guide_controller.dart — FileTooLong — 1685 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: GuideController (98-2242). The bar is 500 significant lines; this is 1185 over it, 3.37× 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: controllers/quest_controller.dart frontend/lib/features/quest/controllers/quest_controller.dart — FileTooLong — 1601 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: QuestController (50-2112). The bar is 500 significant lines; this is 1101 over it, 3.20× 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: src/EarthOnlinePromo.tsx promo-video/src/EarthOnlinePromo.tsx — FileTooLong — 1354 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 854 over it, 2.71× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: screens/binding_view.dart frontend/lib/features/binding/screens/binding_view.dart — FileTooLong — 1050 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 550 over it, 2.10× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: screens/login_screen.dart frontend/lib/features/auth/screens/login_screen.dart — FileTooLong — 925 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 425 over it, 1.85× 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: _shared/guide_memory.ts supabase/functions/_shared/guide_memory.ts — FileTooLong — 879 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 379 over it, 1.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: src/EarthOnlineCompetition.tsx promo-video/src/EarthOnlineCompetition.tsx — FileTooLong — 756 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 256 over it, 1.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: widgets/guide_panel_dialog.dart frontend/lib/features/quest/widgets/guide_panel_dialog.dart — FileTooLong — 717 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 217 over it, 1.43× 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/evermemos_service.dart frontend/lib/core/services/evermemos_service.dart — FileTooLong — 690 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: EvermemosService (139-951). The bar is 500 significant lines; this is 190 over it, 1.38× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/EverMemOSDemo.tsx promo-video/src/EverMemOSDemo.tsx — FileTooLong — 682 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 182 over it, 1.36× 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: widgets/quick_create_dialog_content.dart frontend/lib/features/quest/widgets/quick_create_dialog_content.dart — FileTooLong — 666 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: _QuickCreateDialogBodyState (53-913). The bar is 500 significant lines; this is 166 over it, 1.33× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: screens/reward_shop_page.dart frontend/lib/features/reward/screens/reward_shop_page.dart — FileTooLong — 644 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: _RewardShopPageState (33-885). The bar is 500 significant lines; this is 144 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: widgets/app_drawer.dart frontend/lib/core/widgets/app_drawer.dart — FileTooLong — 630 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: _AppDrawerState (52-728). The bar is 500 significant lines; this is 130 over it, 1.26× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: services/guide_service.dart frontend/lib/core/services/guide_service.dart — FileTooLong — 589 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 89 over it, 1.18× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 561 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 61 over it, 1.12× 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: _shared/guide_ai.ts supabase/functions/_shared/guide_ai.ts — FileTooLong — 543 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 43 over it, 1.09× 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: _shared/guide_engine.ts supabase/functions/_shared/guide_engine.ts — FileTooLong — 503 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3 over it, 1.01× 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.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×16
  • Animation without a prefers-reduced-motion guard REDACTED:29 — `.sun` moves (`animation: sunPulse 4s ease-in-out infinite alternate`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:34 — `.sun-halo` moves (`animation: sunPulse 4s ease-in-out infinite alternate`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:40 — `.sun-flare` moves (`animation: flareDrift 5s ease-in-out infinite alternate`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:104 — `.mist` moves (`animation: mistDrift 25s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:124 — `.grass-blade` moves (`animation: grassSway 3s ease-in-out infinite alternate`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:137 — `.amb-icon` moves (`animation: ambFloat 12s ease-in-out infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:149 — `.glow-orb` moves (`animation: glowDrift 6s ease-in-out infinite alternate`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:178 — `.login-card` moves (`animation: cardIn 0.9s cubic-bezier(0.2,0.8,0.2,1) 0.3s both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:192 — `.vine.top-left` moves (`animation: vineGrow 1.2s cubic-bezier(0.2,0.8,0.2,1) 0.6s both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:197 — `.vine.top-right` moves (`animation: vineGrow 1.2s cubic-bezier(0.2,0.8,0.2,1) 0.8s both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:202 — `.vine.bot-right` moves (`animation: vineGrow 1.2s cubic-bezier(0.2,0.8,0.2,1) 1.0s both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:289 — `.primary-btn` moves (`transition: transform 0.15s, box-shadow 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:312 — `.toast` moves (`transition: opacity 0.3s, transform 0.3s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:344 — `.view-enter` moves (`animation: viewSlideIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:345 — `.view-exit` moves (`animation: viewSlideOut 0.28s cubic-bezier(0.55, 0, 1, 0.45) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard REDACTED:386 — `.privacy-card` moves (`animation: cardIn 0.6s cubic-bezier(0.2,0.8,0.2,1) both`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×15
  • Duplicated block (12 lines × 2) frontend/lib/core/services/evermemos_service.dart:721 — frontend/lib/core/services/evermemos_service.dart:721-732 | frontend/lib/core/services/evermemos_service.dart:738-749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/core/services/evermemos_service.dart:721` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) frontend/lib/core/services/guide_service.dart:704 — frontend/lib/core/services/guide_service.dart:704-715 | frontend/lib/core/services/guide_service.dart:720-731 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/core/services/guide_service.dart:704` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (12 lines × 2) frontend/lib/features/auth/screens/login_screen.dart:944 — frontend/lib/features/auth/screens/login_screen.dart:944-955 | frontend/lib/features/quest/widgets/home_settings_widgets.dart:99-110 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) frontend/lib/features/auth/widgets/forest_atmosphere.dart:85 — frontend/lib/features/auth/widgets/forest_atmosphere.dart:85-96 | frontend/lib/features/auth/widgets/forest_atmosphere.dart:157-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/auth/widgets/forest_atmosphere.dart:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `frontend/lib/features/auth/widgets/forest_atmosphere.dart:97` calls `Color`, `withValues` and `frontend/lib/features/auth/widgets/forest_atmosphere.dart:169` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) frontend/lib/features/auth/widgets/forest_atmosphere.dart:84 — frontend/lib/features/auth/widgets/forest_atmosphere.dart:84-95 | frontend/lib/features/auth/widgets/forest_atmosphere.dart:117-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/auth/widgets/forest_atmosphere.dart:84` it does not close everything it opens, so those 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, `frontend/lib/features/auth/widgets/forest_atmosphere.dart:129` calls `Color` and `frontend/lib/features/auth/widgets/forest_atmosphere.dart:96` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) frontend/lib/features/quest/controllers/guide_controller.dart:786 — frontend/lib/features/quest/controllers/guide_controller.dart:786-797 | frontend/lib/features/quest/controllers/guide_controller.dart:847-858 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:786` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) frontend/lib/features/quest/controllers/guide_controller.dart:899 — frontend/lib/features/quest/controllers/guide_controller.dart:899-910 | frontend/lib/features/quest/screens/home_page.dart:584-595 — before extracting anything, compare `frontend/lib/features/quest/controllers/guide_controller.dart` and `frontend/lib/features/quest/screens/home_page.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 283 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:899` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (12 lines × 2) frontend/lib/features/quest/controllers/guide_controller.dart:1372 — frontend/lib/features/quest/controllers/guide_controller.dart:1372-1383 | frontend/lib/features/quest/controllers/guide_controller.dart:1395-1406 — both copies are in the same file, so extract the 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) frontend/lib/features/quest/controllers/quest_controller.dart:932 — frontend/lib/features/quest/controllers/quest_controller.dart:932-943 | frontend/lib/features/quest/controllers/quest_controller.dart:995-1006 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/quest_controller.dart:932` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `frontend/lib/features/quest/controllers/quest_controller.dart:1008` calls `trim` and `frontend/lib/features/quest/controllers/quest_controller.dart:945` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) frontend/lib/features/quest/screens/home_page.dart:2133 — frontend/lib/features/quest/screens/home_page.dart:2133-2144 | frontend/lib/features/quest/screens/home_page.dart:2422-2433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/screens/home_page.dart:2133` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) frontend/lib/features/quest/screens/home_page.dart:3591 — frontend/lib/features/quest/screens/home_page.dart:3591-3602 | frontend/lib/features/reward/screens/reward_shop_page.dart:96-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `frontend/lib/features/reward/screens/reward_shop_page.dart:108` calls `Form` and `frontend/lib/features/quest/screens/home_page.dart:3603` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) frontend/lib/features/quest/screens/life_diary_page.dart:250 — frontend/lib/features/quest/screens/life_diary_page.dart:250-261 | frontend/lib/features/quest/screens/recycle_bin_page.dart:17-28 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `frontend/lib/features/quest/screens/life_diary_page.dart:250` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12 lines × 2) frontend/lib/features/stats/widgets/hero_xp_card.dart:27 — frontend/lib/features/stats/widgets/hero_xp_card.dart:27-38 | frontend/lib/features/stats/widgets/motivational_insight.dart:19-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `frontend/lib/features/stats/widgets/hero_xp_card.dart:27` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) frontend/lib/features/memory/screens/memory_detail_page.dart:296 — frontend/lib/features/memory/screens/memory_detail_page.dart:296-307 | frontend/lib/features/memory/widgets/memory_card.dart:357-368 — before extracting anything, compare `frontend/lib/features/memory/screens/memory_detail_page.dart` and `frontend/lib/features/memory/widgets/memory_card.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) frontend/lib/features/memory/screens/memory_detail_page.dart:309 — frontend/lib/features/memory/screens/memory_detail_page.dart:309-320 | frontend/lib/features/memory/widgets/memory_card.dart:370-381 — before extracting anything, compare `frontend/lib/features/memory/screens/memory_detail_page.dart` and `frontend/lib/features/memory/widgets/memory_card.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
X3 · Exception handling · Swallowed exception (empty catch) · ×13
  • Swallowed exception (empty catch) REDACTED:275 — 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:292 — 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:326 — 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) supabase/functions/_shared/guide_engine.ts:248 — 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) supabase/functions/_shared/guide_engine.ts:284 — 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) supabase/functions/_shared/guide_memory.ts:263 — 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) supabase/functions/_shared/guide_memory.ts:1175 — 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) supabase/functions/_shared/guide_memory.ts:1195 — 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) supabase/functions/_shared/guide_memory.ts:1346 — 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) frontend/lib/main.dart:38 — 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) frontend/lib/features/quest/controllers/guide_controller.dart:1759 — 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) frontend/lib/features/quest/controllers/quest_controller.dart:365 — 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) frontend/lib/features/quest/controllers/quest_controller.dart:1247 — 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D15 · Churn × Complexity Hotspots · Hotspot · ×10
  • Hotspot: frontend/lib/features/quest/screens/home_page.dart frontend/lib/features/quest/screens/home_page.dart:2285 — frontend/lib/features/quest/screens/home_page.dart changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in _HomePageState._handleGuideModifyTask at line 2285. 3 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-03-05..2026-06-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-05 17:26:45 +08:00' --until='2026-06-03 17:26:45 +08:00' --full-history --no-merges -- frontend/lib/features/quest/screens/home_page.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: frontend/lib/features/quest/controllers/quest_controller.dart frontend/lib/features/quest/controllers/quest_controller.dart:1531 — frontend/lib/features/quest/controllers/quest_controller.dart changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in QuestController.toggleQuestCompletion at line 1531. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-05..2026-06-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-05 17:26:45 +08:00' --until='2026-06-03 17:26:45 +08:00' --full-history --no-merges -- frontend/lib/features/quest/controllers/quest_controller.dart`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: supabase/functions/_shared/guide_memory.ts supabase/functions/_shared/guide_memory.ts:902 — supabase/functions/_shared/guide_memory.ts changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in guide_memory.gatherGuideMemoryBundle at line 902. 1 of those changes was a fix/bug commit, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-03-05..2026-06-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-05 17:26:45 +08:00' --until='2026-06-03 17:26:45 +08:00' --full-history --no-merges -- supabase/functions/_shared/guide_memory.ts`: 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: supabase/functions/parse-document/index.ts supabase/functions/parse-document/index.ts:137 — supabase/functions/parse-document/index.ts changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in index.Deno.serve() at line 137. 3 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-03-05..2026-06-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-05 17:26:45 +08:00' --until='2026-06-03 17:26:45 +08:00' --full-history --no-merges -- supabase/functions/parse-document/index.ts`: 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:450 — REDACTED changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in index.Deno.serve() at line 450. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-05..2026-06-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-05 17:26:45 +08:00' --until='2026-06-03 17:26:45 +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: supabase/functions/agent-step-complete/index.ts supabase/functions/agent-step-complete/index.ts:157 — supabase/functions/agent-step-complete/index.ts changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in index.createAgentStepCompleteHandler.<returned closure> at line 157. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-05..2026-06-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-05 17:26:45 +08:00' --until='2026-06-03 17:26:45 +08:00' --full-history --no-merges -- supabase/functions/agent-step-complete/index.ts`: 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: supabase/functions/guide-portrait-generate/index.ts supabase/functions/guide-portrait-generate/index.ts:379 — supabase/functions/guide-portrait-generate/index.ts changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in index.Deno.serve() at line 379. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-05..2026-06-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-05 17:26:45 +08:00' --until='2026-06-03 17:26:45 +08:00' --full-history --no-merges -- supabase/functions/guide-portrait-generate/index.ts`: 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: supabase/functions/weekly-report-push/index.ts supabase/functions/weekly-report-push/index.ts:115 — supabase/functions/weekly-report-push/index.ts changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in index.Deno.serve() at line 115. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-05..2026-06-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-05 17:26:45 +08:00' --until='2026-06-03 17:26:45 +08:00' --full-history --no-merges -- supabase/functions/weekly-report-push/index.ts`: 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: supabase/functions/sync-user-memory/index.ts supabase/functions/sync-user-memory/index.ts:343 — supabase/functions/sync-user-memory/index.ts changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in index.Deno.serve() at line 343. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-05..2026-06-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-05 17:26:45 +08:00' --until='2026-06-03 17:26:45 +08:00' --full-history --no-merges -- supabase/functions/sync-user-memory/index.ts`: 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: frontend/lib/features/quest/widgets/quest_edit_sheet.dart frontend/lib/features/quest/widgets/quest_edit_sheet.dart:152 — frontend/lib/features/quest/widgets/quest_edit_sheet.dart changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in _QuestEditSheetState.build at line 152. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-05..2026-06-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-05 17:26:45 +08:00' --until='2026-06-03 17:26:45 +08:00' --full-history --no-merges -- frontend/lib/features/quest/widgets/quest_edit_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.
D3 · God Classes · FunctionTooLong · ×10
  • FunctionTooLong: EarthOnlinePromo.PosterComposition promo-video/src/EarthOnlinePromo.tsx:1242 — FunctionTooLong — PosterComposition runs 274 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 174 over it, 2.74× 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.
  • FunctionTooLong: agent_planner.planAgentGoal REDACTED:195 — FunctionTooLong — planAgentGoal runs 189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× 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.
  • FunctionTooLong: index.Deno.serve() supabase/functions/weekly-report-push/index.ts:115 — FunctionTooLong — Deno.serve() runs 147 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: EarthOnlineCompetition.HeroSceneView promo-video/src/EarthOnlineCompetition.tsx:643 — FunctionTooLong — HeroSceneView 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.
  • FunctionTooLong: EverMemOSDemo.SidePanel promo-video/src/EverMemOSDemo.tsx:326 — FunctionTooLong — SidePanel 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.
  • FunctionTooLong: index.handleTaskCapture REDACTED:119 — FunctionTooLong — handleTaskCapture runs 118 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 18 over it, 1.18× 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.
  • FunctionTooLong: index.createAgentStepCompleteHandler supabase/functions/agent-step-complete/index.ts:154 — FunctionTooLong — createAgentStepCompleteHandler runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: index.createAgentStepCompleteHandler.<returned closure> supabase/functions/agent-step-complete/index.ts:157 — FunctionTooLong — createAgentStepCompleteHandler.<returned closure> runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: REDACTED.draw REDACTED:793 — FunctionTooLong — draw runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: EarthOnlinePromo.ProgressionVisual promo-video/src/EarthOnlinePromo.tsx:869 — FunctionTooLong — ProgressionVisual runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.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.
D3 · God Classes · ClassTooLong · ×7
  • ClassTooLong: _HomePageState frontend/lib/features/quest/screens/home_page.dart:74 — ClassTooLong — 3306 significant lines (blank, comment-only and punctuation-only lines excluded), 76 methods. The bar is 400 significant lines; this is 2906 over it, 8.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GuideController frontend/lib/features/quest/controllers/guide_controller.dart:98 — ClassTooLong — 1616 significant lines (blank, comment-only and punctuation-only lines excluded), 86 methods. The bar is 400 significant lines; this is 1216 over it, 4.04× 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: QuestController frontend/lib/features/quest/controllers/quest_controller.dart:50 — ClassTooLong — 1556 significant lines (blank, comment-only and punctuation-only lines excluded), 85 methods. The bar is 400 significant lines; this is 1156 over it, 3.89× 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: _QuickCreateDialogBodyState frontend/lib/features/quest/widgets/quick_create_dialog_content.dart:53 — ClassTooLong — 630 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 230 over it, 1.58× 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: _RewardShopPageState frontend/lib/features/reward/screens/reward_shop_page.dart:33 — ClassTooLong — 622 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 222 over it, 1.56× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: EvermemosService frontend/lib/core/services/evermemos_service.dart:139 — ClassTooLong — 582 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 182 over it, 1.46× 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: _AppDrawerState frontend/lib/core/widgets/app_drawer.dart:52 — ClassTooLong — 488 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 88 over it, 1.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
R10 · Code Duplication · Duplicated block (12 lines × 2 locations) · ×7
  • Duplicated block (12 lines × 2 locations) supabase/functions/_shared/agent_tool_execution_test.ts:132 — supabase/functions/_shared/agent_tool_execution_test.ts:132 · supabase/functions/_shared/agent_tool_execution_test.ts:152 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (12 lines × 2 locations) supabase/functions/_shared/guide_ai.ts:98 — supabase/functions/_shared/guide_ai.ts:98 · supabase/functions/_shared/guide_ai.ts:168 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (12 lines × 2 locations) supabase/functions/_shared/weekly_summary_jobs.ts:60 — supabase/functions/_shared/weekly_summary_jobs.ts:60 · REDACTED:63 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (12 lines × 2 locations) supabase/functions/guide-freeform-chat/index.ts:23 — supabase/functions/guide-freeform-chat/index.ts:23 · supabase/functions/guide-portrait-generate/index.ts:376 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (12 lines × 2 locations) REDACTED:58 — REDACTED:58 · supabase/functions/weekly-report-push/index.ts:55 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
  • Duplicated block (12 lines × 2 locations) supabase/functions/parse-quest/index.ts:143 — supabase/functions/parse-quest/index.ts:143 · REDACTED:403 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (12 lines × 2 locations) supabase/functions/weekly-report-push/index.ts:95 — supabase/functions/weekly-report-push/index.ts:95 · REDACTED:21 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
X2 · Cancellation propagation · Async function without AbortSignal · ×7
  • Async function without AbortSignal: getToken REDACTED:23 — `getToken` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: sendCard REDACTED:58 — `sendCard` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: callParseQuest supabase/functions/parse-document/index.ts:63 — `callParseQuest` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getToken supabase/functions/feishu-webhook/index.ts:21 — `getToken` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: sendCard supabase/functions/feishu-webhook/index.ts:50 — `sendCard` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getToken REDACTED:26 — `getToken` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: sendCard REDACTED:66 — `sendCard` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
AX7 · Slice cohesion · Cross-slice coupling · ×6
  • Cross-slice coupling: quest → achievement frontend/lib/features/quest/controllers/quest_controller.dart:84 — `QuestController` (slice 'quest') depends on `AchievementController` from slice 'achievement'.
  • Cross-slice coupling: reward → quest frontend/lib/features/reward/controllers/reward_controller.dart:14 — `RewardController` (slice 'reward') depends on `QuestController` from slice 'quest'.
  • Cross-slice coupling: reward → quest frontend/lib/features/reward/screens/inventory_page.dart:12 — `InventoryPage` (slice 'reward') depends on `QuestController` from slice 'quest'.
  • Cross-slice coupling: reward → quest frontend/lib/features/reward/screens/reward_shop_page.dart:18 — `RewardShopPage` (slice 'reward') depends on `QuestController` from slice 'quest'.
  • Cross-slice coupling: stats → quest frontend/lib/features/stats/controllers/stats_controller.dart:10 — `StatsController` (slice 'stats') depends on `QuestController` from slice 'quest'.
  • Cross-slice coupling: stats → quest frontend/lib/features/stats/screens/stats_page.dart:19 — `StatsPage` (slice 'stats') depends on `QuestController` from slice 'quest'.
D3 · God Classes · TooManyMethods · ×5
  • TooManyMethods: GuideController frontend/lib/features/quest/controllers/guide_controller.dart:98 — TooManyMethods — 86 methods. The bar is 30 methods; this is 56 over it, 2.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: QuestController frontend/lib/features/quest/controllers/quest_controller.dart:50 — TooManyMethods — 85 methods. The bar is 30 methods; this is 55 over it, 2.83× 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: _HomePageState frontend/lib/features/quest/screens/home_page.dart: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: MemoryController frontend/lib/features/memory/controllers/memory_controller.dart:17 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RewardController frontend/lib/features/reward/controllers/reward_controller.dart:9 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities · Medium CVE · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×5
  • Duplicated block (14 lines × 2) frontend/lib/features/binding/screens/binding_view.dart:1273 — frontend/lib/features/binding/screens/binding_view.dart:1273-1286 | frontend/lib/features/binding/screens/binding_view.dart:1371-1384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/binding/screens/binding_view.dart:1273` it does not close everything it opens, so those exact lines 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) frontend/lib/features/quest/screens/home_page.dart:1913 — frontend/lib/features/quest/screens/home_page.dart:1913-1926 | frontend/lib/features/quest/screens/home_page.dart:2203-2216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/screens/home_page.dart:1913` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) frontend/lib/features/quest/screens/home_page.dart:1991 — frontend/lib/features/quest/screens/home_page.dart:1991-2004 | frontend/lib/features/quest/screens/home_page.dart:2266-2279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/screens/home_page.dart:1991` it begins part-way through the construct above it, so those exact lines 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) frontend/lib/features/quest/screens/life_diary_page.dart:390 — frontend/lib/features/quest/screens/life_diary_page.dart:390-403 | frontend/lib/features/stats/widgets/highlight_cards.dart:113-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/screens/life_diary_page.dart:390` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) frontend/lib/features/quest/widgets/portrait_insight_chart.dart:425 — frontend/lib/features/quest/widgets/portrait_insight_chart.dart:425-438 | frontend/lib/features/stats/widgets/highlight_cards.dart:113-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/widgets/portrait_insight_chart.dart:425` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×5
  • Duplicated block (10 lines × 2) frontend/lib/features/auth/widgets/forest_atmosphere.dart:493 — frontend/lib/features/auth/widgets/forest_atmosphere.dart:493-502 | frontend/lib/features/auth/widgets/forest_atmosphere.dart:504-513 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/auth/widgets/forest_atmosphere.dart:493` it does not close everything it opens, so those exact lines 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) frontend/lib/features/auth/widgets/forest_particles.dart:289 — frontend/lib/features/auth/widgets/forest_particles.dart:289-298 | frontend/lib/features/auth/widgets/forest_particles.dart:348-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/auth/widgets/forest_particles.dart:289` it does not close everything it opens, so those exact lines 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) frontend/lib/features/binding/screens/binding_view.dart:1032 — frontend/lib/features/binding/screens/binding_view.dart:1032-1041 | frontend/lib/features/memory/screens/memory_detail_page.dart:76-85 — 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 `frontend/lib/features/binding/screens/binding_view.dart:1032` it does not close everything it opens, so those exact lines 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) frontend/lib/features/reward/screens/inventory_page.dart:47 — frontend/lib/features/reward/screens/inventory_page.dart:47-56 | frontend/lib/features/reward/screens/reward_shop_page.dart:56-65 — before extracting anything, compare `frontend/lib/features/reward/screens/inventory_page.dart` and `frontend/lib/features/reward/screens/reward_shop_page.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) frontend/lib/features/reward/screens/reward_shop_page.dart:564 — frontend/lib/features/reward/screens/reward_shop_page.dart:564-573 | frontend/lib/features/reward/screens/reward_shop_page.dart:589-598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/reward/screens/reward_shop_page.dart:564` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `frontend/lib/features/reward/screens/reward_shop_page.dart:599` calls `isDeleting` and `frontend/lib/features/reward/screens/reward_shop_page.dart:574` 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×5
  • Low cohesion: _AuthCopy (LCOM4 9) frontend/lib/features/auth/screens/login_screen.dart:1197 — _AuthCopy's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SupabaseAuthService (LCOM4 6) frontend/lib/core/services/supabase_auth_service.dart:8 — SupabaseAuthService's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: GuideController (LCOM4 6) frontend/lib/features/quest/controllers/guide_controller.dart:98 — GuideController's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: QuestController (LCOM4 5) frontend/lib/features/quest/controllers/quest_controller.dart:50 — QuestController's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: _GuideComposerState (LCOM4 4) frontend/lib/features/quest/widgets/guide_panel_dialog.dart:790 — _GuideComposerState'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.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×4
  • Edited copy of a member (15 corresponding lines) frontend/lib/features/quest/controllers/quest_controller.dart:1647 — frontend/lib/features/quest/controllers/quest_controller.dart:1647-1662 | frontend/lib/features/quest/controllers/quest_controller.dart:1664-1678 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:1371 — frontend/lib/features/quest/controllers/guide_controller.dart:1371-1392 | frontend/lib/features/quest/controllers/guide_controller.dart:1394-1408 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:1585 — frontend/lib/features/quest/controllers/guide_controller.dart:1585-1599 | frontend/lib/features/quest/controllers/guide_controller.dart:1601-1615 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) frontend/lib/core/services/local_agent_runtime_service.dart:304 — frontend/lib/core/services/local_agent_runtime_service.dart:304-318 | frontend/lib/core/services/local_agent_runtime_service.dart:320-337 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×4
  • Duplicated block (21 lines × 2) frontend/lib/features/memory/screens/memory_detail_page.dart:259 — frontend/lib/features/memory/screens/memory_detail_page.dart:259-279 | frontend/lib/features/memory/widgets/memory_card.dart:287-307 — before extracting anything, compare `frontend/lib/features/memory/screens/memory_detail_page.dart` and `frontend/lib/features/memory/widgets/memory_card.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/memory/screens/memory_detail_page.dart:259` it does not close everything it opens, so those exact lines 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) frontend/lib/features/quest/controllers/guide_controller.dart:388 — frontend/lib/features/quest/controllers/guide_controller.dart:388-408 | frontend/lib/features/quest/screens/home_page.dart:2799-2819 — before extracting anything, compare `frontend/lib/features/quest/controllers/guide_controller.dart` and `frontend/lib/features/quest/screens/home_page.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 283 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:388` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `frontend/lib/features/quest/screens/home_page.dart:2822` calls `_performAgentNavigation` and `frontend/lib/features/quest/controllers/guide_controller.dart:409` 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 (21 lines × 2) frontend/lib/features/quest/controllers/quest_controller.dart:1727 — frontend/lib/features/quest/controllers/quest_controller.dart:1727-1747 | frontend/lib/features/quest/controllers/quest_controller.dart:1775-1795 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/quest_controller.dart:1727` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (21 lines × 2) frontend/lib/features/quest/widgets/agent_approval_card.dart:20 — frontend/lib/features/quest/widgets/agent_approval_card.dart:20-40 | frontend/lib/features/quest/widgets/guide_panel_dialog.dart:479-499 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `frontend/lib/features/quest/widgets/agent_approval_card.dart:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×4
  • Duplicated block (13–14 lines × 2) frontend/lib/features/auth/widgets/forest_atmosphere.dart:252 — frontend/lib/features/auth/widgets/forest_atmosphere.dart:252-264 | frontend/lib/features/auth/widgets/soft_auth_background.dart:39-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `frontend/lib/features/auth/widgets/forest_atmosphere.dart:252` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) frontend/lib/features/memory/widgets/memory_filter_sheet.dart:73 — frontend/lib/features/memory/widgets/memory_filter_sheet.dart:73-86 | frontend/lib/features/memory/widgets/memory_filter_sheet.dart:94-106 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/memory/widgets/memory_filter_sheet.dart:73` it begins part-way through the construct above it, so those exact lines 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) frontend/lib/features/quest/controllers/guide_controller.dart:1509 — frontend/lib/features/quest/controllers/guide_controller.dart:1509-1521 | frontend/lib/features/quest/screens/home_page.dart:1198-1211 — before extracting anything, compare `frontend/lib/features/quest/controllers/guide_controller.dart` and `frontend/lib/features/quest/screens/home_page.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 283 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:1509` it begins part-way through the construct above it, so those exact lines 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) frontend/lib/features/quest/widgets/quest_edit_sheet.dart:268 — frontend/lib/features/quest/widgets/quest_edit_sheet.dart:268-281 | frontend/lib/features/quest/widgets/quest_edit_sheet.dart:315-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/widgets/quest_edit_sheet.dart:268` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×4
  • Duplicated block (13 lines × 2) frontend/lib/core/services/evermemos_service.dart:243 — frontend/lib/core/services/evermemos_service.dart:243-255 | frontend/lib/core/services/evermemos_service.dart:292-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) frontend/lib/features/binding/screens/binding_view.dart:339 — frontend/lib/features/binding/screens/binding_view.dart:339-351 | frontend/lib/features/binding/screens/binding_view.dart:367-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/binding/screens/binding_view.dart:339` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) frontend/lib/features/binding/screens/binding_view.dart:917 — frontend/lib/features/binding/screens/binding_view.dart:917-929 | frontend/lib/features/binding/screens/binding_view.dart:998-1010 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/binding/screens/binding_view.dart:917` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) frontend/lib/features/reward/screens/inventory_page.dart:165 — frontend/lib/features/reward/screens/inventory_page.dart:165-177 | frontend/lib/features/reward/screens/inventory_page.dart:285-297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/reward/screens/inventory_page.dart:165` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×4
  • Duplicated block (8 lines × 2) frontend/lib/core/services/guide_service.dart:565 — frontend/lib/core/services/guide_service.dart:565-572 | frontend/lib/core/services/guide_service.dart:612-619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/core/services/guide_service.dart:565` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) frontend/lib/features/binding/screens/binding_view.dart:993 — frontend/lib/features/binding/screens/binding_view.dart:993-1000 | frontend/lib/features/quest/widgets/guide_panel_dialog.dart:699-706 — 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 `frontend/lib/features/binding/screens/binding_view.dart:993` it does not close everything it opens, so those exact lines 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) frontend/lib/features/memory/screens/memory_detail_page.dart:79 — frontend/lib/features/memory/screens/memory_detail_page.dart:79-86 | frontend/lib/features/memory/widgets/memory_card.dart:147-154 — before extracting anything, compare `frontend/lib/features/memory/screens/memory_detail_page.dart` and `frontend/lib/features/memory/widgets/memory_card.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/memory/screens/memory_detail_page.dart:79` it does not close everything it opens, so those exact lines 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) frontend/lib/features/memory/widgets/memory_card.dart:145 — frontend/lib/features/memory/widgets/memory_card.dart:145-152 | frontend/lib/features/quest/widgets/guide_panel_dialog.dart:697-704 — 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 `frontend/lib/features/memory/widgets/memory_card.dart:145` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 12, cognitive 12) · ×4
  • Complex function (anonymous) (cyclomatic 12, cognitive 12) supabase/functions/guide-bootstrap/index.ts:7 — (anonymous) has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function (anonymous) (cyclomatic 12, cognitive 12) supabase/functions/guide-chat/index.ts:7 — (anonymous) has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function (anonymous) (cyclomatic 12, cognitive 12) supabase/functions/guide-event-generate/index.ts:7 — (anonymous) has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function (anonymous) (cyclomatic 12, cognitive 12) supabase/functions/guide-night-reflection/index.ts:15 — (anonymous) has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
D1 · Cyclomatic Complexity · index.Deno.serve() (cyclomatic 17) · ×3
  • index.Deno.serve() (cyclomatic 17) supabase/functions/guide-freeform-chat/index.ts:26 — index.Deno.serve() 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.
  • index.Deno.serve() (cyclomatic 17) supabase/functions/sync-user-memory/index.ts:343 — index.Deno.serve() has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
  • index.Deno.serve() (cyclomatic 17) REDACTED:450 — index.Deno.serve() has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×3
  • Edited copy of a member (20 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:613 — frontend/lib/features/quest/controllers/guide_controller.dart:613-632 | frontend/lib/features/quest/screens/home_page.dart:703-722 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) frontend/lib/core/services/agent_service.dart:128 — frontend/lib/core/services/agent_service.dart:128-147 | frontend/lib/core/services/agent_service.dart:205-230 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) frontend/lib/features/auth/screens/forest_login_page.dart:124 — frontend/lib/features/auth/screens/forest_login_page.dart:124-143 | frontend/lib/features/auth/screens/forest_login_web_page_web.dart:125-150 — 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 (18 corresponding lines) · ×3
  • Edited copy of a member (18 corresponding lines) frontend/lib/features/quest/controllers/quest_controller.dart:1912 — frontend/lib/features/quest/controllers/quest_controller.dart:1912-1936 | frontend/lib/features/quest/controllers/quest_controller.dart:1938-1955 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:1345 — frontend/lib/features/quest/controllers/guide_controller.dart:1345-1363 | frontend/lib/features/quest/screens/home_page.dart:1809-1826 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) frontend/lib/features/auth/screens/forest_login_page.dart:173 — frontend/lib/features/auth/screens/forest_login_page.dart:173-190 | frontend/lib/features/auth/screens/forest_login_web_page_web.dart:177-194 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×3
  • Edited copy of a member (8 corresponding lines) frontend/lib/features/auth/widgets/forest_particles.dart:324 — frontend/lib/features/auth/widgets/forest_particles.dart:324-331 | frontend/lib/features/auth/widgets/forest_particles.dart:381-391 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) frontend/lib/features/reward/screens/inventory_page.dart:32 — frontend/lib/features/reward/screens/inventory_page.dart:32-39 | frontend/lib/features/reward/screens/reward_shop_page.dart:38-47 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) frontend/lib/features/auth/widgets/forest_atmosphere.dart:17 — frontend/lib/features/auth/widgets/forest_atmosphere.dart:17-24 | frontend/lib/features/auth/widgets/forest_particles.dart:21-29 — 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 (12 corresponding lines) · ×3
  • Edited copy of a member (12 corresponding lines) frontend/lib/features/quest/services/agent_run_service.dart:78 — frontend/lib/features/quest/services/agent_run_service.dart:78-89 | frontend/lib/features/quest/services/agent_run_service.dart:91-102 — 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) frontend/lib/features/auth/screens/forest_login_page.dart:145 — frontend/lib/features/auth/screens/forest_login_page.dart:145-156 | frontend/lib/features/auth/screens/forest_login_web_page_web.dart:152-169 — 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) frontend/lib/features/memory/controllers/memory_controller.dart:87 — frontend/lib/features/memory/controllers/memory_controller.dart:87-100 | frontend/lib/features/quest/widgets/quick_add_bar.dart:71-82 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×3
  • Edited copy of a member (4 corresponding lines) frontend/lib/features/memory/screens/memory_detail_page.dart:343 — frontend/lib/features/memory/screens/memory_detail_page.dart:343-346 | frontend/lib/features/quest/screens/boost_history_page.dart:200-203 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) frontend/lib/features/quest/widgets/guide_panel_dialog.dart:795 — frontend/lib/features/quest/widgets/guide_panel_dialog.dart:795-798 | frontend/lib/features/quest/widgets/quick_create_dialog_content.dart:154-157 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) frontend/lib/features/quest/widgets/quest_edit_sheet.dart:66 — frontend/lib/features/quest/widgets/quest_edit_sheet.dart:66-69 | frontend/lib/features/quest/widgets/quick_create_dialog_content.dart:123-126 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×3
  • Duplicated block (7 lines × 2) frontend/lib/core/services/agent_service.dart:300 — frontend/lib/core/services/agent_service.dart:300-306 | frontend/lib/features/quest/models/agent_step.dart:88-94 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (7 lines × 2) frontend/lib/core/services/evermemos_service.dart:795 — frontend/lib/core/services/evermemos_service.dart:795-801 | frontend/lib/core/services/evermemos_service.dart:882-888 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/core/services/evermemos_service.dart:795` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) frontend/lib/features/quest/controllers/guide_controller.dart:1690 — frontend/lib/features/quest/controllers/guide_controller.dart:1690-1696 | frontend/lib/features/quest/screens/home_page.dart:477-483 — before extracting anything, compare `frontend/lib/features/quest/controllers/guide_controller.dart` and `frontend/lib/features/quest/screens/home_page.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 283 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:1690` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×3
  • Duplicated block (5 lines × 3) frontend/lib/features/quest/models/agent_run.dart:53 — frontend/lib/features/quest/models/agent_run.dart:53-57 | frontend/lib/features/quest/models/agent_step.dart:76-80 | frontend/lib/features/quest/services/weekly_summary_job_service.dart:70-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 3) frontend/lib/features/quest/models/agent_run.dart:59 — frontend/lib/features/quest/models/agent_run.dart:59-63 | frontend/lib/features/quest/models/agent_step.dart:82-86 | frontend/lib/features/quest/services/weekly_summary_job_service.dart:76-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 3) frontend/lib/features/quest/widgets/quest_edit_sheet.dart:60 — frontend/lib/features/quest/widgets/quest_edit_sheet.dart:60-64 | frontend/lib/features/quest/widgets/quest_item.dart:69-73 | frontend/lib/features/quest/widgets/quick_create_dialog_content.dart:117-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
R10 · Code Duplication · Duplicated block (19 lines × 2 locations) · ×3
  • Duplicated block (19 lines × 2 locations) supabase/functions/agent-run-status/index.ts:37 — supabase/functions/agent-run-status/index.ts:37 · supabase/functions/agent-step-approve/index.ts:76 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (19 lines × 2 locations) supabase/functions/agent-step-complete/index_test.ts:172 — supabase/functions/agent-step-complete/index_test.ts:172 · supabase/functions/agent-turn/index_test.ts:121 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
  • Duplicated block (19 lines × 2 locations) supabase/functions/sync-user-memory/index.ts:339 — supabase/functions/sync-user-memory/index.ts:339 · REDACTED:448 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (15 lines × 2 locations) · ×3
  • Duplicated block (15 lines × 2 locations) supabase/functions/agent-step-approve/index.ts:129 — supabase/functions/agent-step-approve/index.ts:129 · supabase/functions/agent-step-complete/index.ts:307 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (15 lines × 2 locations) REDACTED:29 — REDACTED:29 · supabase/functions/weekly-report-push/index.ts:13 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (15 lines × 2 locations) REDACTED:334 — REDACTED:334 · supabase/functions/weekly-report-push/index.ts:111 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×3
  • Duplicated block (13 lines × 2 locations) supabase/functions/_shared/agent_engine.ts:223 — supabase/functions/_shared/agent_engine.ts:223 · supabase/functions/_shared/agent_engine.ts:260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2 locations) supabase/functions/_shared/agent_tool_execution_test.ts:257 — supabase/functions/_shared/agent_tool_execution_test.ts:257 · supabase/functions/_shared/agent_tool_execution_test.ts:287 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (13 lines × 2 locations) supabase/functions/agent-step-complete/index_test.ts:14 — supabase/functions/agent-step-complete/index_test.ts:14 · supabase/functions/agent-step-complete/index_test.ts:71 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
D17 · Explicit Debt · TodoComment · ×2
  • TodoComment frontend/lib/main.dart:91 — // TODO: 暂时禁用隐私协议弹窗,待调整后重新启用 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment frontend/lib/features/quest/screens/boost_history_page.dart:192 — // TODO: 加载更多 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) frontend/lib/features/quest/controllers/guide_controller.dart:1115 — frontend/lib/features/quest/controllers/guide_controller.dart:1115-1121 | frontend/lib/features/quest/controllers/quest_controller.dart:165-170 | frontend/lib/features/quest/screens/life_diary_page.dart:37-42 | frontend/lib/features/quest/widgets/quest_edit_sheet.dart:53-58 — 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) frontend/lib/features/stats/widgets/completion_chart.dart:31 — frontend/lib/features/stats/widgets/completion_chart.dart:31-108 | frontend/lib/features/stats/widgets/streak_calendar.dart:22-110 | frontend/lib/features/stats/widgets/tier_pie_chart.dart:23-90 | frontend/lib/features/stats/widgets/xp_curve_chart.dart:27-231 — 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 (44 corresponding lines) · ×2
  • Edited copy of a member (44 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:1495 — frontend/lib/features/quest/controllers/guide_controller.dart:1495-1538 | frontend/lib/features/quest/screens/home_page.dart:1179-1228 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (44 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:1540 — frontend/lib/features/quest/controllers/guide_controller.dart:1540-1583 | frontend/lib/features/quest/screens/home_page.dart:1230-1275 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×2
  • Edited copy of a member (32 corresponding lines) frontend/lib/shared/widgets/quest_dialog_shell.dart:357 — frontend/lib/shared/widgets/quest_dialog_shell.dart:357-388 | frontend/lib/shared/widgets/quest_dialog_shell.dart:405-439 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (32 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:1690 — frontend/lib/features/quest/controllers/guide_controller.dart:1690-1724 | frontend/lib/features/quest/screens/home_page.dart:477-508 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×2
  • Edited copy of a member (24 corresponding lines) frontend/lib/features/reward/screens/reward_shop_page.dart:562 — frontend/lib/features/reward/screens/reward_shop_page.dart:562-585 | frontend/lib/features/reward/screens/reward_shop_page.dart:587-617 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (24 corresponding lines) frontend/lib/features/quest/controllers/quest_controller.dart:846 — frontend/lib/features/quest/controllers/quest_controller.dart:846-872 | frontend/lib/features/quest/controllers/quest_controller.dart:1411-1434 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×2
  • Edited copy of a member (22 corresponding lines) frontend/lib/features/auth/widgets/forest_particles.dart:288 — frontend/lib/features/auth/widgets/forest_particles.dart:288-310 | frontend/lib/features/auth/widgets/forest_particles.dart:347-368 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:532 — frontend/lib/features/quest/controllers/guide_controller.dart:532-553 | frontend/lib/features/quest/screens/home_page.dart:797-819 — 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 (19 corresponding lines) · ×2
  • Edited copy of a member (19 corresponding lines) frontend/lib/core/services/guide_service.dart:750 — frontend/lib/core/services/guide_service.dart:750-774 | frontend/lib/features/quest/controllers/guide_controller.dart:2103-2121 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) frontend/lib/features/reward/screens/inventory_page.dart:58 — frontend/lib/features/reward/screens/inventory_page.dart:58-76 | frontend/lib/features/reward/screens/inventory_page.dart:78-98 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×2
  • Edited copy of a member (14 corresponding lines) frontend/lib/features/achievement/widgets/achievement_unlock_overlay.dart:84 — frontend/lib/features/achievement/widgets/achievement_unlock_overlay.dart:84-97 | frontend/lib/shared/widgets/celebration_overlay.dart:51-73 — 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) frontend/lib/features/auth/widgets/forest_atmosphere.dart:572 — frontend/lib/features/auth/widgets/forest_atmosphere.dart:572-586 | frontend/lib/features/auth/widgets/forest_particles.dart:141-154 — 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 (16 corresponding lines) · ×2
  • Edited copy of a member (16 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:577 — frontend/lib/features/quest/controllers/guide_controller.dart:577-592 | frontend/lib/features/quest/screens/home_page.dart:685-700 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) frontend/lib/core/services/evermemos_service.dart:720 — frontend/lib/core/services/evermemos_service.dart:720-735 | frontend/lib/core/services/evermemos_service.dart:737-752 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×2
  • Duplicated block (25 lines × 2) frontend/lib/features/quest/controllers/quest_controller.dart:962 — frontend/lib/features/quest/controllers/quest_controller.dart:962-986 | frontend/lib/features/quest/controllers/quest_controller.dart:1052-1076 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/quest_controller.dart:962` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (25 lines × 2) frontend/lib/features/quest/screens/home_page.dart:1877 — frontend/lib/features/quest/screens/home_page.dart:1877-1901 | frontend/lib/features/quest/screens/home_page.dart:2013-2037 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/screens/home_page.dart:1877` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×2
  • Duplicated block (22 lines × 2) frontend/lib/features/quest/controllers/guide_controller.dart:1728 — frontend/lib/features/quest/controllers/guide_controller.dart:1728-1749 | frontend/lib/features/quest/screens/home_page.dart:512-533 — before extracting anything, compare `frontend/lib/features/quest/controllers/guide_controller.dart` and `frontend/lib/features/quest/screens/home_page.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 283 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:1728` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (22 lines × 2) frontend/lib/features/quest/screens/home_page.dart:2176 — frontend/lib/features/quest/screens/home_page.dart:2176-2197 | frontend/lib/features/quest/screens/home_page.dart:2350-2371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/screens/home_page.dart:2176` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) frontend/lib/features/auth/widgets/forest_atmosphere.dart:290 — frontend/lib/features/auth/widgets/forest_atmosphere.dart:290-309 | frontend/lib/features/auth/widgets/forest_atmosphere.dart:317-336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/auth/widgets/forest_atmosphere.dart:290` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (20 lines × 2) frontend/lib/features/memory/screens/memory_detail_page.dart:322 — frontend/lib/features/memory/screens/memory_detail_page.dart:322-341 | frontend/lib/features/memory/widgets/memory_card.dart:383-402 — before extracting anything, compare `frontend/lib/features/memory/screens/memory_detail_page.dart` and `frontend/lib/features/memory/widgets/memory_card.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×2
  • Duplicated block (19 lines × 2) frontend/lib/features/quest/controllers/guide_controller.dart:1541 — frontend/lib/features/quest/controllers/guide_controller.dart:1541-1559 | frontend/lib/features/quest/screens/home_page.dart:1231-1249 — before extracting anything, compare `frontend/lib/features/quest/controllers/guide_controller.dart` and `frontend/lib/features/quest/screens/home_page.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 283 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:1541` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (19 lines × 2) frontend/lib/features/quest/widgets/quick_create_dialog_content.dart:462 — frontend/lib/features/quest/widgets/quick_create_dialog_content.dart:462-480 | frontend/lib/features/quest/widgets/quick_create_dialog_content.dart:525-543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×2
  • Duplicated block (18 lines × 2) frontend/lib/core/services/agent_service.dart:165 — frontend/lib/core/services/agent_service.dart:165-182 | frontend/lib/core/services/agent_service.dart:186-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/core/services/agent_service.dart:165` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) frontend/lib/features/quest/controllers/guide_controller.dart:653 — frontend/lib/features/quest/controllers/guide_controller.dart:653-670 | frontend/lib/features/quest/screens/home_page.dart:745-762 — before extracting anything, compare `frontend/lib/features/quest/controllers/guide_controller.dart` and `frontend/lib/features/quest/screens/home_page.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 283 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:653` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×2
  • Duplicated block (16 lines × 3) frontend/lib/features/quest/screens/home_page.dart:1300 — frontend/lib/features/quest/screens/home_page.dart:1300-1315 | frontend/lib/features/quest/screens/home_page.dart:1329-1344 | frontend/lib/features/quest/screens/home_page.dart:1356-1371 — 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 `frontend/lib/features/quest/screens/home_page.dart:1300` it does not close everything it opens, so those 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, `frontend/lib/features/quest/screens/home_page.dart:1327` calls `buyReward` and `frontend/lib/features/quest/screens/home_page.dart:1354` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (16 lines × 3) frontend/lib/features/stats/widgets/completion_chart.dart:48 — frontend/lib/features/stats/widgets/completion_chart.dart:48-63 | frontend/lib/features/stats/widgets/streak_calendar.dart:43-58 | frontend/lib/features/stats/widgets/xp_curve_chart.dart:48-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/stats/widgets/completion_chart.dart:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×2
  • Duplicated block (16 lines × 2) frontend/lib/features/binding/screens/binding_view.dart:624 — frontend/lib/features/binding/screens/binding_view.dart:624-639 | frontend/lib/features/binding/screens/binding_view.dart:1148-1163 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/binding/screens/binding_view.dart:624` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) frontend/lib/features/quest/widgets/home_settings_widgets.dart:196 — frontend/lib/features/quest/widgets/home_settings_widgets.dart:196-211 | frontend/lib/features/quest/widgets/home_settings_widgets.dart:285-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/widgets/home_settings_widgets.dart:196` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) frontend/lib/features/quest/controllers/quest_controller.dart:851 — frontend/lib/features/quest/controllers/quest_controller.dart:851-866 | frontend/lib/features/quest/controllers/quest_controller.dart:1414-1428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/quest_controller.dart:851` it begins part-way through the construct above it, so those exact lines 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) frontend/lib/features/quest/widgets/agent_approval_card.dart:32 — frontend/lib/features/quest/widgets/agent_approval_card.dart:32-47 | frontend/lib/features/quest/widgets/agent_step_timeline.dart:22-36 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `frontend/lib/features/quest/widgets/agent_approval_card.dart:32` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×2
  • Duplicated block (12 lines × 3) frontend/lib/features/memory/screens/memory_page.dart:134 — frontend/lib/features/memory/screens/memory_page.dart:134-145 | frontend/lib/features/memory/widgets/memory_card.dart:51-62 | frontend/lib/features/memory/widgets/portrait_timeline.dart:25-36 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (12 lines × 3) frontend/lib/features/reward/screens/inventory_page.dart:129 — frontend/lib/features/reward/screens/inventory_page.dart:129-140 | frontend/lib/features/reward/screens/inventory_page.dart:242-253 | frontend/lib/features/reward/screens/reward_shop_page.dart:775-786 — before extracting anything, compare `frontend/lib/features/reward/screens/inventory_page.dart` and `frontend/lib/features/reward/screens/reward_shop_page.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×2
  • Duplicated block (11 lines × 2) frontend/lib/features/reward/screens/reward_shop_page.dart:168 — frontend/lib/features/reward/screens/reward_shop_page.dart:168-178 | frontend/lib/features/reward/screens/reward_shop_page.dart:197-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/reward/screens/reward_shop_page.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. 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) frontend/lib/features/reward/screens/reward_shop_page.dart:662 — frontend/lib/features/reward/screens/reward_shop_page.dart:662-672 | frontend/lib/features/reward/screens/reward_shop_page.dart:689-699 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9–10 lines × 3) · ×2
  • Duplicated block (9–10 lines × 3) frontend/lib/features/quest/controllers/quest_controller.dart:1738 — frontend/lib/features/quest/controllers/quest_controller.dart:1738-1747 | frontend/lib/features/quest/controllers/quest_controller.dart:1786-1795 | frontend/lib/features/quest/controllers/quest_controller.dart:1879-1887 — 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 `frontend/lib/features/quest/controllers/quest_controller.dart:1738` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9–10 lines × 3) frontend/lib/features/quest/screens/home_page.dart:1965 — frontend/lib/features/quest/screens/home_page.dart:1965-1974 | frontend/lib/features/quest/screens/home_page.dart:2136-2144 | frontend/lib/features/quest/screens/home_page.dart:2425-2434 — 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 `frontend/lib/features/quest/screens/home_page.dart:1965` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×2
  • Duplicated block (9 lines × 3) frontend/lib/features/stats/widgets/hero_xp_card.dart:29 — frontend/lib/features/stats/widgets/hero_xp_card.dart:29-37 | frontend/lib/features/stats/widgets/milestone_highlights.dart:25-33 | frontend/lib/features/stats/widgets/motivational_insight.dart:21-29 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/stats/widgets/hero_xp_card.dart:29` it does not close everything it opens, so those 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, `frontend/lib/features/stats/widgets/milestone_highlights.dart:23` calls `shrink` and `frontend/lib/features/stats/widgets/hero_xp_card.dart:28` 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 × 3) frontend/lib/features/auth/widgets/forest_atmosphere.dart:485 — frontend/lib/features/auth/widgets/forest_atmosphere.dart:485-493 | frontend/lib/features/auth/widgets/forest_atmosphere.dart:496-504 | frontend/lib/features/auth/widgets/forest_atmosphere.dart:507-515 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×2
  • Duplicated block (9 lines × 2) frontend/lib/features/quest/screens/home_page.dart:272 — frontend/lib/features/quest/screens/home_page.dart:272-280 | frontend/lib/features/quest/screens/home_page.dart:290-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/screens/home_page.dart:272` it does not close everything it opens, so those exact lines 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) frontend/lib/features/quest/screens/home_page.dart:4309 — frontend/lib/features/quest/screens/home_page.dart:4309-4317 | frontend/lib/features/quest/screens/home_page.dart:4323-4331 — both copies are in the same file, so extract the 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, `frontend/lib/features/quest/screens/home_page.dart:4334` calls `PopupMenuDivider` and `frontend/lib/features/quest/screens/home_page.dart:4320` 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.
R10 · Code Duplication · Duplicated block (16 lines × 2 locations) · ×2
  • Duplicated block (16 lines × 2 locations) promo-video/src/EarthOnlinePromo.tsx:437 — promo-video/src/EarthOnlinePromo.tsx:437 · promo-video/src/EverMemOSDemo.tsx:328 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (16 lines × 2 locations) supabase/functions/_shared/breakpoint_helpers.ts:95 — supabase/functions/_shared/breakpoint_helpers.ts:95 · supabase/functions/_shared/breakpoint_helpers.ts:173 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 15, cognitive 18) · ×2
  • Complex function (anonymous) (cyclomatic 15, cognitive 18) supabase/functions/knowledge-extraction/index.ts:30 — (anonymous) has cyclomatic complexity 15 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
  • Complex function (anonymous) (cyclomatic 15, cognitive 18) REDACTED:318 — (anonymous) has cyclomatic complexity 15 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R7 · Dead Code · Dead file (~62 LoC) · ×2
  • Dead file (~62 LoC) supabase/functions/_shared/wechat_agent_test.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
  • Dead file (~62 LoC) supabase/functions/agent-run-status/index_test.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
AC1 · Text alternatives · <canvas> without a text alternative · ×1
  • <canvas> without a text alternative REDACTED:496 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
AC3 · Page structure · Page without a main landmark · ×1
  • Page without a main landmark REDACTED:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×1
  • Focus outline removed in CSS without a :focus replacement REDACTED:267 — `.input-row input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (4.3 · ×1
  • Low contrast colour pair in CSS (4.3:1) REDACTED:249 — `.auth-btn.active` sets color: #fff on background-color: #2F8A43 — 4.3:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair (4.3 · ×1
  • Low contrast colour pair (4.3:1) promo-video/src/EarthOnlinePromo.tsx:1297 — The inline foreground/background colours fall below the 4.5:1 WCAG AA minimum for normal text. Darken/lighten one of them.
D1 · Cyclomatic Complexity · GuideController.matchGuideAction (cyclomatic 59) · ×1
  • GuideController.matchGuideAction (cyclomatic 59) frontend/lib/features/quest/controllers/guide_controller.dart:1410 — GuideController.matchGuideAction has cyclomatic complexity 59 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · guide_memory.gatherGuideMemoryBundle (cyclomatic 53) · ×1
  • guide_memory.gatherGuideMemoryBundle (cyclomatic 53) supabase/functions/_shared/guide_memory.ts:902 — guide_memory.gatherGuideMemoryBundle has cyclomatic complexity 53 (threshold 15). Of this number, 40 points are the body's own statements and 13 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _HomePageState._handleGuideModifyTask (cyclomatic 39) · ×1
  • _HomePageState._handleGuideModifyTask (cyclomatic 39) frontend/lib/features/quest/screens/home_page.dart:2285 — _HomePageState._handleGuideModifyTask has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _QuestItemState.build (cyclomatic 37) · ×1
  • _QuestItemState.build (cyclomatic 37) frontend/lib/features/quest/widgets/quest_item.dart:119 — _QuestItemState.build has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · QuestController.simulateAIParsing (cyclomatic 36) · ×1
  • QuestController.simulateAIParsing (cyclomatic 36) frontend/lib/features/quest/controllers/quest_controller.dart:1958 — QuestController.simulateAIParsing has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QuestController.moveQuestByDrop (cyclomatic 32) · ×1
  • QuestController.moveQuestByDrop (cyclomatic 32) frontend/lib/features/quest/controllers/quest_controller.dart:469 — QuestController.moveQuestByDrop has cyclomatic complexity 32 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · QuestController.toggleQuestCompletion (cyclomatic 31) · ×1
  • QuestController.toggleQuestCompletion (cyclomatic 31) frontend/lib/features/quest/controllers/quest_controller.dart:1531 — QuestController.toggleQuestCompletion has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _HomePageState._handlePendingGuideTaskEdit (cyclomatic 31) · ×1
  • _HomePageState._handlePendingGuideTaskEdit (cyclomatic 31) frontend/lib/features/quest/screens/home_page.dart:1871 — _HomePageState._handlePendingGuideTaskEdit has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agent_planner.planAgentGoal (cyclomatic 30) · ×1
  • agent_planner.planAgentGoal (cyclomatic 30) REDACTED:195 — agent_planner.planAgentGoal has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agent_policy.inferAgentRiskLevel (cyclomatic 28) · ×1
  • agent_policy.inferAgentRiskLevel (cyclomatic 28) supabase/functions/_shared/agent_policy.ts:32 — agent_policy.inferAgentRiskLevel has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.handleTaskCapture (cyclomatic 28) · ×1
  • index.handleTaskCapture (cyclomatic 28) REDACTED:119 — index.handleTaskCapture has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 4 of the 28 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 142, 235). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · _QuestEditSheetState.build (cyclomatic 27) · ×1
  • _QuestEditSheetState.build (cyclomatic 27) frontend/lib/features/quest/widgets/quest_edit_sheet.dart:152 — _QuestEditSheetState.build has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.Deno.serve() (cyclomatic 26) · ×1
  • index.Deno.serve() (cyclomatic 26) supabase/functions/weekly-report-push/index.ts:115 — index.Deno.serve() has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _HomePageState._openGuidePanel (cyclomatic 25) · ×1
  • _HomePageState._openGuidePanel (cyclomatic 25) frontend/lib/features/quest/screens/home_page.dart:2905 — _HomePageState._openGuidePanel has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.createAgentStepCompleteHandler.<returned closure> (cyclomatic 25) · ×1
  • index.createAgentStepCompleteHandler.<returned closure> (cyclomatic 25) supabase/functions/agent-step-complete/index.ts:157 — index.createAgentStepCompleteHandler.<returned closure> has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · refactor_home.find_method_body_end (cyclomatic 23) · ×1
  • refactor_home.find_method_body_end (cyclomatic 23) refactor_home.py:16 — refactor_home.find_method_body_end has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _RewardShopPageState._openAddReward (cyclomatic 22) · ×1
  • _RewardShopPageState._openAddReward (cyclomatic 22) frontend/lib/features/reward/screens/reward_shop_page.dart:73 — _RewardShopPageState._openAddReward has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · guide_memory.isChainBreaking (cyclomatic 21) · ×1
  • guide_memory.isChainBreaking (cyclomatic 21) supabase/functions/_shared/guide_memory.ts:786 — guide_memory.isChainBreaking has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QuestController.createManualQuest (cyclomatic 20) · ×1
  • QuestController.createManualQuest (cyclomatic 20) frontend/lib/features/quest/controllers/quest_controller.dart:988 — QuestController.createManualQuest has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · QuestController.updateQuestDetails (cyclomatic 20) · ×1
  • QuestController.updateQuestDetails (cyclomatic 20) frontend/lib/features/quest/controllers/quest_controller.dart:1440 — QuestController.updateQuestDetails has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _HomePageState._runGuideBootstrapIfNeeded (cyclomatic 20) · ×1
  • _HomePageState._runGuideBootstrapIfNeeded (cyclomatic 20) frontend/lib/features/quest/screens/home_page.dart:831 — _HomePageState._runGuideBootstrapIfNeeded has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · refactor_home.main (cyclomatic 20) · ×1
  • refactor_home.main (cyclomatic 20) refactor_home.py:154 — refactor_home.main has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · index.Deno.serve() (cyclomatic 20) · ×1
  • index.Deno.serve() (cyclomatic 20) supabase/functions/guide-portrait-generate/index.ts:379 — index.Deno.serve() has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _MemoryCardState.build (cyclomatic 19) · ×1
  • _MemoryCardState.build (cyclomatic 19) frontend/lib/features/memory/widgets/memory_card.dart:43 — _MemoryCardState.build has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · GuideController.isGuideConfirmationText (cyclomatic 19) · ×1
  • GuideController.isGuideConfirmationText (cyclomatic 19) frontend/lib/features/quest/controllers/guide_controller.dart:1371 — GuideController.isGuideConfirmationText has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _HomePageState._handleGuideTurn (cyclomatic 19) · ×1
  • _HomePageState._handleGuideTurn (cyclomatic 19) frontend/lib/features/quest/screens/home_page.dart:2781 — _HomePageState._handleGuideTurn has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · agent_planner.replanAfterToolCompletion (cyclomatic 19) · ×1
  • agent_planner.replanAfterToolCompletion (cyclomatic 19) REDACTED:575 — agent_planner.replanAfterToolCompletion has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: agent_planner.isTaskCreateIntent (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · _QuickCreateDialogBodyState.build (cyclomatic 18) · ×1
  • _QuickCreateDialogBodyState.build (cyclomatic 18) frontend/lib/features/quest/widgets/quick_create_dialog_content.dart:229 — _QuickCreateDialogBodyState.build has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · REDACTED.draw (cyclomatic 18) · ×1
  • REDACTED.draw (cyclomatic 18) REDACTED:793 — REDACTED.draw has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.tryDetectMemoryAchievements (cyclomatic 18) · ×1
  • index.tryDetectMemoryAchievements (cyclomatic 18) supabase/functions/sync-user-memory/index.ts:252 — index.tryDetectMemoryAchievements has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QuestController._syncMemoryFireAndForget (cyclomatic 17) · ×1
  • QuestController._syncMemoryFireAndForget (cyclomatic 17) frontend/lib/features/quest/controllers/quest_controller.dart:325 — QuestController._syncMemoryFireAndForget has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _HomePageState._buildGuideQuickActionAnalysis (cyclomatic 17) · ×1
  • _HomePageState._buildGuideQuickActionAnalysis (cyclomatic 17) frontend/lib/features/quest/screens/home_page.dart:1409 — _HomePageState._buildGuideQuickActionAnalysis has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GuideService._inferErrorType (cyclomatic 16) · ×1
  • GuideService._inferErrorType (cyclomatic 16) frontend/lib/core/services/guide_service.dart:750 — GuideService._inferErrorType has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · GuideController.handleGuideTurn (cyclomatic 16) · ×1
  • GuideController.handleGuideTurn (cyclomatic 16) frontend/lib/features/quest/controllers/guide_controller.dart:375 — GuideController.handleGuideTurn has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GuideController.shouldGuideGenerateSubtasks (cyclomatic 16) · ×1
  • GuideController.shouldGuideGenerateSubtasks (cyclomatic 16) frontend/lib/features/quest/controllers/guide_controller.dart:2103 — GuideController.shouldGuideGenerateSubtasks has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · QuestController._upsertDailyLogForToday (cyclomatic 16) · ×1
  • QuestController._upsertDailyLogForToday (cyclomatic 16) frontend/lib/features/quest/controllers/quest_controller.dart:245 — QuestController._upsertDailyLogForToday has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _HomePageState._guideCompanionCardContent (cyclomatic 16) · ×1
  • _HomePageState._guideCompanionCardContent (cyclomatic 16) frontend/lib/features/quest/screens/home_page.dart:1555 — _HomePageState._guideCompanionCardContent has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _HomePageState._handleDocumentRecognition (cyclomatic 16) · ×1
  • _HomePageState._handleDocumentRecognition (cyclomatic 16) frontend/lib/features/quest/screens/home_page.dart:3323 — _HomePageState._handleDocumentRecognition has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _GuideComposerState._handleKeyEvent (cyclomatic 16) · ×1
  • _GuideComposerState._handleKeyEvent (cyclomatic 16) frontend/lib/features/quest/widgets/guide_panel_dialog.dart:855 — _GuideComposerState._handleKeyEvent has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _RewardShopPageState._friendlyErrorMessage (cyclomatic 16) · ×1
  • _RewardShopPageState._friendlyErrorMessage (cyclomatic 16) frontend/lib/features/reward/screens/reward_shop_page.dart:316 — _RewardShopPageState._friendlyErrorMessage has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · breakpoint_helpers.generateBoostContent (cyclomatic 16) · ×1
  • breakpoint_helpers.generateBoostContent (cyclomatic 16) supabase/functions/_shared/breakpoint_helpers.ts:238 — breakpoint_helpers.generateBoostContent has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · index.detectPatrolSignals (cyclomatic 16) · ×1
  • index.detectPatrolSignals (cyclomatic 16) REDACTED:95 — index.detectPatrolSignals has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · index.patrolUser (cyclomatic 16) · ×1
  • index.patrolUser (cyclomatic 16) REDACTED:196 — index.patrolUser has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · index.Deno.serve() (cyclomatic 16) · ×1
  • index.Deno.serve() (cyclomatic 16) supabase/functions/parse-document/index.ts:137 — index.Deno.serve() 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.
D2 · Cognitive Complexity · QuestController.simulateAIParsing (cognitive 81) · ×1
  • QuestController.simulateAIParsing (cognitive 81) frontend/lib/features/quest/controllers/quest_controller.dart:1958 — QuestController.simulateAIParsing has cognitive complexity 81 (threshold 15). Drivers by points: if/else 14 (40 pts), loops 8 (18 pts), error handling 5 (12 pts), boolean chains 6, ternaries 2 (5 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · guide_memory.gatherGuideMemoryBundle (cognitive 70) · ×1
  • guide_memory.gatherGuideMemoryBundle (cognitive 70) supabase/functions/_shared/guide_memory.ts:902 — guide_memory.gatherGuideMemoryBundle has cognitive complexity 70 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 16, ternaries 12 (14 pts), error handling 4 (7 pts), loops 4 (6 pts) (nesting depth added 18). Of this number, 57 points are the body's own statements and 13 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · refactor_home.find_method_body_end (cognitive 59) · ×1
  • refactor_home.find_method_body_end (cognitive 59) refactor_home.py:16 — refactor_home.find_method_body_end has cognitive complexity 59 (threshold 15). Drivers by points: if/else 11 (39 pts), loops 7 (17 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · GuideController.matchGuideAction (cognitive 58) · ×1
  • GuideController.matchGuideAction (cognitive 58) frontend/lib/features/quest/controllers/guide_controller.dart:1410 — GuideController.matchGuideAction has cognitive complexity 58 (threshold 15). Drivers by points: boolean chains 49, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _HomePageState._handleGuideModifyTask (cognitive 56) · ×1
  • _HomePageState._handleGuideModifyTask (cognitive 56) frontend/lib/features/quest/screens/home_page.dart:2285 — _HomePageState._handleGuideModifyTask has cognitive complexity 56 (threshold 15). Drivers by points: if/else 21 (24 pts), ternaries 9 (23 pts), boolean chains 9 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestController.toggleQuestCompletion (cognitive 52) · ×1
  • QuestController.toggleQuestCompletion (cognitive 52) frontend/lib/features/quest/controllers/quest_controller.dart:1531 — QuestController.toggleQuestCompletion has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 9, loops 3 (6 pts), ternaries 5, error handling 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HomePageState._handlePendingGuideTaskEdit (cognitive 49) · ×1
  • _HomePageState._handlePendingGuideTaskEdit (cognitive 49) frontend/lib/features/quest/screens/home_page.dart:1871 — _HomePageState._handlePendingGuideTaskEdit has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 14 (28 pts), if/else 11 (15 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent_planner.planAgentGoal (cognitive 43) · ×1
  • agent_planner.planAgentGoal (cognitive 43) REDACTED:195 — agent_planner.planAgentGoal has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 17 (31 pts), if/else 11, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestController.moveQuestByDrop (cognitive 41) · ×1
  • QuestController.moveQuestByDrop (cognitive 41) frontend/lib/features/quest/controllers/quest_controller.dart:469 — QuestController.moveQuestByDrop has cognitive complexity 41 (threshold 15). Drivers by points: if/else 23 (30 pts), boolean chains 5, loops 3 (4 pts), error handling 1, ternaries 1 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _HomePageState._openGuidePanel (cognitive 41) · ×1
  • _HomePageState._openGuidePanel (cognitive 41) frontend/lib/features/quest/screens/home_page.dart:2905 — _HomePageState._openGuidePanel has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 7 (12 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.tryDetectMemoryAchievements (cognitive 40) · ×1
  • index.tryDetectMemoryAchievements (cognitive 40) supabase/functions/sync-user-memory/index.ts:252 — index.tryDetectMemoryAchievements has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (22 pts), ternaries 4 (16 pts), boolean chains 1, loops 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · index.Deno.serve() (cognitive 39) · ×1
  • index.Deno.serve() (cognitive 39) supabase/functions/weekly-report-push/index.ts:115 — index.Deno.serve() has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 4 (9 pts), error handling 4 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 14). Of this number, 38 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _QuestEditSheetState.build (cognitive 38) · ×1
  • _QuestEditSheetState.build (cognitive 38) frontend/lib/features/quest/widgets/quest_edit_sheet.dart:152 — _QuestEditSheetState.build has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 13 (23 pts), boolean chains 8, if/else 5 (7 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · REDACTED.draw (cognitive 38) · ×1
  • REDACTED.draw (cognitive 38) REDACTED:793 — REDACTED.draw has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (36 pts), boolean chains 1, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _QuestItemState.build (cognitive 37) · ×1
  • _QuestItemState.build (cognitive 37) frontend/lib/features/quest/widgets/quest_item.dart:119 — _QuestItemState.build has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 24 (25 pts), if/else 7, boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · refactor_home.find_all_methods (cognitive 37) · ×1
  • refactor_home.find_all_methods (cognitive 37) refactor_home.py:100 — refactor_home.find_all_methods has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (30 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · _RewardShopPageState._openAddReward (cognitive 36) · ×1
  • _RewardShopPageState._openAddReward (cognitive 36) frontend/lib/features/reward/screens/reward_shop_page.dart:73 — _RewardShopPageState._openAddReward has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 5 (10 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · index.handleTaskCapture (cognitive 36) · ×1
  • index.handleTaskCapture (cognitive 36) REDACTED:119 — index.handleTaskCapture has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 9 (15 pts), if/else 11 (13 pts), boolean chains 4, loops 3, error handling 1 (nesting depth added 8). Most of this is not in the body itself: 4 of the 36 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 142, 235). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · refactor_home.main (cognitive 35) · ×1
  • refactor_home.main (cognitive 35) refactor_home.py:154 — refactor_home.main has cognitive complexity 35 (threshold 15). Drivers by points: loops 12 (22 pts), if/else 6 (12 pts), boolean chains 1 (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · guide_memory.isChainBreaking (cognitive 33) · ×1
  • guide_memory.isChainBreaking (cognitive 33) supabase/functions/_shared/guide_memory.ts:786 — guide_memory.isChainBreaking has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 13). Of this number, 24 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HomePageState._handleGuideTurn (cognitive 30) · ×1
  • _HomePageState._handleGuideTurn (cognitive 30) frontend/lib/features/quest/screens/home_page.dart:2781 — _HomePageState._handleGuideTurn has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 6 (10 pts), boolean chains 6, error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HomePageState._runGuideBootstrapIfNeeded (cognitive 29) · ×1
  • _HomePageState._runGuideBootstrapIfNeeded (cognitive 29) frontend/lib/features/quest/screens/home_page.dart:831 — _HomePageState._runGuideBootstrapIfNeeded has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · index.createAgentStepCompleteHandler.<returned closure> (cognitive 29) · ×1
  • index.createAgentStepCompleteHandler.<returned closure> (cognitive 29) supabase/functions/agent-step-complete/index.ts:157 — index.createAgentStepCompleteHandler.<returned closure> has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11, ternaries 8 (11 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · agent_policy.inferAgentRiskLevel (cognitive 28) · ×1
  • agent_policy.inferAgentRiskLevel (cognitive 28) supabase/functions/_shared/agent_policy.ts:32 — agent_policy.inferAgentRiskLevel has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 4, ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GuideController._handleGuideRedeemReward (cognitive 27) · ×1
  • GuideController._handleGuideRedeemReward (cognitive 27) frontend/lib/features/quest/controllers/guide_controller.dart:1926 — GuideController._handleGuideRedeemReward has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 8 (21 pts), if/else 3 (6 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestService.parseQuest (cognitive 26) · ×1
  • QuestService.parseQuest (cognitive 26) frontend/lib/core/services/quest_service.dart:63 — QuestService.parseQuest has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestController.updateQuestDetails (cognitive 26) · ×1
  • QuestController.updateQuestDetails (cognitive 26) frontend/lib/features/quest/controllers/quest_controller.dart:1440 — QuestController.updateQuestDetails has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 5 (10 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.
D2 · Cognitive Complexity · AgentService._invoke (cognitive 25) · ×1
  • AgentService._invoke (cognitive 25) frontend/lib/core/services/agent_service.dart:232 — AgentService._invoke has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (6 pts), boolean chains 3, error handling 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.Deno.serve() (cognitive 25) · ×1
  • index.Deno.serve() (cognitive 25) supabase/functions/guide-portrait-generate/index.ts:379 — index.Deno.serve() has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, ternaries 2 (4 pts), error handling 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GuideService._invoke (cognitive 24) · ×1
  • GuideService._invoke (cognitive 24) frontend/lib/core/services/guide_service.dart:653 — GuideService._invoke has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 3, error handling 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HomePageState._handleDocumentRecognition (cognitive 24) · ×1
  • _HomePageState._handleDocumentRecognition (cognitive 24) frontend/lib/features/quest/screens/home_page.dart:3323 — _HomePageState._handleDocumentRecognition has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2, loops 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.
D2 · Cognitive Complexity · _LifeDiaryPageState._pushToWechat (cognitive 24) · ×1
  • _LifeDiaryPageState._pushToWechat (cognitive 24) frontend/lib/features/quest/screens/life_diary_page.dart:197 — _LifeDiaryPageState._pushToWechat has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 2 (5 pts), boolean chains 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GuideController.handleGuideTurn (cognitive 23) · ×1
  • GuideController.handleGuideTurn (cognitive 23) frontend/lib/features/quest/controllers/guide_controller.dart:375 — GuideController.handleGuideTurn has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 5 (7 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HomePageState._buildGuideQuickActionAnalysis (cognitive 23) · ×1
  • _HomePageState._buildGuideQuickActionAnalysis (cognitive 23) frontend/lib/features/quest/screens/home_page.dart:1409 — _HomePageState._buildGuideQuickActionAnalysis has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (14 pts), if/else 9 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _MemoryCardState.build (cognitive 22) · ×1
  • _MemoryCardState.build (cognitive 22) frontend/lib/features/memory/widgets/memory_card.dart:43 — _MemoryCardState.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 6 (9 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · index.detectPatrolSignals (cognitive 22) · ×1
  • index.detectPatrolSignals (cognitive 22) REDACTED:95 — index.detectPatrolSignals has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 7). Of this number, 19 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.Deno.serve() (cognitive 22) · ×1
  • index.Deno.serve() (cognitive 22) supabase/functions/sync-user-memory/index.ts:343 — index.Deno.serve() has cognitive complexity 22 (threshold 15). Drivers by points: error handling 6 (11 pts), if/else 7 (8 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestController.createManualQuest (cognitive 21) · ×1
  • QuestController.createManualQuest (cognitive 21) frontend/lib/features/quest/controllers/quest_controller.dart:988 — QuestController.createManualQuest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, ternaries 2, error handling 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _QuickAddBarState.pickAndRecognizeImage (cognitive 21) · ×1
  • _QuickAddBarState.pickAndRecognizeImage (cognitive 21) frontend/lib/features/quest/widgets/quick_add_bar.dart:133 — _QuickAddBarState.pickAndRecognizeImage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 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.
D2 · Cognitive Complexity · guide_memory.detectWeeklyCycleChains (cognitive 21) · ×1
  • guide_memory.detectWeeklyCycleChains (cognitive 21) supabase/functions/_shared/guide_memory.ts:611 — guide_memory.detectWeeklyCycleChains has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (4 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.
D2 · Cognitive Complexity · index.normalizeLlmPayload (cognitive 21) · ×1
  • index.normalizeLlmPayload (cognitive 21) supabase/functions/parse-quest/index.ts:48 — index.normalizeLlmPayload has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 5 (7 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _GuideComposerState._handleKeyEvent (cognitive 20) · ×1
  • _GuideComposerState._handleKeyEvent (cognitive 20) frontend/lib/features/quest/widgets/guide_panel_dialog.dart:855 — _GuideComposerState._handleKeyEvent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemoryService._parseBreakpointMemory (cognitive 19) · ×1
  • MemoryService._parseBreakpointMemory (cognitive 19) frontend/lib/core/services/memory_service.dart:389 — MemoryService._parseBreakpointMemory has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (6 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestController._upsertDailyLogForToday (cognitive 19) · ×1
  • QuestController._upsertDailyLogForToday (cognitive 19) frontend/lib/features/quest/controllers/quest_controller.dart:245 — QuestController._upsertDailyLogForToday has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 7, error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HomePageState._syncTodayMemories (cognitive 19) · ×1
  • _HomePageState._syncTodayMemories (cognitive 19) frontend/lib/features/quest/screens/home_page.dart:3500 — _HomePageState._syncTodayMemories has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LifeDiaryPageState._load (cognitive 19) · ×1
  • _LifeDiaryPageState._load (cognitive 19) frontend/lib/features/quest/screens/life_diary_page.dart:58 — _LifeDiaryPageState._load has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 4 (9 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.patrolUser (cognitive 19) · ×1
  • index.patrolUser (cognitive 19) REDACTED:196 — index.patrolUser has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 5 (7 pts), boolean chains 3, ternaries 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.
D2 · Cognitive Complexity · GuideController.isGuideConfirmationText (cognitive 18) · ×1
  • GuideController.isGuideConfirmationText (cognitive 18) frontend/lib/features/quest/controllers/guide_controller.dart:1371 — GuideController.isGuideConfirmationText has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 17, if/else 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · QuestController.addOnboardingTutorialBundle (cognitive 18) · ×1
  • QuestController.addOnboardingTutorialBundle (cognitive 18) frontend/lib/features/quest/controllers/quest_controller.dart:1195 — QuestController.addOnboardingTutorialBundle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (6 pts), loops 3 (5 pts), error handling 2 (4 pts), ternaries 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestController.deleteQuest (cognitive 18) · ×1
  • QuestController.deleteQuest (cognitive 18) frontend/lib/features/quest/controllers/quest_controller.dart:1724 — QuestController.deleteQuest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (4 pts), ternaries 2 (3 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (QuestController.restoreQuest) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · QuestController.restoreQuest (cognitive 18) · ×1
  • QuestController.restoreQuest (cognitive 18) frontend/lib/features/quest/controllers/quest_controller.dart:1772 — QuestController.restoreQuest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (4 pts), ternaries 2 (3 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (QuestController.deleteQuest) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · _HomePageState._generateUserProfile (cognitive 18) · ×1
  • _HomePageState._generateUserProfile (cognitive 18) frontend/lib/features/quest/screens/home_page.dart:3556 — _HomePageState._generateUserProfile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · guide_memory.detectTimeSlotChains (cognitive 18) · ×1
  • guide_memory.detectTimeSlotChains (cognitive 18) supabase/functions/_shared/guide_memory.ts:544 — guide_memory.detectTimeSlotChains has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · agent_planner.replanAfterToolCompletion (cognitive 18) · ×1
  • agent_planner.replanAfterToolCompletion (cognitive 18) REDACTED:575 — agent_planner.replanAfterToolCompletion has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 2, error handling 1. Of this number, 15 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · GuideController._handlePendingGuideTaskEdit (cognitive 17) · ×1
  • GuideController._handlePendingGuideTaskEdit (cognitive 17) frontend/lib/features/quest/controllers/guide_controller.dart:2014 — GuideController._handlePendingGuideTaskEdit has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 5 (6 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _LifeDiaryPageState._summonWeeklySummary (cognitive 17) · ×1
  • _LifeDiaryPageState._summonWeeklySummary (cognitive 17) frontend/lib/features/quest/screens/life_diary_page.dart:153 — _LifeDiaryPageState._summonWeeklySummary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _InventoryPageState.build (cognitive 17) · ×1
  • _InventoryPageState.build (cognitive 17) frontend/lib/features/reward/screens/inventory_page.dart:367 — _InventoryPageState.build has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 6, boolean chains 3 (nesting depth added 4). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · _RewardShopPageState._friendlyErrorMessage (cognitive 17) · ×1
  • _RewardShopPageState._friendlyErrorMessage (cognitive 17) frontend/lib/features/reward/screens/reward_shop_page.dart:316 — _RewardShopPageState._friendlyErrorMessage has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4, ternaries 2 (4 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · guide_memory.applyDecayWeights (cognitive 17) · ×1
  • guide_memory.applyDecayWeights (cognitive 17) supabase/functions/_shared/guide_memory.ts:398 — guide_memory.applyDecayWeights has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 1 (nesting depth added 5). Of this number, 9 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.Deno.serve() (cognitive 17) · ×1
  • index.Deno.serve() (cognitive 17) supabase/functions/guide-freeform-chat/index.ts:26 — index.Deno.serve() has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, ternaries 3 (4 pts), boolean chains 3, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · index.generateImageViaOpenAI (cognitive 17) · ×1
  • index.generateImageViaOpenAI (cognitive 17) supabase/functions/guide-portrait-generate/index.ts:96 — index.generateImageViaOpenAI has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (5 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemoryService.recognizeImage (cognitive 16) · ×1
  • MemoryService.recognizeImage (cognitive 16) frontend/lib/core/services/memory_service.dart:143 — MemoryService.recognizeImage has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3 (6 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _VoicePlaybackRowState._initPlayer (cognitive 16) · ×1
  • _VoicePlaybackRowState._initPlayer (cognitive 16) frontend/lib/features/memory/widgets/voice_playback_row.dart:39 — _VoicePlaybackRowState._initPlayer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GuideController.requestDirectFreeformChat (cognitive 16) · ×1
  • GuideController.requestDirectFreeformChat (cognitive 16) frontend/lib/features/quest/controllers/guide_controller.dart:1726 — GuideController.requestDirectFreeformChat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestController._syncMemoryFireAndForget (cognitive 16) · ×1
  • QuestController._syncMemoryFireAndForget (cognitive 16) frontend/lib/features/quest/controllers/quest_controller.dart:325 — QuestController._syncMemoryFireAndForget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 7, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _HomePageState._requestDirectFreeformChat (cognitive 16) · ×1
  • _HomePageState._requestDirectFreeformChat (cognitive 16) frontend/lib/features/quest/screens/home_page.dart:510 — _HomePageState._requestDirectFreeformChat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HomePageState._handleDailyEventDecision (cognitive 16) · ×1
  • _HomePageState._handleDailyEventDecision (cognitive 16) frontend/lib/features/quest/screens/home_page.dart:1079 — _HomePageState._handleDailyEventDecision has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _HomePageState._guideCompanionCardContent (cognitive 16) · ×1
  • _HomePageState._guideCompanionCardContent (cognitive 16) frontend/lib/features/quest/screens/home_page.dart:1555 — _HomePageState._guideCompanionCardContent has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (6 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (57 shared lines) · ×1
  • Near-duplicate member pair (57 shared lines) frontend/lib/features/reward/screens/inventory_page.dart:120 — frontend/lib/features/reward/screens/inventory_page.dart:120-231 | frontend/lib/features/reward/screens/inventory_page.dart:233-337 — These two members are variants of one another: 57 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (54 shared lines) · ×1
  • Near-duplicate member pair (54 shared lines) frontend/lib/features/quest/screens/home_page.dart:1871 — frontend/lib/features/quest/screens/home_page.dart:1871-2169 | frontend/lib/features/quest/screens/home_page.dart:2668-2779 — These two members are variants of one another: 54 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 (98 corresponding lines) · ×1
  • Edited copy of a member (98 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:375 — frontend/lib/features/quest/controllers/guide_controller.dart:375-472 | frontend/lib/features/quest/screens/home_page.dart:2781-2886 — These two members are one piece of code written twice and then edited apart: 98 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) frontend/lib/features/quest/controllers/guide_controller.dart:1926 — frontend/lib/features/quest/controllers/guide_controller.dart:1926-2012 | frontend/lib/features/quest/screens/home_page.dart:1278-1384 — 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 (89 corresponding lines) · ×1
  • Edited copy of a member (89 corresponding lines) frontend/lib/core/widgets/app_drawer.dart:590 — frontend/lib/core/widgets/app_drawer.dart:590-678 | frontend/lib/features/quest/screens/home_page.dart:350-445 — These two members are one piece of code written twice and then edited apart: 89 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (69 corresponding lines) · ×1
  • Edited copy of a member (69 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:1726 — frontend/lib/features/quest/controllers/guide_controller.dart:1726-1794 | frontend/lib/features/quest/screens/home_page.dart:510-580 — These two members are one piece of code written twice and then edited apart: 69 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) frontend/lib/features/quest/widgets/quest_board_fab.dart:177 — frontend/lib/features/quest/widgets/quest_board_fab.dart:177-231 | frontend/lib/features/quest/widgets/quick_add_bar.dart:402-449 — 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 (53 corresponding lines) · ×1
  • Edited copy of a member (53 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:634 — frontend/lib/features/quest/controllers/guide_controller.dart:634-686 | frontend/lib/features/quest/screens/home_page.dart:724-778 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (57 corresponding lines) · ×1
  • Edited copy of a member (57 corresponding lines) frontend/lib/features/quest/widgets/quest_board_fab.dart:83 — frontend/lib/features/quest/widgets/quest_board_fab.dart:83-167 | frontend/lib/features/quest/widgets/quick_add_bar.dart:337-393 — These two members are one piece of code written twice and then edited apart: 57 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (51 corresponding lines) · ×1
  • Edited copy of a member (51 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:963 — frontend/lib/features/quest/controllers/guide_controller.dart:963-1013 | frontend/lib/features/quest/screens/home_page.dart:628-682 — These two members are one piece of code written twice and then edited apart: 51 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) frontend/lib/features/quest/widgets/home_settings_widgets.dart:94 — frontend/lib/features/quest/widgets/home_settings_widgets.dart:94-153 | frontend/lib/features/quest/widgets/home_settings_widgets.dart:244-313 — 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 (36 corresponding lines) · ×1
  • Edited copy of a member (36 corresponding lines) frontend/lib/features/memory/screens/memory_detail_page.dart:259 — frontend/lib/features/memory/screens/memory_detail_page.dart:259-294 | frontend/lib/features/memory/widgets/memory_card.dart:287-331 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 36+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 36+ corresponding lines) frontend/lib/features/quest/controllers/quest_controller.dart:1724 — frontend/lib/features/quest/controllers/quest_controller.dart:1724-1770 | frontend/lib/features/quest/controllers/quest_controller.dart:1772-1817 | frontend/lib/features/quest/controllers/quest_controller.dart:1875-1910 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 36 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 (42 corresponding lines) · ×1
  • Edited copy of a member (42 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:898 — frontend/lib/features/quest/controllers/guide_controller.dart:898-939 | frontend/lib/features/quest/screens/home_page.dart:583-624 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×1
  • Edited copy of a member (43 corresponding lines) frontend/lib/features/binding/screens/binding_view.dart:1240 — frontend/lib/features/binding/screens/binding_view.dart:1240-1295 | frontend/lib/features/binding/screens/binding_view.dart:1349-1391 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×1
  • Edited copy of a member (23 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:241 — frontend/lib/features/quest/controllers/guide_controller.dart:241-265 | frontend/lib/features/quest/screens/home_page.dart:246-268 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 31+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 31+ corresponding lines) frontend/lib/features/auth/widgets/forest_atmosphere.dart:78 — frontend/lib/features/auth/widgets/forest_atmosphere.dart:78-108 | frontend/lib/features/auth/widgets/forest_atmosphere.dart:111-142 | frontend/lib/features/auth/widgets/forest_atmosphere.dart:145-180 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) frontend/lib/features/achievement/screens/achievement_page.dart:200 — frontend/lib/features/achievement/screens/achievement_page.dart:200-231 | frontend/lib/features/stats/screens/stats_page.dart:255-284 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) frontend/lib/core/widgets/app_drawer.dart:837 — frontend/lib/core/widgets/app_drawer.dart:837-868 | frontend/lib/features/binding/screens/binding_view.dart:1309-1333 — 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 (13 corresponding lines) · ×1
  • Edited copy of a member (13 corresponding lines) frontend/lib/features/quest/screens/home_page.dart:271 — frontend/lib/features/quest/screens/home_page.dart:271-287 | frontend/lib/features/quest/screens/home_page.dart:289-301 — 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, 11+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 11+ corresponding lines) frontend/lib/core/services/guide_service.dart:564 — frontend/lib/core/services/guide_service.dart:564-574 | frontend/lib/core/services/guide_service.dart:576-590 | frontend/lib/core/services/guide_service.dart:611-621 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 10+ corresponding lines) frontend/lib/core/services/preferences_service.dart:162 — frontend/lib/core/services/preferences_service.dart:162-171 | frontend/lib/core/services/preferences_service.dart:182-191 | frontend/lib/core/services/preferences_service.dart:202-211 | frontend/lib/core/services/preferences_service.dart:222-231 | frontend/lib/core/services/preferences_service.dart:242-251 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×1
  • Edited copy of a member (6 corresponding lines) frontend/lib/features/quest/models/quest_node.dart:30 — frontend/lib/features/quest/models/quest_node.dart:30-35 | frontend/lib/features/reward/models/reward.dart:60-65 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) frontend/lib/features/quest/controllers/guide_controller.dart:1068 — frontend/lib/features/quest/controllers/guide_controller.dart:1068-1072 | frontend/lib/features/quest/models/agent_step.dart:70-74 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) frontend/lib/core/services/guide_service.dart:521 — frontend/lib/core/services/guide_service.dart:521-525 | frontend/lib/core/services/preferences_service.dart:253-257 | frontend/lib/features/profile/controllers/user_profile_controller.dart:125-131 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (41–46 lines × 2) · ×1
  • Duplicated block (41–46 lines × 2) frontend/lib/features/quest/widgets/quest_board_fab.dart:186 — frontend/lib/features/quest/widgets/quest_board_fab.dart:186-231 | frontend/lib/features/quest/widgets/quick_add_bar.dart:409-449 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `frontend/lib/features/quest/widgets/quest_board_fab.dart:186` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (35–38 lines × 2) · ×1
  • Duplicated block (35–38 lines × 2) frontend/lib/features/quest/controllers/guide_controller.dart:979 — frontend/lib/features/quest/controllers/guide_controller.dart:979-1013 | frontend/lib/features/quest/screens/home_page.dart:645-682 — before extracting anything, compare `frontend/lib/features/quest/controllers/guide_controller.dart` and `frontend/lib/features/quest/screens/home_page.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 283 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:979` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×1
  • Duplicated block (34 lines × 2) frontend/lib/core/widgets/app_drawer.dart:630 — frontend/lib/core/widgets/app_drawer.dart:630-663 | frontend/lib/features/quest/screens/home_page.dart:387-420 — 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 `frontend/lib/core/widgets/app_drawer.dart:630` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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, `frontend/lib/features/quest/screens/home_page.dart:422` calls `of`, `pop`, `trim` and `frontend/lib/core/widgets/app_drawer.dart:664` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (30–34 lines × 2) · ×1
  • Duplicated block (30–34 lines × 2) frontend/lib/features/achievement/widgets/achievement_unlock_overlay.dart:309 — frontend/lib/features/achievement/widgets/achievement_unlock_overlay.dart:309-338 | frontend/lib/shared/widgets/celebration_overlay.dart:129-162 — 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.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×1
  • Duplicated block (28–29 lines × 2) frontend/lib/features/reward/screens/inventory_page.dart:121 — frontend/lib/features/reward/screens/inventory_page.dart:121-148 | frontend/lib/features/reward/screens/inventory_page.dart:234-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/reward/screens/inventory_page.dart:121` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (68–69 lines × 2) · ×1
  • Duplicated block (68–69 lines × 2) frontend/lib/features/quest/controllers/guide_controller.dart:1128 — frontend/lib/features/quest/controllers/guide_controller.dart:1128-1195 | frontend/lib/features/quest/screens/home_page.dart:1704-1772 — before extracting anything, compare `frontend/lib/features/quest/controllers/guide_controller.dart` and `frontend/lib/features/quest/screens/home_page.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 283 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (26–27 lines × 3) · ×1
  • Duplicated block (26–27 lines × 3) frontend/lib/features/quest/screens/home_page.dart:2676 — frontend/lib/features/quest/screens/home_page.dart:2676-2702 | frontend/lib/features/quest/screens/home_page.dart:2711-2736 | frontend/lib/features/quest/screens/home_page.dart:2742-2768 — 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 `frontend/lib/features/quest/screens/home_page.dart:2676` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `frontend/lib/features/quest/screens/home_page.dart:2709` calls `_handleGuideRedeemReward` and `frontend/lib/features/quest/screens/home_page.dart:2740` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (25–27 lines × 2) · ×1
  • Duplicated block (25–27 lines × 2) frontend/lib/features/quest/controllers/guide_controller.dart:1759 — frontend/lib/features/quest/controllers/guide_controller.dart:1759-1783 | frontend/lib/features/quest/screens/home_page.dart:543-569 — before extracting anything, compare `frontend/lib/features/quest/controllers/guide_controller.dart` and `frontend/lib/features/quest/screens/home_page.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 283 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:1759` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) frontend/lib/features/settings/widgets/feishu_bind_panel.dart:161 — frontend/lib/features/settings/widgets/feishu_bind_panel.dart:161-184 | frontend/lib/features/settings/widgets/feishu_bind_panel.dart:222-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/settings/widgets/feishu_bind_panel.dart:161` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) frontend/lib/features/memory/screens/memory_detail_page.dart:90 — frontend/lib/features/memory/screens/memory_detail_page.dart:90-111 | frontend/lib/features/memory/widgets/memory_card.dart:158-178 — before extracting anything, compare `frontend/lib/features/memory/screens/memory_detail_page.dart` and `frontend/lib/features/memory/widgets/memory_card.dart` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 95 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/memory/screens/memory_detail_page.dart:90` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (18 lines × 8) · ×1
  • Duplicated block (18 lines × 8) frontend/lib/features/quest/screens/home_page.dart:1879 — frontend/lib/features/quest/screens/home_page.dart:1879-1896 | frontend/lib/features/quest/screens/home_page.dart:1916-1933 | frontend/lib/features/quest/screens/home_page.dart:2015-2032 | frontend/lib/features/quest/screens/home_page.dart:2107-2124 | frontend/lib/features/quest/screens/home_page.dart:2391-2408 | frontend/lib/features/quest/screens/home_page.dart:2676-2693 | frontend/lib/features/quest/screens/home_page.dart:2711-2728 | frontend/lib/features/quest/screens/home_page.dart:2742-2759 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/screens/home_page.dart:1879` it does not close everything it opens, so those 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, `frontend/lib/features/quest/screens/home_page.dart:2709` calls `_handleGuideRedeemReward` and `frontend/lib/features/quest/screens/home_page.dart:2740` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) frontend/lib/features/auth/widgets/forest_atmosphere.dart:161 — frontend/lib/features/auth/widgets/forest_atmosphere.dart:161-178 | frontend/lib/features/auth/widgets/forest_atmosphere.dart:292-309 | frontend/lib/features/auth/widgets/forest_atmosphere.dart:319-336 | frontend/lib/features/auth/widgets/forest_atmosphere.dart:346-363 — 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 `frontend/lib/features/auth/widgets/forest_atmosphere.dart:161` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those 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, `frontend/lib/features/auth/widgets/forest_atmosphere.dart:159` calls `Opacity`, `clamp` and `frontend/lib/features/auth/widgets/forest_atmosphere.dart:291` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) frontend/lib/features/binding/screens/binding_view.dart:608 — frontend/lib/features/binding/screens/binding_view.dart:608-622 | frontend/lib/features/binding/screens/binding_view.dart:1129-1146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/binding/screens/binding_view.dart:608` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) frontend/lib/features/memory/screens/memory_detail_page.dart:39 — frontend/lib/features/memory/screens/memory_detail_page.dart:39-55 | frontend/lib/features/memory/screens/memory_page.dart:55-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/memory/screens/memory_detail_page.dart:39` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) frontend/lib/features/reward/screens/inventory_page.dart:185 — frontend/lib/features/reward/screens/inventory_page.dart:185-200 | frontend/lib/features/reward/screens/inventory_page.dart:305-321 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/reward/screens/inventory_page.dart:185` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×1
  • Duplicated block (15 lines × 3) frontend/lib/features/stats/widgets/streak_calendar.dart:36 — frontend/lib/features/stats/widgets/streak_calendar.dart:36-50 | frontend/lib/features/stats/widgets/tier_pie_chart.dart:45-59 | frontend/lib/features/stats/widgets/xp_curve_chart.dart:41-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/stats/widgets/streak_calendar.dart:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `frontend/lib/features/stats/widgets/streak_calendar.dart:52` calls `Row` and `frontend/lib/features/stats/widgets/tier_pie_chart.dart:60` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) frontend/lib/features/quest/controllers/guide_controller.dart:964 — frontend/lib/features/quest/controllers/guide_controller.dart:964-977 | frontend/lib/features/quest/screens/home_page.dart:629-643 — before extracting anything, compare `frontend/lib/features/quest/controllers/guide_controller.dart` and `frontend/lib/features/quest/screens/home_page.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 283 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:964` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×1
  • Duplicated block (15 lines × 2) frontend/lib/features/quest/controllers/guide_controller.dart:1524 — frontend/lib/features/quest/controllers/guide_controller.dart:1524-1538 | frontend/lib/features/quest/screens/home_page.dart:1214-1228 — before extracting anything, compare `frontend/lib/features/quest/controllers/guide_controller.dart` and `frontend/lib/features/quest/screens/home_page.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 283 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:1524` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) frontend/lib/features/quest/controllers/quest_controller.dart:1757 — frontend/lib/features/quest/controllers/quest_controller.dart:1757-1770 | frontend/lib/features/quest/controllers/quest_controller.dart:1804-1817 | frontend/lib/features/quest/controllers/quest_controller.dart:1897-1910 — 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 `frontend/lib/features/quest/controllers/quest_controller.dart:1757` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–13 lines × 5) · ×1
  • Duplicated block (12–13 lines × 5) frontend/lib/features/quest/screens/home_page.dart:1996 — frontend/lib/features/quest/screens/home_page.dart:1996-2008 | frontend/lib/features/quest/screens/home_page.dart:2087-2098 | frontend/lib/features/quest/screens/home_page.dart:2153-2164 | frontend/lib/features/quest/screens/home_page.dart:2271-2283 | frontend/lib/features/quest/screens/home_page.dart:2444-2455 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/screens/home_page.dart:1996` it begins part-way through the construct above it, so those 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, `frontend/lib/features/quest/screens/home_page.dart:2010` calls `findGuideTaskById`, `findGuideTargetTask` and `frontend/lib/features/quest/screens/home_page.dart:2166` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • Duplicated block (10–13 lines × 2) frontend/lib/features/quest/controllers/quest_controller.dart:1539 — frontend/lib/features/quest/controllers/quest_controller.dart:1539-1548 | frontend/lib/features/quest/controllers/quest_controller.dart:1822-1834 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11–13 lines × 2) · ×1
  • Duplicated block (11–13 lines × 2) frontend/lib/features/quest/widgets/quest_board_fab.dart:83 — frontend/lib/features/quest/widgets/quest_board_fab.dart:83-95 | frontend/lib/features/quest/widgets/quick_add_bar.dart:337-347 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 `frontend/lib/features/quest/widgets/quest_board_fab.dart:83` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–12 lines × 2) · ×1
  • Duplicated block (7–12 lines × 2) frontend/lib/features/achievement/widgets/achievement_unlock_overlay.dart:85 — frontend/lib/features/achievement/widgets/achievement_unlock_overlay.dart:85-91 | frontend/lib/shared/widgets/celebration_overlay.dart:52-63 — 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 `frontend/lib/features/achievement/widgets/achievement_unlock_overlay.dart:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) frontend/lib/features/reward/screens/inventory_page.dart:367 — frontend/lib/features/reward/screens/inventory_page.dart:367-378 | frontend/lib/features/reward/screens/reward_shop_page.dart:814-824 — before extracting anything, compare `frontend/lib/features/reward/screens/inventory_page.dart` and `frontend/lib/features/reward/screens/reward_shop_page.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/reward/screens/inventory_page.dart:367` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) frontend/lib/features/quest/controllers/quest_controller.dart:1538 — frontend/lib/features/quest/controllers/quest_controller.dart:1538-1548 | frontend/lib/features/quest/controllers/quest_controller.dart:1726-1736 | frontend/lib/features/quest/controllers/quest_controller.dart:1774-1784 | frontend/lib/features/quest/controllers/quest_controller.dart:1821-1831 — 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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) frontend/lib/features/quest/widgets/agent_approval_card.dart:23 — frontend/lib/features/quest/widgets/agent_approval_card.dart:23-33 | frontend/lib/features/quest/widgets/guide_panel_dialog.dart:112-122 | frontend/lib/features/quest/widgets/guide_panel_dialog.dart:482-492 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/widgets/agent_approval_card.dart:23` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) frontend/lib/features/auth/widgets/forest_particles.dart:73 — frontend/lib/features/auth/widgets/forest_particles.dart:73-82 | frontend/lib/features/auth/widgets/forest_particles.dart:110-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/auth/widgets/forest_particles.dart:73` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) frontend/lib/core/services/evermemos_service.dart:247 — frontend/lib/core/services/evermemos_service.dart:247-253 | frontend/lib/core/services/evermemos_service.dart:296-302 | frontend/lib/core/services/evermemos_service.dart:413-421 — 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 `frontend/lib/core/services/evermemos_service.dart:247` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×1
  • Duplicated block (6 lines × 2) frontend/lib/features/quest/controllers/guide_controller.dart:615 — frontend/lib/features/quest/controllers/guide_controller.dart:615-620 | frontend/lib/features/quest/screens/home_page.dart:705-710 — before extracting anything, compare `frontend/lib/features/quest/controllers/guide_controller.dart` and `frontend/lib/features/quest/screens/home_page.dart` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 283 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:615` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×1
  • Duplicated block (5 lines × 2) frontend/lib/core/services/guide_service.dart:110 — frontend/lib/core/services/guide_service.dart:110-114 | frontend/lib/core/services/guide_service.dart:430-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `frontend/lib/core/services/guide_service.dart:115` calls `trim` and `frontend/lib/core/services/guide_service.dart:435` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) frontend/lib/features/quest/controllers/guide_controller.dart:1117 — frontend/lib/features/quest/controllers/guide_controller.dart:1117-1121 | frontend/lib/features/quest/controllers/quest_controller.dart:166-170 | frontend/lib/features/quest/screens/life_diary_page.dart:38-42 | frontend/lib/features/quest/widgets/quest_edit_sheet.dart:54-58 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `frontend/lib/features/quest/controllers/guide_controller.dart:1117` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: deno.json — deno.json: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — backend/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
P2 · Observability · No structured logging · ×1
  • No structured logging — No logging call was found in the 185 Python, JavaScript/TypeScript, Dart, JVM production file(s) this check read across 6 module(s). Each was searched for its ecosystem's logging libraries (JVM: SLF4J, Log4j2, java.util.logging, Logback, kotlin-logging, scala-logging; Python: logging, structlog, loguru; JavaScript/TypeScript: pino, winston, bunyan, log4js, loglevel, consola, the NestJS Logger; Dart: package:logging, package:logger, dart:developer's log()) and for a call on a receiver named `log`/`logger` (or ending in `Logger`/`_logger`) with a level verb. It cannot see logging through a repo-local wrapper named otherwise, or in source it did not read — this is 'no logging found by this walk', not a verdict that nothing here logs. If it is right, production issues will be hard to diagnose.
R10 · Code Duplication · Duplication concentrated across 30 sibling directories (52 clone groups) · ×1
  • Duplication concentrated across 30 sibling directories (52 clone groups) REDACTED:14 — 52 duplicated blocks under supabase/functions/ have copies in at least two of the sibling directories _shared, agent-run-status, agent-step-approve, agent-step-complete, agent-turn, evermemos-proxy (+24 more sibling(s) not listed) — 46 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 52 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 52 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 52 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (83 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (83 matched lines × 2 locations) REDACTED:14 — REDACTED:14 · REDACTED:11 — the two spans are one implementation copied and then locally edited — 446 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (75 lines × 2 locations) · ×1
  • Duplicated block (75 lines × 2 locations) supabase/functions/generate-breakpoint-boost/index.ts:59 — supabase/functions/generate-breakpoint-boost/index.ts:59 · supabase/functions/pregenerate-breakpoint/index.ts:58 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (63 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (63 matched lines × 2 locations) supabase/functions/agent-step-complete/index.ts:31 — supabase/functions/agent-step-complete/index.ts:31 · supabase/functions/agent-turn/index.ts:31 — the two spans are one implementation copied and then locally edited — 449 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (46 lines × 2 locations) · ×1
  • Duplicated block (46 lines × 2 locations) REDACTED:20 — REDACTED:20 · REDACTED:20 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (39 lines × 2 locations) · ×1
  • Duplicated block (39 lines × 2 locations) supabase/functions/_shared/guide_engine.ts:126 — supabase/functions/_shared/guide_engine.ts:126 · REDACTED:34 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (37 lines × 2 locations) · ×1
  • Duplicated block (37 lines × 2 locations) supabase/functions/agent-step-complete/index.ts:116 — supabase/functions/agent-step-complete/index.ts:116 · supabase/functions/agent-turn/index.ts:110 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (32 lines × 2 locations) · ×1
  • Duplicated block (32 lines × 2 locations) supabase/functions/guide-bootstrap/index.ts:7 — supabase/functions/guide-bootstrap/index.ts:7 · supabase/functions/guide-event-generate/index.ts:7 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (32 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (32 matched lines × 2 locations) supabase/functions/guide-portrait-generate/index.ts:377 — supabase/functions/guide-portrait-generate/index.ts:377 · supabase/functions/knowledge-extraction/index.ts:28 — the two spans are one implementation copied and then locally edited — 251 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (26 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (26 matched lines × 2 locations) supabase/functions/guide-event-accept/index.ts:8 — supabase/functions/guide-event-accept/index.ts:8 · supabase/functions/guide-night-reflection/index.ts:16 — the two spans are one implementation copied and then locally edited — 197 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (25 lines × 2 locations) · ×1
  • Duplicated block (25 lines × 2 locations) supabase/functions/feishu-webhook/index.ts:4 — supabase/functions/feishu-webhook/index.ts:4 · REDACTED:5 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (22 lines × 2 locations) · ×1
  • Duplicated block (22 lines × 2 locations) REDACTED:120 — REDACTED:120 · supabase/functions/sync-user-memory/index.ts:29 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (21 lines × 2 locations) · ×1
  • Duplicated block (21 lines × 2 locations) promo-video/src/EarthOnlineCompetition.tsx:347 — promo-video/src/EarthOnlineCompetition.tsx:347 · promo-video/src/EverMemOSDemo.tsx:134 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (19 lines × 3 locations) · ×1
  • Duplicated block (19 lines × 3 locations) supabase/functions/agent-step-approve/index.ts:49 — supabase/functions/agent-step-approve/index.ts:49 · supabase/functions/agent-step-complete/index.ts:82 · supabase/functions/agent-turn/index.ts:77 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (18 lines × 2 locations) · ×1
  • Duplicated block (18 lines × 2 locations) supabase/functions/_shared/collective_memory.ts:28 — supabase/functions/_shared/collective_memory.ts:28 · supabase/functions/_shared/guide_memory.ts:77 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×1
  • Duplicated block (17 lines × 2 locations) supabase/functions/_shared/breakpoint_helpers.ts:324 — supabase/functions/_shared/breakpoint_helpers.ts:324 · supabase/functions/_shared/guide_ai.ts:87 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (17 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (17 matched lines × 2 locations) supabase/functions/feishu-webhook/index.ts:143 — supabase/functions/feishu-webhook/index.ts:143 · REDACTED:376 — the two spans are one implementation copied and then locally edited — 62 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (14 lines × 4 locations) · ×1
  • Duplicated block (14 lines × 4 locations) supabase/functions/_shared/agent_planner_test.ts:32 — supabase/functions/_shared/agent_planner_test.ts:32 · supabase/functions/_shared/agent_planner_test.ts:47 · supabase/functions/_shared/agent_planner_test.ts:62 · supabase/functions/_shared/agent_planner_test.ts:88 — 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.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×1
  • Duplicated block (14 lines × 2 locations) supabase/functions/_shared/agent_tool_execution_test.ts:316 — supabase/functions/_shared/agent_tool_execution_test.ts:316 · supabase/functions/_shared/agent_tool_execution_test.ts:331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (12 lines × 4 locations) · ×1
  • Duplicated block (12 lines × 4 locations) supabase/functions/agent-run-status/index.ts:69 — supabase/functions/agent-run-status/index.ts:69 · supabase/functions/agent-step-approve/index.ts:133 · supabase/functions/agent-step-complete/index.ts:311 · supabase/functions/agent-turn/index.ts:228 — the 4 copies are spread across 4 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (12 lines × 3 locations) · ×1
  • Duplicated block (12 lines × 3 locations) supabase/functions/agent-run-status/index_test.ts:28 — supabase/functions/agent-run-status/index_test.ts:28 · supabase/functions/agent-run-status/index_test.ts:48 · supabase/functions/agent-turn/index_test.ts:32 — the 3 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (12 lines × 5 locations) · ×1
  • Duplicated block (12 lines × 5 locations) supabase/functions/agent-step-approve/index_test.ts:10 — supabase/functions/agent-step-approve/index_test.ts:10 · supabase/functions/agent-step-approve/index_test.ts:33 · supabase/functions/agent-step-complete/index_test.ts:12 · supabase/functions/agent-step-complete/index_test.ts:39 · +1 more site(s) not listed — the 5 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R2 · Cyclomatic Complexity · Complex function gatherGuideMemoryBundle (cyclomatic 42, cognitive 59) · ×1
  • Complex function gatherGuideMemoryBundle (cyclomatic 42, cognitive 59) supabase/functions/_shared/guide_memory.ts:902 — gatherGuideMemoryBundle has cyclomatic complexity 42 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function planAgentGoal (cyclomatic 30, cognitive 42) · ×1
  • Complex function planAgentGoal (cyclomatic 30, cognitive 42) REDACTED:195 — planAgentGoal has cyclomatic complexity 30 and cognitive complexity 42; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 28, cognitive 41) · ×1
  • Complex function (anonymous) (cyclomatic 28, cognitive 41) supabase/functions/weekly-report-push/index.ts:115 — (anonymous) has cyclomatic complexity 28 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function inferAgentRiskLevel (cyclomatic 28, cognitive 28) · ×1
  • Complex function inferAgentRiskLevel (cyclomatic 28, cognitive 28) supabase/functions/_shared/agent_policy.ts:32 — inferAgentRiskLevel has cyclomatic complexity 28 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 26, cognitive 30) · ×1
  • Complex function (anonymous) (cyclomatic 26, cognitive 30) supabase/functions/agent-step-complete/index.ts:157 — (anonymous) has cyclomatic complexity 26 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 25, cognitive 32) · ×1
  • Complex function (anonymous) (cyclomatic 25, cognitive 32) REDACTED:142 — (anonymous) has cyclomatic complexity 25 and cognitive complexity 32; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 23, cognitive 28) · ×1
  • Complex function (anonymous) (cyclomatic 23, cognitive 28) supabase/functions/guide-portrait-generate/index.ts:379 — (anonymous) has cyclomatic complexity 23 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function generateImageViaOpenAI (cyclomatic 22, cognitive 29) · ×1
  • Complex function generateImageViaOpenAI (cyclomatic 22, cognitive 29) supabase/functions/guide-portrait-generate/index.ts:96 — generateImageViaOpenAI has cyclomatic complexity 22 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 20, cognitive 20) · ×1
  • Complex function (anonymous) (cyclomatic 20, cognitive 20) supabase/functions/guide-freeform-chat/index.ts:26 — (anonymous) has cyclomatic complexity 20 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function tryDetectMemoryAchievements (cyclomatic 19, cognitive 41) · ×1
  • Complex function tryDetectMemoryAchievements (cyclomatic 19, cognitive 41) supabase/functions/sync-user-memory/index.ts:252 — tryDetectMemoryAchievements has cyclomatic complexity 19 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 18, cognitive 23) · ×1
  • Complex function (anonymous) (cyclomatic 18, cognitive 23) supabase/functions/sync-user-memory/index.ts:343 — (anonymous) has cyclomatic complexity 18 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function replanAfterToolCompletion (cyclomatic 17, cognitive 16) · ×1
  • Complex function replanAfterToolCompletion (cyclomatic 17, cognitive 16) REDACTED:575 — replanAfterToolCompletion has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 17, cognitive 16) · ×1
  • Complex function (anonymous) (cyclomatic 17, cognitive 16) supabase/functions/parse-document/index.ts:137 — (anonymous) has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function isChainBreaking (cyclomatic 16, cognitive 25) · ×1
  • Complex function isChainBreaking (cyclomatic 16, cognitive 25) supabase/functions/_shared/guide_memory.ts:786 — isChainBreaking has cyclomatic complexity 16 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function patrolUser (cyclomatic 16, cognitive 19) · ×1
  • Complex function patrolUser (cyclomatic 16, cognitive 19) REDACTED:196 — patrolUser has cyclomatic complexity 16 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 16, cognitive 18) · ×1
  • Complex function (anonymous) (cyclomatic 16, cognitive 18) REDACTED:338 — (anonymous) has cyclomatic complexity 16 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function searchMemories (cyclomatic 16, cognitive 15) · ×1
  • Complex function searchMemories (cyclomatic 16, cognitive 15) REDACTED:383 — searchMemories has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 16, cognitive 15) · ×1
  • Complex function (anonymous) (cyclomatic 16, cognitive 15) REDACTED:181 — (anonymous) has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function normalizeLlmPayload (cyclomatic 15, cognitive 21) · ×1
  • Complex function normalizeLlmPayload (cyclomatic 15, cognitive 21) supabase/functions/parse-quest/index.ts:48 — normalizeLlmPayload has cyclomatic complexity 15 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function acceptOrDismissDailyEvent (cyclomatic 15, cognitive 15) · ×1
  • Complex function acceptOrDismissDailyEvent (cyclomatic 15, cognitive 15) supabase/functions/_shared/guide_engine.ts:175 — acceptOrDismissDailyEvent has cyclomatic complexity 15 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function generateBoostContent (cyclomatic 15, cognitive 12) · ×1
  • Complex function generateBoostContent (cyclomatic 15, cognitive 12) supabase/functions/_shared/breakpoint_helpers.ts:238 — generateBoostContent has cyclomatic complexity 15 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function getActiveHabits (cyclomatic 14, cognitive 16) · ×1
  • Complex function getActiveHabits (cyclomatic 14, cognitive 16) supabase/functions/_shared/breakpoint_helpers.ts:101 — getActiveHabits has cyclomatic complexity 14 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function buildBehaviorSignals (cyclomatic 14, cognitive 15) · ×1
  • Complex function buildBehaviorSignals (cyclomatic 14, cognitive 15) supabase/functions/_shared/guide_memory.ts:210 — buildBehaviorSignals has cyclomatic complexity 14 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 14, cognitive 14) · ×1
  • Complex function (anonymous) (cyclomatic 14, cognitive 14) supabase/functions/guide-event-accept/index.ts:7 — (anonymous) has cyclomatic complexity 14 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function appendAgentStep (cyclomatic 14, cognitive 11) · ×1
  • Complex function appendAgentStep (cyclomatic 14, cognitive 11) supabase/functions/_shared/agent_engine.ts:145 — appendAgentStep has cyclomatic complexity 14 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function detectPatrolSignals (cyclomatic 13, cognitive 19) · ×1
  • Complex function detectPatrolSignals (cyclomatic 13, cognitive 19) REDACTED:95 — detectPatrolSignals has cyclomatic complexity 13 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 13, cognitive 14) · ×1
  • Complex function (anonymous) (cyclomatic 13, cognitive 14) supabase/functions/agent-step-approve/index.ts:83 — (anonymous) has cyclomatic complexity 13 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 13, cognitive 13) · ×1
  • Complex function (anonymous) (cyclomatic 13, cognitive 13) supabase/functions/agent-turn/index.ts:151 — (anonymous) has cyclomatic complexity 13 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function detectTimeSlotChains (cyclomatic 12, cognitive 19) · ×1
  • Complex function detectTimeSlotChains (cyclomatic 12, cognitive 19) supabase/functions/_shared/guide_memory.ts:544 — detectTimeSlotChains has cyclomatic complexity 12 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseRecommendations (cyclomatic 12, cognitive 15) · ×1
  • Complex function parseRecommendations (cyclomatic 12, cognitive 15) supabase/functions/memory-recommender/helpers.ts:67 — parseRecommendations has cyclomatic complexity 12 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 12, cognitive 14) · ×1
  • Complex function (anonymous) (cyclomatic 12, cognitive 14) supabase/functions/feishu-webhook/index.ts:101 — (anonymous) has cyclomatic complexity 12 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function inferRunStatusFromSteps (cyclomatic 12, cognitive 12) · ×1
  • Complex function inferRunStatusFromSteps (cyclomatic 12, cognitive 12) supabase/functions/_shared/agent_engine.ts:418 — inferRunStatusFromSteps has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function normalizeSuggestedTask (cyclomatic 12, cognitive 10) · ×1
  • Complex function normalizeSuggestedTask (cyclomatic 12, cognitive 10) supabase/functions/_shared/guide_engine.ts:639 — normalizeSuggestedTask has cyclomatic complexity 12 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function detectWeeklyCycleChains (cyclomatic 11, cognitive 21) · ×1
  • Complex function detectWeeklyCycleChains (cyclomatic 11, cognitive 21) supabase/functions/_shared/guide_memory.ts:611 — detectWeeklyCycleChains has cyclomatic complexity 11 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · promo-video/src/EarthOnlinePromo.tsx · ×1
  • promo-video/src/EarthOnlinePromo.tsx: 1465 lines of code promo-video/src/EarthOnlinePromo.tsx:1 — promo-video/src/EarthOnlinePromo.tsx has 1465 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · supabase/functions/_shared/guide_memory.ts · ×1
  • supabase/functions/_shared/guide_memory.ts: 1249 lines of code supabase/functions/_shared/guide_memory.ts:1 — supabase/functions/_shared/guide_memory.ts has 1249 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · promo-video/src/EarthOnlineCompetition.tsx · ×1
  • promo-video/src/EarthOnlineCompetition.tsx: 860 lines of code promo-video/src/EarthOnlineCompetition.tsx:1 — promo-video/src/EarthOnlineCompetition.tsx has 860 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · promo-video/src/EverMemOSDemo.tsx · ×1
  • promo-video/src/EverMemOSDemo.tsx: 777 lines of code promo-video/src/EverMemOSDemo.tsx:1 — promo-video/src/EverMemOSDemo.tsx has 777 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 701 lines of code REDACTED:1 — REDACTED has 701 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · supabase/functions/_shared/guide_ai.ts · ×1
  • supabase/functions/_shared/guide_ai.ts: 683 lines of code supabase/functions/_shared/guide_ai.ts:1 — supabase/functions/_shared/guide_ai.ts has 683 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · supabase/functions/_shared/guide_engine.ts · ×1
  • supabase/functions/_shared/guide_engine.ts: 616 lines of code supabase/functions/_shared/guide_engine.ts:1 — supabase/functions/_shared/guide_engine.ts has 616 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 573 lines of code REDACTED:1 — REDACTED has 573 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 541 lines of code REDACTED:1 — REDACTED has 541 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · supabase/functions/guide-portrait-generate/index.ts · ×1
  • supabase/functions/guide-portrait-generate/index.ts: 430 lines of code supabase/functions/guide-portrait-generate/index.ts:1 — supabase/functions/guide-portrait-generate/index.ts has 430 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · supabase/functions/sync-user-memory/index.ts · ×1
  • supabase/functions/sync-user-memory/index.ts: 422 lines of code supabase/functions/sync-user-memory/index.ts:1 — supabase/functions/sync-user-memory/index.ts has 422 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · supabase/functions/_shared/agent_engine.ts · ×1
  • supabase/functions/_shared/agent_engine.ts: 412 lines of code supabase/functions/_shared/agent_engine.ts:1 — supabase/functions/_shared/agent_engine.ts has 412 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 401 lines of code REDACTED:1 — REDACTED has 401 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R4 · Test Coverage · No test rig can mount a component in this workspace · ×1
  • No test rig can mount a component in this workspace backend/vitest.config.ts:1 — backend/vitest.config.ts declares environment "node", and no package here declares a DOM implementation (jsdom / happy-dom), a component testing library or a browser runner — so none of the 4 unreached component module(s) can be tested as written, however the suite is authored: promo-video/src/EarthOnlinePromo.tsx, promo-video/src/EarthOnlineCompetition.tsx, promo-video/src/EverMemOSDemo.tsx, promo-video/src/Root.tsx. Add a DOM environment and a component testing library (for example jsdom + @testing-library, or the runner's browser mode), then test the components. Reported once because these files share one cause, not one omission each.
R6 · Tooling · No lint script · ×1
  • No lint script — test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
R7 · Dead Code · Dead file (~391 LoC) · ×1
  • Dead file (~391 LoC) supabase/functions/_shared/breakpoint_helpers.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (supabase/functions/generate-breakpoint-boost/index.ts, supabase/functions/pregenerate-breakpoint/index.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~344 LoC) · ×1
  • Dead file (~344 LoC) supabase/functions/_shared/agent_tool_execution_test.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~274 LoC) · ×1
  • Dead file (~274 LoC) supabase/functions/_shared/guide_engine_test.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~180 LoC) · ×1
  • Dead file (~180 LoC) supabase/functions/_shared/breakpoint_memory.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), but 5 in-repo import(s) from 5 other file(s) do name it (supabase/functions/_shared/breakpoint_helpers.ts, supabase/functions/_shared/breakpoint_memory_test.ts, REDACTED and 2 more) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~164 LoC) · ×1
  • Dead file (~164 LoC) REDACTED — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~160 LoC) · ×1
  • Dead file (~160 LoC) supabase/functions/_shared/breakpoint_memory_test.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~144 LoC) · ×1
  • Dead file (~144 LoC) supabase/functions/_shared/guide_memory_test.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~133 LoC) · ×1
  • Dead file (~133 LoC) supabase/functions/generate-breakpoint-boost/index.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~132 LoC) · ×1
  • Dead file (~132 LoC) supabase/functions/pregenerate-breakpoint/index.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~126 LoC) · ×1
  • Dead file (~126 LoC) supabase/functions/_shared/agent_engine_test.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~71 LoC) · ×1
  • Dead file (~71 LoC) supabase/functions/_shared/guide_ai_language_test.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~48 LoC) · ×1
  • Dead file (~48 LoC) supabase/functions/_shared/weekly_summary_jobs_test.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~38 LoC) · ×1
  • Dead file (~38 LoC) supabase/functions/parse-quest/index_test.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~23 LoC) · ×1
  • Dead file (~23 LoC) supabase/functions/guide-portrait-generate/helpers_test.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~2 LoC) · ×1
  • Dead file (~2 LoC) supabase/functions/_shared/cors.ts — no import path from any entry point (39 application, 1 tooling, 38 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R8 · Dependency Hygiene · Unused dependency 'pptxgenjs' · ×1
  • Unused dependency 'pptxgenjs' package.json:8 — Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×1
  • Recursive walk over a caller-supplied document has no depth cap supabase/functions/_shared/agent_types.ts:107 — `toAgentJson` is exported and takes `value: unknown` from its caller, and it calls itself at line 107 (`toAgentJson`) with a piece of `value` (and at line 112) — and nowhere in `toAgentJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `toAgentJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
X18 · Disposal-pattern correctness · Owned disposable field is never released · ×1
  • Owned disposable field is never released frontend/lib/features/quest/widgets/quest_item.dart:44 — `_QuestItemState` carries a disposal duty — a `State`, so the framework calls its `dispose()` when it leaves the tree — and it creates `_controller` itself (line 44, `AnimationController`), which makes that instance its own. Nothing in the class releases it — no `_controller.dispose()`, no tear-off of it, on any path — nothing elsewhere in the library releases it through another instance, and it is never handed on as a value (passed positionally, returned, stored, collected), so no other owner can be ending it. Passing it as a named argument does not: a widget or animation never disposes a controller it was given. On what was read, `AnimationController` outlives the object that made it — its listeners, and through them this object and everything it references, stay reachable, and a ticker, timer or subscription keeps calling into a disposed object. Release it where the duty is discharged: `_controller.dispose();` in `dispose()` before `super.dispose()`.
Minor — 46 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×23
  • Duplicated predicate frontend/lib/features/quest/controllers/guide_controller.dart:640 — `!step.isToolCall || !step.isReady || step.needsConfirmation` appears character-identically in 2 files — frontend/lib/features/quest/controllers/guide_controller.dart, frontend/lib/features/quest/screens/home_page.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 frontend/lib/core/services/agent_service.dart:238 — `accessToken == null || accessToken.isEmpty` appears character-identically in 2 files — frontend/lib/core/services/agent_service.dart, frontend/lib/core/services/quest_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 frontend/lib/features/achievement/widgets/achievement_card.dart:98 — `achievement.xpBonus > 0 || achievement.goldBonus > 0` appears character-identically in 2 files — frontend/lib/features/achievement/widgets/achievement_card.dart, frontend/lib/features/achievement/widgets/achievement_unlock_overlay.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 frontend/lib/features/quest/controllers/guide_controller.dart:1186 — `cleaned == '恢复' || cleaned == '恢复一下' || lowerCleaned == 'recovery' || lowerCleaned == 'recovery task'` appears character-identically in 2 files — frontend/lib/features/quest/controllers/guide_controller.dart, frontend/lib/features/quest/screens/home_page.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 frontend/lib/features/memory/models/memory_item.dart:42 — `createdRaw is String && createdRaw.isNotEmpty` appears character-identically in 2 files — frontend/lib/features/memory/models/memory_item.dart, frontend/lib/features/memory/models/portrait_timeline_item.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 frontend/lib/features/quest/widgets/quest_board_fab.dart:235 — `glassTint != oldDelegate.glassTint || isDark != oldDelegate.isDark` appears character-identically in 2 files — frontend/lib/features/quest/widgets/quest_board_fab.dart, frontend/lib/features/quest/widgets/quick_add_bar.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 frontend/lib/features/memory/screens/memory_detail_page.dart:100 — `item.eventType == 'image_recognition' && item.imageUrl != null && item.imageUrl!.isNotEmpty` appears character-identically in 2 files — frontend/lib/features/memory/screens/memory_detail_page.dart, frontend/lib/features/memory/widgets/memory_card.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 frontend/lib/features/quest/controllers/guide_controller.dart:590 — `pendingStepId == null || pendingStepId.isEmpty` appears character-identically in 2 files — frontend/lib/features/quest/controllers/guide_controller.dart, frontend/lib/features/quest/screens/home_page.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 frontend/lib/features/quest/controllers/guide_controller.dart:1129 — `raw.contains('恢复任务') || lowerRaw.contains('recovery task')` appears character-identically in 2 files — frontend/lib/features/quest/controllers/guide_controller.dart, frontend/lib/features/quest/screens/home_page.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 frontend/lib/features/quest/controllers/guide_controller.dart:1743 — `response.statusCode >= 200 && response.statusCode < 300` appears character-identically in 2 files — frontend/lib/features/quest/controllers/guide_controller.dart, frontend/lib/features/quest/screens/home_page.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 frontend/lib/features/quest/controllers/guide_controller.dart:301 — `result.dailyEvent != null && result.dailyEvent!.isPending` appears character-identically in 2 files — frontend/lib/features/quest/controllers/guide_controller.dart, frontend/lib/features/quest/screens/home_page.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 frontend/lib/features/quest/controllers/guide_controller.dart:453 — `result.reply.trim().isNotEmpty || result.messageCard != null || result.resultCard != null || result.quickActions.isNotEmpty` appears character-identically in 2 files — frontend/lib/features/quest/controllers/guide_controller.dart, frontend/lib/features/quest/screens/home_page.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 frontend/lib/features/quest/controllers/guide_controller.dart:1555 — `rewardTitlesZh.isNotEmpty && rewardTitlesEn.isNotEmpty` appears character-identically in 2 files — frontend/lib/features/quest/controllers/guide_controller.dart, frontend/lib/features/quest/screens/home_page.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 frontend/lib/features/memory/controllers/memory_controller.dart:94 — `status == 'notListening' || status == 'done'` appears character-identically in 2 files — frontend/lib/features/memory/controllers/memory_controller.dart, frontend/lib/features/quest/widgets/quick_add_bar.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 frontend/lib/features/quest/controllers/guide_controller.dart:1524 — `title.isNotEmpty && (query.contains(title) || title.contains(query))` appears character-identically in 2 files — frontend/lib/features/quest/controllers/guide_controller.dart, frontend/lib/features/quest/screens/home_page.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 supabase/functions/agent-run-status/index.ts:24 — `!supabaseUrl || !supabaseAnonKey || !serviceRole` appears character-identically in 5 files — supabase/functions/agent-run-status/index.ts, supabase/functions/agent-step-approve/index.ts, supabase/functions/agent-step-complete/index.ts, supabase/functions/agent-turn/index.ts. 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 supabase/functions/generate-breakpoint-boost/index.ts:74 — `!user_id || duration_hours == null || !breakpoint_type || !last_active_at` appears character-identically in 2 files — supabase/functions/generate-breakpoint-boost/index.ts, supabase/functions/pregenerate-breakpoint/index.ts. 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:544 — `Deno.env.get("OPENAI_API_KEY") || Deno.env.get("DEEPSEEK_API_KEY") || ""` appears character-identically in 3 files — REDACTED, supabase/functions/_shared/breakpoint_helpers.ts, supabase/functions/guide-freeform-chat/index.ts. 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:551 — `Deno.env.get("OPENAI_BASE_URL") || Deno.env.get("DEEPSEEK_BASE_URL") || "https://api.86gamestore.com"` appears character-identically in 4 files — REDACTED, supabase/functions/_shared/breakpoint_helpers.ts, supabase/functions/guide-freeform-chat/index.ts, 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 supabase/functions/sync-user-memory/index.ts:392 — `Number.isFinite(timeoutMsRaw) && timeoutMsRaw > 0` appears character-identically in 2 files — supabase/functions/sync-user-memory/index.ts, 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:33 — `_cachedToken && Date.now() < _tokenExpiresAt - 60_000` appears character-identically in 2 files — REDACTED, supabase/functions/weekly-report-push/index.ts. 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:35 — `data?.token && new Date(data.expires_at) > new Date(Date.now() + 30 * 60 * 1000)` appears character-identically in 3 files — REDACTED, supabase/functions/feishu-webhook/index.ts, 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 supabase/functions/_shared/guide_memory.ts:47 — `typeof v === "number" && Number.isFinite(v)` appears character-identically in 2 files — supabase/functions/_shared/guide_memory.ts, 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.
X7 · Silent fallback defaults · Silent fallback default in catch · ×3
  • Silent fallback default in catch frontend/lib/features/reward/controllers/reward_controller.dart:389 — `consumeXpBoostIfAvailable` turns every thrown error into `1.0` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch supabase/functions/_shared/guide_engine.ts:322 — `fetchRecommendations` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch supabase/functions/tests/guide_engine_recommendations_test.ts:40 — `fetchRecommendationsPattern` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×2
  • Projects may be oversized for their cohesion frontend/pubspec.yaml:1 — `frontend` (36699 LoC, 178 module-visible types across 40 directories) overshoots its size bounds. 2 of 13 build unit(s) (Deno, Gradle, npm, pub) overshoot their size bounds, lowering Project Cohesion to 6.9/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.
  • Projects may be oversized for their cohesion package.json:1 — `(repository root)` (9747 LoC, 57 module-visible types across 22 directories) overshoots its size bounds. 2 of 13 build unit(s) (Deno, Gradle, npm, pub) overshoot their size bounds, lowering Project Cohesion to 6.9/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.
D10 · Test Quality · Mock-dominated test · ×1
  • Mock-dominated test: rejects request when Supabase returns error backend/test/auth.test.ts:49 — This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found frontend/lib/main.dart:24 — 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 `frontend/lib/main.dart` makes this repository a deployable product (line 24).
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P3 · Security & performance tooling · No SAST · ×1
  • 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 3 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.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation package.json:6 — `package.json` 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`.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate REDACTED:142 — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
R7 · Dead Code · Unused export 'isAgentStepTerminalStatus' · ×1
  • Unused export 'isAgentStepTerminalStatus' supabase/functions/_shared/agent_types.ts:150 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'detectGuideLanguage' · ×1
  • Unused export 'detectGuideLanguage' supabase/functions/_shared/guide_ai.ts:198 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused module-local declaration 'buildImageUrl' · ×1
  • Unused module-local declaration 'buildImageUrl' supabase/functions/guide-portrait-generate/index.ts:79 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'touchImage' · ×1
  • Unused module-local declaration 'touchImage' supabase/functions/guide-portrait-generate/index.ts:224 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'DAY_MS' · ×1
  • Unused module-local declaration 'DAY_MS' supabase/functions/tests/habit_chain_detection_property_test.ts:28 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 11/18 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-acb033ff66ad498c80cb93971af8065a/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-acb033ff66ad498c80cb93971af8065a/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .44artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .24artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 1 file(s) — `REDACTED` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1e830-b317-7ecd-918d-17279947b4bf · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

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