Public report of PythonnotJava/RemindAI, 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, 12:27 UTC · Survey ID cd_4c676fa69bbc4a89a565e63805502e91

PythonnotJava/RemindAI

Measured 17 November 2026, 12:26 UTC, at code version ea9d68d

First survey, so nothing to compare with yet
CAI score 33.6out of 100 Weak
CriticalWeakAdequateStrongExemplary

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A medium codebase: 82,536 lines of product code in 8 projects, tests not counted · Estimated rebuild effort: about 0.6 person-years · Weakest lens: Production Readiness, 24.1

Findings by how serious they are

2 critical 628 serious 60 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, 12:26 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

75of 75 dimensions measured by tools.
670of 690 findings point to an exact file and line, so you can open each one in the code. The other 20 concern the repository as a whole, such as missing documentation.
75dimensions across 7 lenses, read from 82,536 lines of product code in 8 projects.
Chapters

Executive summary

PythonnotJava/RemindAI falls short of our standard for production because we found no working pipeline that builds or tests changes to the code and no automated security scanning of the code, its secrets or its dependencies. It scores 33.6 out of 100 and is rated Weak, and one of its two critical findings is a security problem in the packages it uses.

Production Readiness, at 24.1, is the weakest lens and counts most in the score. The best first steps are adding an automated build and test pipeline and adding a test runner and linting to the front end's build, each worth about 2.9 points. Raising Production Readiness to 70 would lift the score to about 41.9.

One known security hole in a package the code depends on can be used by attackers. One form field can't be read by a screen reader. Updating the vulnerable packages and labelling the form fields would close both risks.

The product code is 82,536 lines, about €86,000 to rebuild.

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

How the score is built: what each lens counts 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 24.1 · counts for 46%Code Health 26.5 · counts for 25%Security and Compliance 45.1 · counts for 14%Accessibility 55.8 · counts for 8%Performance 70.0 · counts for 4%Architecture 70.4 · counts for 2%Maturity 71.0 · counts for 1%

If Production Readiness rose from 24.1 to 70, the lowest score rated Strong, the score would rise from 33.6 to about 41.9.

Code composition: what the lines of code are
Product code 90%Tests 10%
Rebuild cost: about €86,000 · Estimate
Cost to rebuild€29,000 to €140,000, for 476 to 1,510 hours of work, about 0.6 person-years for 1 to 2 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 34. 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: 82,536 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
Add a CI workflow that builds and runs the test suite on every push/PR.
Raises the score by about 2.9 points · Medium effort · CI/CD gates
2
Add a test runner (vitest / jest / playwright) and eslint and type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI.
Raises the score by about 2.9 points · Medium effort · Tooling
3
Name the access rules — Serverpod scopes (requiredScopes, a Scope subclass) or roles and permissions declared once — and consult them where access is checked, so the rule set is reviewable and testable on its own.
Raises the score by about 2.6 points · Medium effort · Access Controls

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

Architecture — module dependency graph

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

arch archify archify dock_panel dock_panel flutter_highlight flutter_highlight highlight highlight flutter_highlight->highlight gpt_markdown gpt_markdown remind_ai remind_ai remind_ai->dock_panel remind_ai->flutter_highlight remind_ai->gpt_markdown remind_ai->highlight

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

23 modules, with 8 dependencies between them. Every module uses only modules listed above it, so there are no loops.

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 assets.office_engine.excel.excel_engine2 assets.office_engine.excel.excel_engine.protocol3 assets.office_engine.word4 assets.office_engine.word.word_engine5 assets.office_engine.word.word_engine.protocol6 assets.scripts.archify.renderers.architecture7 assets.scripts.archify.renderers.dataflow8 assets.scripts.archify.renderers.lifecycle9 assets.scripts.archify.renderers.sequence10 assets.scripts.archify.renderers.shared11 assets.scripts.archify.renderers.workflow12 assets.scripts.paddle_ocr13 assets.scripts.volcano_tts14 assets.web15 repository.core16 repository.custom_widgets17 repository.l10n18 repository.src19 repository.widgets20 repository21 repository.providers22 repository.shared23 repository.features
1 assets.office_engine.excel.excel_engine
2 assets.office_engine.excel.excel_engine.protocol
3 assets.office_engine.word
4 assets.office_engine.word.word_engine
5 assets.office_engine.word.word_engine.protocol
6 assets.scripts.archify.renderers.architecture
7 assets.scripts.archify.renderers.dataflow
8 assets.scripts.archify.renderers.lifecycle
9 assets.scripts.archify.renderers.sequence
10 assets.scripts.archify.renderers.shared
11 assets.scripts.archify.renderers.workflow
12 assets.scripts.paddle_ocr
13 assets.scripts.volcano_tts
14 assets.web
15 repository.core
16 repository.custom_widgets
17 repository.l10n
18 repository.src
19 repository.widgets
20 repository261
21 repository.providers21
22 repository.shared1
23 repository.features91124
Uses a module listed above itPart of a loopThe module itself
1 assets.office_engine.excel.excel_engine2 assets.office_engine.excel.excel_engine.protocol3 assets.office_engine.word4 assets.office_engine.word.word_engine5 assets.office_engine.word.word_engine.protocol6 assets.scripts.archify.renderers.architecture7 assets.scripts.archify.renderers.dataflow8 assets.scripts.archify.renderers.lifecycle9 assets.scripts.archify.renderers.sequence10 assets.scripts.archify.renderers.shared11 assets.scripts.archify.renderers.workflow12 assets.scripts.paddle_ocr13 assets.scripts.volcano_tts14 assets.web15 repository.core16 repository.custom_widgets17 repository.l10n18 repository.src19 repository.widgets20 repository21 repository.providers22 repository.shared23 repository.featuresassets.office_engine.excel.excel_engine1assets.office_engine.excel.excel_engine.protocol2assets.office_engine.word3assets.office_engine.word.word_engine4assets.office_engine.word.word_engine.protocol5assets.scripts.archify.renderers.architecture6assets.scripts.archify.renderers.dataflow7assets.scripts.archify.renderers.lifecycle8assets.scripts.archify.renderers.sequence9assets.scripts.archify.renderers.shared10assets.scripts.archify.renderers.workflow11assets.scripts.paddle_ocr12assets.scripts.volcano_tts13assets.web14repository.core15repository.custom_widgets16repository.l10n17repository.src18repository.widgets19repository20repository.providers21repository.shared22repository.features2326121191124

At a glance — Code Health · 26.5 · Weak · gated by D2, R1, R10, R2 ·

At a glance — Architecture · 70.4 · Adequate · gated by R11 ·

At a glance — Maturity · 71.0 · Strong ·

At a glance — Readiness · 24.1 · Critical · gated by R6, P1, P2, P3 ·

At a glance — Security · 45.1 · Weak · gated by D31, C2 ·

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

At a glance — Performance · 70.0 · Strong ·

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
A02:2025 — Security Misconfiguration2Medium
A03:2025 — Software Supply Chain Failures1High / Critical

Roadmap

Top priorities: Add a CI workflow that builds and runs the test suite on every push/PR; Add a test runner (vitest / jest / playwright) and eslint and type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI; Name the access rules — Serverpod scopes (requiredScopes, a Scope subclass) or roles and permissions declared once — and consult them where access is checked, so the rule set is reviewable and testable on its own.

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

Do thisHelpsEffortDimension
Add a CI workflow that builds and runs the test suite on every push/PR.+2.9 ptsMediumCI/CD gates
Add a test runner (vitest / jest / playwright) and eslint and type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI.+2.9 ptsMediumTooling
Name the access rules — Serverpod scopes (requiredScopes, a Scope subclass) or roles and permissions declared once — and consult them where access is checked, so the rule set is reviewable and testable on its own.+2.6 ptsMediumAccess Controls
Write a diagnostic trail the user can hand back with a bug report: log through `package:logging` to a file in the app's support directory that a report can attach. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.+2.5 ptsMediumObservability
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.+2.5 ptsMediumType Safety
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.+2.5 ptsMediumCode Duplication
Resolve the 10 finding(s) in Cyclomatic Complexity.+2.5 ptsMediumCyclomatic Complexity
Secure the server's transport: serve TLS itself (`HttpServer.bindSecure(…, context)`, or `shelf_io.serve(…, securityContext: context)`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only. A server only this device needs to reach should bind `InternetAddress.loopbackIPv4` instead.+1.5 ptsMediumWeb-Security Posture

File quality

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

FileScoreBandWorst signal
lib/features/chat/chat_provider.dart4.8MixedCyclomatic Complexity: ChatNotifier._handleEvent (cyclomatic 43)
lib/core/agent/agent_context.dart4.8MixedCyclomatic Complexity: AgentContextBuilder.build (cyclomatic 40)
lib/core/image/image_agent_capability.dart5.6MixedCyclomatic Complexity: ImageAgentCapability._execute (cyclomatic 28)
lib/core/agent/transformers/context_compactor.dart6.0MixedExplicit Debt: TodoComment
REDACTED6.9MixedIaC & Container Security: Medium IaC: REDACTED
lib/core/toolshell/agent_loop.dart7.0MixedCyclomatic Complexity: AgentLoop.chat (cyclomatic 89)
assets/office_engine/word/word_engine/reader.py7.0MixedCyclomatic Complexity: reader.read_word (cyclomatic 79)
assets/office_engine/excel/excel_engine/reader.py7.0MixedCyclomatic Complexity: reader._read_xlsx (cyclomatic 68)
lib/features/tools/vpl/vpl_code_gen.dart7.0MixedCyclomatic Complexity: VplCodeGenerator._generatePythonChain (cyclomatic 43)
assets/office_engine/word/word_engine/writer.py7.0MixedCyclomatic Complexity: writer.edit_word (cyclomatic 40)
lib/core/toolshell/executor.dart7.0MixedCyclomatic Complexity: Executor.run (cyclomatic 31)
lib/core/image/image_agent_service.dart7.0MixedCyclomatic Complexity: ImageAgentService._geminiGenerate (cyclomatic 28)
lib/features/mcp/mcp_page.dart7.0MixedCyclomatic Complexity: _McpServerFormDialogState._applyJsonPayload (cyclomatic 28)
lib/core/online_service/online_server.dart7.0MixedCyclomatic Complexity: OnlineServer._handleChat (cyclomatic 24)
lib/core/llm/anthropic_client.dart7.0MixedCyclomatic Complexity: AnthropicClient._parseSse (cyclomatic 21)
lib/core/server/api_server.dart7.0MixedCyclomatic Complexity: ApiServer._handle (cyclomatic 20)
lib/features/chat/chat_page.dart7.0MixedCyclomatic Complexity: _ChatPageState._buildMessageList (cyclomatic 19)
lib/features/tools/formula_ocr/formula_ocr_tool.dart7.0MixedCognitive Complexity: _FormulaOcrUIState._exportWord (cognitive 18)
lib/features/tools/flowchart/flowchart_editor.dart7.0MixedCognitive Complexity: _FlowchartEditorPageState._exportImage (cognitive 16)
lib/features/chat/widgets/markdown_view.dart7.0MixedGod Classes: FileTooLong: widgets/markdown_view.dart

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

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

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

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 75 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 — 75 dimensions across the health lenses
D1D2D3D4D5D6D12D13D14D15D17D19D20D26D28D29D30D31D34D35D43D44AC1AC2AC3AC5AC6AX1AX10AX3AX5AX6AX7AX9C2GD1IC1M1M2M3M4P1P10P2P3P4P6PF3R1R10R11R2R3R5R6R7R8R9S1X1X12X13X16X17X18X19X2X21X25X27X28X29X3X30X5

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, 670 of 690 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 · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1e979-6ff8-7acc-bb1c-03ef394cf7cd.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.dart) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.dart) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-contributor repository — bus factor is not applicable (1 contributor(s) across 75 commit(s) sampled, automation and bot accounts excluded). Concentration needs a team to concentrate: with one contributor there is nobody to spread the knowledge to, so there is nothing here for the owner to act on.
  • 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. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • 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 (packages/highlight/pubspec.yaml), 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 — 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. 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.
  • D31 IaC & Container Security — 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. Packages/highlight/lib/languages/dockerfile.dart carries no `FROM` instruction, so it declares no build stage and every Dockerfile rule this engine owns — the runtime-hardening, key-material, mutable-clone, no-op-shim, build-context, trust-anchor, install-guard, setuid and world-writable-path rules — is outside its own premise there and returned nothing. That silence is deliberate and correct: with no base image there is no image to reason about. It is reported here because it is NOT the same fact as a clean file, and coverage is stated as 0 of 1 Infrastructure-as-Code manifest(s) fully judged rather than as 100%. The vendor scanners (trivy, checkov) do read these files and their findings above stand; only this engine's own stage-keyed rules are absent. No owner action: a build file with no FROM is a legitimate include fragment.
  • 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. `assets/scripts/archify/renderers/shared/utils.mjs` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AXB1 Runtime evidence locked — no reproducible boot — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: 3 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. We then boot it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 'package:sqlite3' is imported (lib/core/db/database.dart:3), 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.
  • 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:sqlite3' is imported (lib/core/db/database.dart:3), 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:sqlite3' is imported (lib/core/db/database.dart:3), 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:sqlite3' is imported (lib/core/db/database.dart:3), 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.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • 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.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 113 further occurrence(s) are not listed individually; the score already reflects all 153.

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.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • 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.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (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.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • 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 Complexity5.8 / 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 5.8 / 10 · rule-coverage 100% · ceiling Prevented

75 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was AgentLoop.chat at 89. A further 3 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being VplPortPresets.localizedPortName at 23 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: lib/features/tools/vpl/vpl_nodes.dart (VplPortPresets.localizedPortName at 23). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

AgentLoop.chat (cyclomatic 89)lib/core/toolshell/agent_loop.dart:275
reader.read_word (cyclomatic 79)assets/office_engine/word/word_engine/reader.py:474
reader._read_xlsx (cyclomatic 68)assets/office_engine/excel/excel_engine/reader.py:225
OpenAiClient.chatStreamFull (cyclomatic 59)lib/core/llm/llm_client.dart:521
ChatNotifier._handleEvent (cyclomatic 43)lib/features/chat/chat_provider.dart:1667

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

What to do

  1. Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with AgentLoop.chat (cyclomatic 89), reader.read_word (cyclomatic 79), reader._read_xlsx (cyclomatic 68). — 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 3 together lifts Cyclomatic Complexity from 5.8 to about 6.3/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

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

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

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

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

142 method(s) exceeded the cognitive complexity threshold of 15; the worst was AgentLoop.chat at 205.

cli.main (cognitive 16) · ×2assets/office_engine/excel/excel_engine/cli.py:41
AgentLoop.chat (cognitive 205)lib/core/toolshell/agent_loop.dart:275
reader.read_word (cognitive 168)assets/office_engine/word/word_engine/reader.py:474
reader._read_xlsx (cognitive 157)assets/office_engine/excel/excel_engine/reader.py:225
OpenAiClient.chatStreamFull (cognitive 149)lib/core/llm/llm_client.dart:521

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

What to do

  1. Bring the 10 bodies over 60 down to 60 or less in Cognitive Complexity — start with AgentLoop.chat (cognitive 205), reader.read_word (cognitive 168), reader._read_xlsx (cognitive 157). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 10 together lifts Cognitive Complexity from 2.0 to about 4.7/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.2 / 10Strong✓ Tool-verified

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

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

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

93 god class(es) detected.

MethodTooLong: AgentLoop.chat · ×37lib/core/toolshell/agent_loop.dart:275
FileTooLong: chat/chat_page.dart · ×29lib/features/chat/chat_page.dart
ClassTooLong: ChatNotifier · ×21lib/features/chat/chat_provider.dart:310
TooManyMethods: ChatNotifier · ×6lib/features/chat/chat_provider.dart:310

What to do

  1. Resolve the 37 MethodTooLong finding(s) in God Classes — start with chat_provider.dart (4), chat_page.dart (4), vpl_code_gen.dart (2). — One of this dimension's main actionable groups (37 warning-level).
  2. Resolve the 29 FileTooLong finding(s) in God Classes — start with reader.py (2), chat_page.dart, chat_provider.dart. — One of this dimension's main actionable groups (29 warning-level).
  3. Resolve the 21 ClassTooLong finding(s) in God Classes — start with chat_provider.dart, executor.dart, pet_page.dart. — One of this dimension's main actionable groups (21 warning-level).

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

D4 · Code Duplication6.9 / 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.9 / 10 · rule-coverage 100% · ceiling Verified

123 duplicated block group(s) detected. 7.7 % of the production lines (6,324 of 82,536) are in a reported copy. A further 78 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (11 lines × 2) · ×8lib/core/image/image_agent_service.dart:548
Duplicated block (10 lines × 2) · ×8lib/features/chat/chat_page.dart:1160
Duplicated block (8 lines × 2) · ×8lib/features/experts/experts_page.dart:37
Duplicated block (9 lines × 2) · ×7lib/core/llm/anthropic_sdk_client.dart:229
Duplicated block (7 lines × 2) · ×6lib/features/multi_agent/widgets/agent_chat_panel.dart:91

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

What to do

  1. Resolve the 8 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with image_agent_service.dart, python_bootstrap.dart, api_server.dart. — One of this dimension's main actionable groups (8 warning-level).
  2. Resolve the 8 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with chat_page.dart (3), model_cards_page.dart, flowchart_editor.dart. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 8 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with experts_page.dart, agent_badge_dialog.dart, embedding_section.dart. — One of this dimension's main actionable groups (8 warning-level).

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

D5 · Coupling8.7 / 10Strong✓ Tool-verified

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

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

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

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

6 production modules (npm+pub), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence, with abstractness counted on 2 of the 6 (the rest declare no modelled class or interface, export only macros, declare types in source no model reads, or have no source directory of their own).

Off the main sequence: dock_panel

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.9 / 10Stronggated by 2 serious findings✓ Tool-verified

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

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

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

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

2 of 197 classes have LCOM4 above 3.

Low cohesion: ImageAgentCapability (LCOM4 6) · ×2lib/core/image/image_agent_capability.dart:12

What to do

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

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

D12 · Dependency Hygiene9.6 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

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

8 outdated, 0 discontinued direct pub dependencies. The direct set is read from pubspec.lock's own `dependency:` markers, so development and transitive packages are excluded by the resolver's classification rather than by inference. SDK-sourced packages (flutter and friends) are not graded: they ship with the toolchain and carry the placeholder version 0.0.0, so there is no pub.dev release for them to be behind. A newer release is reported only where this repository's OWN constraint already admits it — which for a BARE constraint it never does, because a bare pub constraint is EXACT and `dart pub upgrade` would not move it. Known CVEs in this dependency graph are D30's question.

Outdated: archive · ×8

✓ On the Gold path — maintain.

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 143 resolved pub package(s) use a banned license. Licences were read from pub.dev's analysis of each package's licence file, over every package this repository's pubspec.lock resolves from pub.dev, direct and transitive, at the locked version; the 1 package(s) the lock marks direct dev are excluded, and SDK, path and git packages have no registry release to read. pub.dev analyses only recent releases, so for 29 package(s) locked at an older version the licence read is that of the package's latest analysed release, not of the locked one. 1 of them carry no licence pub.dev recognises; that is missing data, not a violation, and none of them is charged.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

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

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

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

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

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

TodoCommentlib/core/agent/transformers/context_compactor.dart:1402

What to do

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

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

D19 · Documentation Quality5.0 / 10Adequate✓ Tool-verified

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 5.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 2 documentation facets pass in full; short on: F4 map. 16 document(s) read across 6 unit(s).

Documentation: no map of the repository's partsREADME.md:1

What to do

  1. Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).

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

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 foundpackages/dock_panel/lib/main.dart:6

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.

D26 · Project Cohesion7.5 / 10Strong✓ 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 7.5 / 10 · rule-coverage 100% · ceiling Documented

1 of 8 build units (Python, npm, pub) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesionpubspec.yaml:1

What to do

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

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

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)10.0 / 10Exemplary○ Nothing flagged

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 10.0 / 10 · rule-coverage 100% · ceiling Documented

semgrep found no security issues. semgrep hit a parse error in 1 file(s) — `assets/scripts/archify/renderers/shared/utils.mjs` (lines 44–45, lines 45–47) — 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.

✓ On the Gold path — maintain.

Detailed fixes: d29_recommendation.md.

D30 · Dependency Vulnerabilities9.4 / 10Adequategated by 1 critical finding✓ 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 9.4 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED

What to do

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

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

D31 · IaC & Container Security9.8 0.0 / 10Critical✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (Dockerfile/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

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

2 finding(s): 0 critical, 0 high, 2 medium, 0 low.

REDACTED

What to do

  1. Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2). — One of this dimension's main actionable groups (2 warning-level).

Detailed fixes: d31_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 214 of the 281 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 Coupling9.9 / 10Stronggated by 3 serious findings✓ 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 9.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: agent_context.dart↔chat_page.dart 60%; chat_provider.dart↔model_cards_page.dart 55%; agent_context.dart↔model_cards_page.dart 50%

Change coupling: agent_context.dart ↔ chat_page.dart · ×3lib/core/agent/agent_context.dart:1

What to do

  1. Resolve the 3 Change coupling finding(s) in Change Coupling — start with agent_context.dart (2), chat_provider.dart. — One of this dimension's main actionable groups (3 warning-level).

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

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 5 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 alternatives10.0 / 10Exemplary○ Nothing flagged

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.

AC2 · Forms & labels5.4 / 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. — assets/web/index.html:20

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.2 / 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>. — assets/scripts/archify/assets/template.html:2
  • Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. — assets/scripts/archify/assets/template.html:659

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.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC6 · Visual & motion safety2.7 / 10Weak✓ Tool-verified

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

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

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

  • `.archify-toast` moves (`transition: opacity 0.2s, transform 0.2s`) 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. — assets/scripts/archify/assets/template.html:375
  • `#stop-btn` sets color: #fff on background-color: #f44336 — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — assets/web/style.css:155

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.
AX1 · Captive dependencies10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether any singleton service captures a scoped/transient dependency — a silent lifetime/threading bug.

Method: Roslyn scan: DI registrations parsed from AddSingleton/Scoped/Transient; each singleton checked for captured shorter-lifetime dependencies. Exhaustive, deterministic.

AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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 segregation9.7 / 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.

  • `S` declares 1183 abstract methods: `appTitle`, `navChat`, `navModels`, `navSkills`, `navTools`, `navMultiAgent`, `navExperts`, `navMcp`, `navSettings`, `navHistory`, `navMemory`, `navLogs`, `navPet`, `settingsTitle`, `settingsAppearance`, `settingsTheme`, `settingsAccentColorTitle`, `settingsAccentColorPurple`, `settingsAccentColorGreen`, `settingsAccentColorBlue`, `settingsAccentColorCyan`, `settingsAccentColorTwilight`, `settingsNotifyOnBlur`, `settingsNotifyOnBlurDesc`, `settingsEnterAction`, `settingsEnterSend`, `settingsEnterNewline`, `settingsEnterSendHint`, `settingsEnterNewlineHint`, `settingsStorage`, `settingsDatabasePath`, `settingsHistoryPath`, `settingsSkillsPath`, `settingsLogsPath`, `settingsToolPaths`, `settingsPandocPath`, `settingsPandocNotDetected`, `settingsQdrant`, `settingsEmbedding`, `settingsAbout`, and 1143 more. Counted over its public methods with no body, once per name; concrete methods and `_`-private members are not counted, because no implementer that extends it is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — lib/l10n/app_localizations.dart:13

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
AX7 · Slice cohesion10.0 / 10Exemplary✓ 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.

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.

C2 · Access Controls1.7 / 10Critical✓ Tool-verified

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

  • Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
  • Only 1 place(s) refuse an unauthorized caller — too few to demonstrate default-deny across handlers.

What to do

  • Name the access rules — Serverpod scopes (requiredScopes, a Scope subclass) or roles and permissions declared once — and consult them where access is checked, so the rule set is reviewable and testable on its own.
  • Enforce authorization at every handler — a guard on each route, or a global authentication guard/middleware with explicit public opt-outs, so protected-by-default is demonstrable.
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.

  • A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×6) — packages/gpt_markdown/test/bugs/link_url_not_stored_test.dart:20, packages/gpt_markdown/test/bugs/link_url_not_stored_test.dart:38, packages/gpt_markdown/test/bugs/link_with_title_test.dart:22, …

What to do

  • Clear the softer debt: re-enable or delete tests marked `skip:`, decide whether each empty method or UnsupportedError is deliberate (and say so in a comment), and replace `// ignore_for_file: type=lint` with targeted, justified ignores.
M1 · Documentation (README)8.5 / 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 accuracy6.0 / 10Adequate✓ Tool-verified

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.

  • assets/office_engine/word/README.md links to `images/图1.png`, but `assets/office_engine/word/images/图1.png` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — assets/office_engine/word/README.md:139
  • packages/gpt_markdown/test/README.md links to `img.png`, but `packages/gpt_markdown/test/img.png` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/gpt_markdown/test/README.md:86

What to do

  • Reconcile the README with reality: assets/office_engine/word/README.md links to `images/图1.png`, but `assets/office_engine/word/images/图1.png` does not exist; packages/gpt_markdown/test/README.md links to `img.png`, but `packages/gpt_markdown/test/img.png` does not exist.
P1 · CI/CD gates0.0 / 10Critical✓ Tool-verified

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

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

  • No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.

What to do

  • Add a CI workflow that builds and runs the test suite on every push/PR.
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 · Observability1.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 or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.

What to do

  • Write a diagnostic trail the user can hand back with a bug report: log through `package:logging` to a file in the app's support directory that a report can attach. Start with the error paths that emit nothing — a discarded error is the failure the user cannot describe and you cannot reproduce.
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` — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
  • `assets/scripts/archify/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`. — assets/scripts/archify/package.json:11

What to do

  • Run what this repository's stack ships: the Dart analyzer's security lints plus `semgrep --config=auto` — locally for now, since there is no CI pipeline here yet, and as a step of the first workflow you add so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback8.0 / 10Strong✓ 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.

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 Hygiene5.0 / 10Adequate✓ Tool-verified

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

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

PF3 · Async & latency hygiene7.0 / 10Strong✓ 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.

  • `loadAll` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/core/font/custom_font_loader.dart:35
  • `removeFont` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs. — lib/core/font/custom_font_loader.dart:80

What to do

  • Dart: await the async dart:io API (readAsString, writeAsString, Process.run, Future.delayed) instead of the *Sync variant or sleep(), or move heavy synchronous work to another isolate with Isolate.run.
R1 · Type Safety0.0 / 10Critical✓ 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.

  • 0 typed · 10 plain JS — the untyped files are assets/scripts/archify/renderers/architecture/render-architecture.mjs, assets/scripts/archify/renderers/dataflow/render-dataflow.mjs, assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs, assets/scripts/archify/renderers/sequence/render-sequence.mjs, assets/scripts/archify/renderers/shared/cli.mjs, assets/scripts/archify/renderers/shared/geometry.mjs (+4 more).

What to do

  • Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
R10 · Code Duplication0.0 / 10Critical✓ 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.

  • 13 duplicated blocks under assets/scripts/archify/renderers/ have copies in at least two of the sibling directories architecture, dataflow, lifecycle, sequence, workflow — 11 of them are reported below, and 2 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 13 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 13 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 13 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. — assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:88
  • assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:88 · assets/scripts/archify/renderers/workflow/render-workflow.mjs:66 — the two spans are one implementation copied and then locally edited — 1442 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. — assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:88
  • assets/scripts/archify/renderers/architecture/render-architecture.mjs:113 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:148 — the two spans are one implementation copied and then locally edited — 900 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. — assets/scripts/archify/renderers/architecture/render-architecture.mjs:113
  • assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:59 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:97 — the two spans are one implementation copied and then locally edited — 901 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. — assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:59
  • assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:181 · assets/scripts/archify/renderers/workflow/render-workflow.mjs:242 — the two spans are one implementation copied and then locally edited — 419 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. — assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:181
  • assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:153 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:200 — 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. — assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:153
  • assets/scripts/archify/renderers/architecture/render-architecture.mjs:286 · assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:264 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:353 — the 3 copies are spread across 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — assets/scripts/archify/renderers/architecture/render-architecture.mjs:286
  • assets/scripts/archify/renderers/architecture/render-architecture.mjs:194 · assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:181 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:236 · assets/scripts/archify/renderers/workflow/render-workflow.mjs:242 — 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. — assets/scripts/archify/renderers/architecture/render-architecture.mjs:194
  • assets/scripts/archify/renderers/architecture/render-architecture.mjs:218 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:293 · assets/scripts/archify/renderers/workflow/render-workflow.mjs:276 — 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. — assets/scripts/archify/renderers/architecture/render-architecture.mjs:218
  • assets/scripts/archify/renderers/architecture/render-architecture.mjs:150 · assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:122 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:174 — 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. — assets/scripts/archify/renderers/architecture/render-architecture.mjs:150
  • assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:143 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:195 · assets/scripts/archify/renderers/sequence/render-sequence.mjs:119 · assets/scripts/archify/renderers/workflow/render-workflow.mjs:188 — the 4 copies are spread across 4 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. There is one copy in each of 4 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:143
  • assets/scripts/archify/renderers/architecture/render-architecture.mjs:140 · assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:111 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:164 — 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. — assets/scripts/archify/renderers/architecture/render-architecture.mjs:140

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.
R11 · Import Boundaries0.0 / 10Critical✓ Tool-verified

React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).

Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.

  • assets/scripts/archify/renderers/shared/validator.mjs:14 imports ajv/dist/2020.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — assets/scripts/archify/renderers/shared/validator.mjs:14

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity0.0 / 10Critical✓ 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.

  • validateWorkflow has cyclomatic complexity 53 and cognitive complexity 77; 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. — assets/scripts/archify/renderers/workflow/render-workflow.mjs:80
  • validateLifecycle has cyclomatic complexity 53 and cognitive complexity 74; 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. — assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:102
  • validateDataflow has cyclomatic complexity 51 and cognitive complexity 70; 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. — assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:64
  • validateArchitecture has cyclomatic complexity 49 and cognitive complexity 62; 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. — assets/scripts/archify/renderers/architecture/render-architecture.mjs:91
  • validateSequence has cyclomatic complexity 44 and cognitive complexity 62; 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. — assets/scripts/archify/renderers/sequence/render-sequence.mjs:48
  • routeVia has cyclomatic complexity 17 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. (×2) — assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:207, assets/scripts/archify/renderers/workflow/render-workflow.mjs:213
  • measureState has cyclomatic complexity 13 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. — assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:77
  • routeVia has cyclomatic complexity 13 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. — assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:160
  • annotatePath has cyclomatic complexity 12 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. — assets/scripts/archify/renderers/shared/validator.mjs:70
R3 · Large Files10.0 / 10Exemplary✓ 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.

R5 · Dependency Freshness9.9 / 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 · Tooling0.0 / 10Critical✓ 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 a test runner (vitest / jest / playwright) and eslint and type checking (adopt TypeScript, or type-check the existing JavaScript with `checkJs`) as package.json scripts and run them in CI.
R7 · Dead Code10.0 / 10Exemplary✓ 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.

R8 · Dependency Hygiene10.0 / 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.

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.

S1 · Web-Security Posture6.0 / 10Adequate✓ Tool-verified

Other · Security — Read from this repository's Dart source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS certificate validation — facts about code that hold whether or not it serves anything itself. The TLS protocol version is not read: `dart:io` leaves the protocol floor to the platform's TLS library and has no switch that admits an obsolete version. This repository serves HTTP itself (lib/core/server/api_server.dart:53 — `HttpServer.bind(`), so its Dart source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Dart spelling appears in production source, not proven on every route.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • This repository runs an HTTP server that is not bound to the loopback interface alone — or binds it at an address its source does not spell out — and nothing in its Dart source secures the transport: no `HttpServer.bindSecure` or `securityContext:`, no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: lib/core/server/api_server.dart:53 — `HttpServer.bind(`.
  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Dart server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: lib/core/server/api_server.dart:53 — `HttpServer.bind(`.

What to do

  • Secure the server's transport: serve TLS itself (`HttpServer.bindSecure(…, context)`, or `shelf_io.serve(…, securityContext: context)`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only. A server only this device needs to reach should bind `InternetAddress.loopbackIPv4` instead.
  • Set security response headers on what the server sends — `response.headers.set('X-Content-Type-Options', 'nosniff')` in a `dart:io` handler, or a shelf middleware that adds `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy to every `Response`.
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.

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

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

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

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.

  • `compileKeywords` is public and takes `dynamic rawKeywords` from its caller, and it calls itself at line 42 (`compileKeywords`) with a piece of `rawKeywords` — and nowhere in `compileKeywords` 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. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `compileKeywords` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/highlight/lib/src/compile_keywords.dart:42

What to do

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

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

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

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

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

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

X2 · Cancellation propagation4.5 / 10Weak✓ Tool-verified

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

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

  • Only 3/37 functions that make a cancellable request (Dio, AbortableRequest) accept a CancelToken or pass one on, so a request keeps running after whatever wanted it has given up — a screen navigated away from, a disposed widget, a superseded search. Take a `CancelToken? cancelToken` and hand it to the request as `cancelToken:` (or hold one and cancel it in `dispose`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `_callGeminiImageGen` calls `dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/features/tools/image_gen/image_gen_tool.dart:446
  • `_testConnection` calls `dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. (×2) — lib/features/tools/image_gen/image_gen_tool.dart:637, lib/features/settings/widgets/embedding_editor_dialog.dart:57
  • `_callP2tApi` calls `dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/features/tools/formula_ocr/formula_ocr_tool.dart:487
  • `_testConnection` calls `dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/features/models/model_cards_page.dart:337
  • `_saveAs` calls `Dio(…).get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/features/chat/widgets/markdown_view.dart:725
  • `_runTest` calls `dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/features/chat/widgets/new_workspace_dialog.dart:525
  • `check` calls `dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/update/update_checker.dart:70
  • `_searchTavily` calls `_dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/search/search_service.dart:37
  • `_searchBrave` calls `_dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/search/search_service.dart:77
  • `_searchBaidu` calls `_dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/search/search_service.dart:111
  • `_ensureUv` calls `dio.download(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/python/python_bootstrap.dart:172
  • `_handleTestModel` calls `dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/online_service/online_server.dart:709
  • `ensureCollection` calls `_dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:117
  • `_embed` calls `_embeddingDio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:176
  • `_writePoint` calls `_dio.put(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:301
  • `_supersedeSimilar` calls `_dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:335
  • `addKnowledgeChunks` calls `_dio.put(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:400
  • `_recallFromQdrant` calls `_dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:506
  • `deletePoint` calls `_dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:594
  • `deletePointsByField` calls `_dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:611
  • `getVectorSize` calls `_dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:636
  • `deleteCollection` calls `_dio.delete(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:646
  • `getPointCount` calls `_dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:661
  • `listCollections` calls `_dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:672
  • `listPoints` calls `_dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:685
  • `rebuildFromSqlite` calls `_dio.delete(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/memory_manager.dart:721
  • `_checkHealth` calls `_dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/memory/qdrant_service.dart:346
  • `chatStream` calls `_dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/llm/llm_client.dart:478
  • `_sendOpenAiEdit` calls `dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/image/image_agent_service.dart:395
  • `_sendOpenAiGeneration` calls `dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/image/image_agent_service.dart:427
  • `_openAiChatImage` calls `dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/image/image_agent_service.dart:473
  • `post` calls `dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/image/image_agent_service.dart:664
  • `_bytesFromUrl` calls `dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`. — lib/core/image/image_agent_service.dart:876

What to do

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

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

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

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

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

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

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.

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

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

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

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

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

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

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

X3 · Exception handling4.3 / 10Weak✓ Tool-verified

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

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

  • `catch (_)` 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. (×8) — packages/highlight/lib/src/mode_compiler.dart:54, lib/providers/memory_provider.dart:94, lib/features/toolchain/toolchain_page.dart:203, …
  • 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. (×30) — lib/main.dart:31, lib/shared/layout/app_scaffold.dart:170, lib/shared/layout/app_scaffold.dart:180, …
  • `catch (e)` 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. (×2) — lib/features/settings/widgets/font_section.dart:36, lib/features/multi_agent/providers/multi_agent_provider.dart:215

What to do

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

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

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

X5 · Nullable reference types9.2 / 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 13 of 55 WCAG 2.2 Level A/AA success criteria (24%; ≈26% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 42 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
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

Not statically assessed — these 42 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.1, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.3, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

Reference — by lens

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

LensScoreRatingImpact
Code Health26.5Weak — gated by D2, R1, R10, R2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture70.4Adequate — gated by R11Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity71.0StrongStrongest area.
Readiness24.1Critical — gated by R6, P1, P2, P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security45.1Weak — gated by D31, C2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility55.8Adequate — gated by AC6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance70.0StrongSolid.
Unscored — 3 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 — 21 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 10 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:sqlite3' (lib/core/db/database.dart:3) 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:sqlite3' (lib/core/db/database.dart:3) 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:sqlite3' (lib/core/db/database.dart:3) 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 — 46 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.

  • AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. 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
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: this repository stores data through 'package:sqlite3' (lib/core/db/database.dart:3) 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.
  • D10 Test Quality — ~9258 lines of test source are present (.dart) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — no .dart test runner
  • D16 Bus Factor — single-contributor repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — N/A — too few peers to establish a naming convention (15041 declarations, no unit with a dominant convention).
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only; comments in this repository's .dart, .py source were not judged.
  • 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.
  • D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
  • 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 included — suite not readable by the collector
  • 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 — no CI workflow found
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Dart, JavaScript/TypeScript, Python source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for classes extending benchmark_harness's `BenchmarkBase`, `AsyncBenchmarkBase` or `PerfBenchmarkBase` (directly or through a base of your own), `benchmark(…)` calls under the pub `benchmark` package, Flutter's `benchmarkWidgets`, `watchPerformance` or `traceAction` in a test importing flutter_test, integration_test or flutter_driver, or benchmark_harness, benchmark or web_benchmarks in a pubspec.yaml, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R4 Test Coverage — the JS/TS workspace (10 production file(s)) has no JavaScript/TypeScript test, but it is 2.22% of this repository's production source and the other 97.78% carries 9,258 line(s) of test code this pass cannot read — an incidental frontend's reachability is not the repository's test posture, so it is not scored as one
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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
  • 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 5% of this repository's production lines — dart (73,102 lines), cpp (558 lines), c (150 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
  • 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.
  • 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 — 2 finding(s)
AC2 · Forms & labels · <textarea> without a programmatic label · ×1
  • <textarea> without a programmatic label assets/web/index.html:20 — 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.
D30 · Dependency Vulnerabilities · High CVE · ×1
  • REDACTED
Serious — 628 finding(s)
D3 · God Classes · MethodTooLong · ×37
  • MethodTooLong: AgentLoop.chat lib/core/toolshell/agent_loop.dart:275 — MethodTooLong — chat runs 320 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 220 over it, 3.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _ModelCardDialogState.build lib/features/models/model_cards_page.dart:473 — MethodTooLong — build 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: ChatNotifier._handleEvent lib/features/chat/chat_provider.dart:1667 — MethodTooLong — _handleEvent runs 252 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 152 over it, 2.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: LastTwilightTheme.buildDark lib/core/theme/independent_themes/last_twilight_theme.dart:88 — MethodTooLong — buildDark runs 236 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 136 over it, 2.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: VplCodeGenerator._generatePythonChain lib/features/tools/vpl/vpl_code_gen.dart:119 — MethodTooLong — _generatePythonChain runs 223 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 123 over it, 2.23× 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: AgentContextBuilder.build lib/core/agent/agent_context.dart:179 — MethodTooLong — build runs 220 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 120 over it, 2.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AutonomousLoop.run lib/core/toolshell/autonomous_loop.dart:273 — MethodTooLong — run runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× 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: _ImageGenUIState.build lib/features/tools/image_gen/image_gen_tool.dart:193 — MethodTooLong — build runs 168 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: WebAssets.indexHtml lib/core/online_service/web_assets.dart:6 — MethodTooLong — indexHtml runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× 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: ChatNotifier.sendMessage lib/features/chat/chat_provider.dart:1039 — MethodTooLong — sendMessage runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× 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: DatabaseHelper._createTables lib/core/db/database.dart:62 — MethodTooLong — _createTables runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _PetPageState._buildSettings lib/features/pet/pet_page.dart:229 — MethodTooLong — _buildSettings runs 158 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _CreateAgentDialogState.build lib/features/multi_agent/widgets/create_agent_dialog.dart:60 — MethodTooLong — build runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× 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: ServerSessionBuilder.build lib/core/server/server_session.dart:142 — MethodTooLong — build runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× 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: _FormulaOcrUIState.build lib/features/tools/formula_ocr/formula_ocr_tool.dart:242 — MethodTooLong — build runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ChatNotifier._handleLoopEvent lib/features/chat/chat_provider.dart:1414 — MethodTooLong — _handleLoopEvent runs 150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: AgentBadgeDialog.build lib/features/multi_agent/widgets/agent_badge_dialog.dart:14 — MethodTooLong — build runs 144 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 44 over it, 1.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _LoopChip._showLoopConfig lib/features/chat/chat_page.dart:2470 — MethodTooLong — _showLoopConfig runs 139 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× 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: _CommandCenterState.build lib/features/multi_agent/widgets/command_center.dart:138 — MethodTooLong — build 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: ImageAgentCapability._execute lib/core/image/image_agent_capability.dart:146 — MethodTooLong — _execute runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Executor._runPython lib/core/toolshell/executor.dart:914 — MethodTooLong — _runPython runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: VplCodeGenerator._generateDartChain lib/features/tools/vpl/vpl_code_gen.dart:460 — MethodTooLong — _generateDartChain runs 126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 26 over it, 1.26× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ContextCompactor._summarizeOnce lib/core/agent/transformers/context_compactor.dart:1098 — MethodTooLong — _summarizeOnce runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: ChatNotifier.cancelResponse lib/features/chat/chat_provider.dart:2040 — MethodTooLong — cancelResponse runs 124 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: _ApiServerCardState.build lib/features/settings/widgets/api_server_section.dart:82 — MethodTooLong — build runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× 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.
  • + 12 more in this group — see findings.md.
X2 · Cancellation propagation · Function without a CancelToken · ×34
  • Function without a CancelToken: _callGeminiImageGen lib/features/tools/image_gen/image_gen_tool.dart:446 — `_callGeminiImageGen` calls `dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _testConnection lib/features/tools/image_gen/image_gen_tool.dart:637 — `_testConnection` calls `dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _callP2tApi lib/features/tools/formula_ocr/formula_ocr_tool.dart:487 — `_callP2tApi` calls `dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _testConnection lib/features/settings/widgets/embedding_editor_dialog.dart:57 — `_testConnection` calls `dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _testConnection lib/features/models/model_cards_page.dart:337 — `_testConnection` calls `dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _saveAs lib/features/chat/widgets/markdown_view.dart:725 — `_saveAs` calls `Dio(…).get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _runTest lib/features/chat/widgets/new_workspace_dialog.dart:525 — `_runTest` calls `dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: check lib/core/update/update_checker.dart:70 — `check` calls `dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _searchTavily lib/core/search/search_service.dart:37 — `_searchTavily` calls `_dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _searchBrave lib/core/search/search_service.dart:77 — `_searchBrave` calls `_dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _searchBaidu lib/core/search/search_service.dart:111 — `_searchBaidu` calls `_dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _ensureUv lib/core/python/python_bootstrap.dart:172 — `_ensureUv` calls `dio.download(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _handleTestModel lib/core/online_service/online_server.dart:709 — `_handleTestModel` calls `dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: ensureCollection lib/core/memory/memory_manager.dart:117 — `ensureCollection` calls `_dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _embed lib/core/memory/memory_manager.dart:176 — `_embed` calls `_embeddingDio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _writePoint lib/core/memory/memory_manager.dart:301 — `_writePoint` calls `_dio.put(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _supersedeSimilar lib/core/memory/memory_manager.dart:335 — `_supersedeSimilar` calls `_dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: addKnowledgeChunks lib/core/memory/memory_manager.dart:400 — `addKnowledgeChunks` calls `_dio.put(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: _recallFromQdrant lib/core/memory/memory_manager.dart:506 — `_recallFromQdrant` calls `_dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: deletePoint lib/core/memory/memory_manager.dart:594 — `deletePoint` calls `_dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: deletePointsByField lib/core/memory/memory_manager.dart:611 — `deletePointsByField` calls `_dio.post(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: getVectorSize lib/core/memory/memory_manager.dart:636 — `getVectorSize` calls `_dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: deleteCollection lib/core/memory/memory_manager.dart:646 — `deleteCollection` calls `_dio.delete(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: getPointCount lib/core/memory/memory_manager.dart:661 — `getPointCount` calls `_dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • Function without a CancelToken: listCollections lib/core/memory/memory_manager.dart:672 — `listCollections` calls `_dio.get(…)` but takes no CancelToken and hands the request none its caller can reach, so its caller cannot cancel the request once it has started. Take `CancelToken? cancelToken` and pass it on as `cancelToken: cancelToken` — or, in a widget's State or a notifier, hold one and cancel it in `dispose`.
  • + 9 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×30
  • Swallowed exception (empty catch) lib/main.dart:31 — 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) lib/shared/layout/app_scaffold.dart:170 — 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) lib/shared/layout/app_scaffold.dart:180 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/providers/kb_provider.dart:331 — 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) lib/providers/memory_provider.dart:73 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) lib/providers/settings_provider.dart:613 — 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) lib/features/tools/siyu/siyu_editor.dart:160 — 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) lib/features/tools/flowchart/flowchart_editor.dart:531 — 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) lib/features/pet/widgets/floating_pet.dart:418 — 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) lib/features/pet/widgets/floating_pet.dart:427 — 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) lib/features/online_service/online_service_provider.dart:80 — 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) lib/features/multi_agent/widgets/agent_workspace.dart:484 — 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) lib/features/multi_agent/providers/multi_agent_provider.dart:210 — 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) lib/features/multi_agent/providers/multi_agent_provider.dart:279 — 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) lib/features/chat/chat_provider.dart:2253 — 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) lib/features/chat/chat_provider.dart:2274 — 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) lib/features/chat/widgets/markdown_view.dart:121 — 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) lib/features/chat/widgets/markdown_view.dart:378 — 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) lib/features/chat/widgets/markdown_view.dart:765 — 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) lib/features/chat/widgets/tool_call_card.dart: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) lib/features/chat/widgets/visualization_cards.dart:93 — 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) lib/core/utils/document_extractor.dart:159 — 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) lib/core/utils/document_extractor.dart:179 — 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) lib/core/utils/document_extractor.dart:182 — 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) lib/core/tts/tts_service.dart:353 — 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.
  • + 5 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×29
  • FileTooLong: chat/chat_page.dart lib/features/chat/chat_page.dart — FileTooLong — 2274 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1774 over it, 4.55× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: chat/chat_provider.dart lib/features/chat/chat_provider.dart — FileTooLong — 1555 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: ChatNotifier (311-2431). The bar is 500 significant lines; this is 1055 over it, 3.11× 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: mcp/mcp_page.dart lib/features/mcp/mcp_page.dart — FileTooLong — 1185 significant lines (blank, comment-only and punctuation-only lines excluded), about 66% of them inside a single declaration: _McpServerFormDialogState (453-1600). The bar is 500 significant lines; this is 685 over it, 2.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: toolshell/executor.dart lib/core/toolshell/executor.dart — FileTooLong — 1179 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: Executor (23-1775). The bar is 500 significant lines; this is 679 over it, 2.36× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: word_engine/writer.py assets/office_engine/word/word_engine/writer.py — FileTooLong — 969 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 469 over it, 1.94× 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: excel_engine/reader.py assets/office_engine/excel/excel_engine/reader.py — FileTooLong — 910 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 410 over it, 1.82× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: pet/pet_page.dart lib/features/pet/pet_page.dart — FileTooLong — 906 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: _PetPageState (23-1286). The bar is 500 significant lines; this is 406 over it, 1.81× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: agent/agent_context.dart lib/core/agent/agent_context.dart — FileTooLong — 823 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: AgentContextBuilder (171-1325). The bar is 500 significant lines; this is 323 over it, 1.65× 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: online_service/online_server.dart lib/core/online_service/online_server.dart — FileTooLong — 822 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: OnlineServer (24-1172). The bar is 500 significant lines; this is 322 over it, 1.64× 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/message_bubble.dart lib/features/chat/widgets/message_bubble.dart — FileTooLong — 807 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 307 over it, 1.61× 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: toolshell/budget.dart lib/core/toolshell/budget.dart — FileTooLong — 798 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 298 over it, 1.60× 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: transformers/context_compactor.dart lib/core/agent/transformers/context_compactor.dart — FileTooLong — 795 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: ContextCompactor (21-1574). The bar is 500 significant lines; this is 295 over it, 1.59× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: server/api_server.dart lib/core/server/api_server.dart — FileTooLong — 741 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: ApiServer (27-1098). The bar is 500 significant lines; this is 241 over it, 1.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: knowledge/knowledge_base_page.dart lib/features/knowledge/knowledge_base_page.dart — FileTooLong — 708 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 208 over it, 1.42× 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: providers/multi_agent_provider.dart lib/features/multi_agent/providers/multi_agent_provider.dart — FileTooLong — 695 significant lines (blank, comment-only and punctuation-only lines excluded), about 85% of them inside a single declaration: MultiAgentNotifier (112-1018). The bar is 500 significant lines; this is 195 over it, 1.39× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: toolshell/agent_loop.dart lib/core/toolshell/agent_loop.dart — FileTooLong — 690 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: AgentLoop (214-1200). 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: online_service/web_assets.dart lib/core/online_service/web_assets.dart — FileTooLong — 683 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: WebAssets (3-828). The bar is 500 significant lines; this is 183 over it, 1.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: flowchart/flowchart_editor.dart lib/features/tools/flowchart/flowchart_editor.dart — FileTooLong — 682 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: _FlowchartEditorPageState (38-767). The bar is 500 significant lines; this is 182 over it, 1.36× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: image/image_agent_service.dart lib/core/image/image_agent_service.dart — FileTooLong — 676 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: ImageAgentService (80-998). The bar is 500 significant lines; this is 176 over it, 1.35× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: word_engine/reader.py assets/office_engine/word/word_engine/reader.py — FileTooLong — 660 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 160 over it, 1.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: paddle_ocr/paddle_ocr_tool.dart lib/features/tools/paddle_ocr/paddle_ocr_tool.dart — FileTooLong — 657 significant lines (blank, comment-only and punctuation-only lines excluded), about 65% of them inside a single declaration: _PaddleOcrUIState (120-744). The bar is 500 significant lines; this is 157 over it, 1.31× 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/markdown_view.dart lib/features/chat/widgets/markdown_view.dart — FileTooLong — 637 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 137 over it, 1.27× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: vpl/vpl_editor.dart lib/features/tools/vpl/vpl_editor.dart — FileTooLong — 624 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: _VplEditorPageState (24-745). The bar is 500 significant lines; this is 124 over it, 1.25× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: llm/llm_client.dart lib/core/llm/llm_client.dart — FileTooLong — 612 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 112 over it, 1.22× 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: models/model_cards_page.dart lib/features/models/model_cards_page.dart — FileTooLong — 595 significant lines (blank, comment-only and punctuation-only lines excluded), about 69% of them inside a single declaration: _ModelCardDialogState (260-833). The bar is 500 significant lines; this is 95 over it, 1.19× 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.
  • + 4 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×21
  • ClassTooLong: ChatNotifier lib/features/chat/chat_provider.dart:310 — ClassTooLong — 1329 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 929 over it, 3.32× 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: Executor lib/core/toolshell/executor.dart:19 — ClassTooLong — 1154 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 754 over it, 2.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: _PetPageState lib/features/pet/pet_page.dart:23 — ClassTooLong — 890 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 490 over it, 2.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ContextCompactor lib/core/agent/transformers/context_compactor.dart:11 — ClassTooLong — 787 significant lines (blank, comment-only and punctuation-only lines excluded), 33 methods. The bar is 400 significant lines; this is 387 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _McpServerFormDialogState lib/features/mcp/mcp_page.dart:453 — ClassTooLong — 781 significant lines (blank, comment-only and punctuation-only lines excluded), 28 methods. The bar is 400 significant lines; this is 381 over it, 1.95× 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: OnlineServer lib/core/online_service/online_server.dart:23 — ClassTooLong — 778 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 378 over it, 1.95× 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: ApiServer lib/core/server/api_server.dart:18 — ClassTooLong — 727 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 327 over it, 1.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: AgentContextBuilder lib/core/agent/agent_context.dart:167 — ClassTooLong — 700 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 300 over it, 1.75× 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: WebAssets lib/core/online_service/web_assets.dart:1 — ClassTooLong — 683 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 283 over it, 1.71× 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: ImageAgentService lib/core/image/image_agent_service.dart:70 — ClassTooLong — 637 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 237 over it, 1.59× 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: MultiAgentNotifier lib/features/multi_agent/providers/multi_agent_provider.dart:111 — ClassTooLong — 593 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 193 over it, 1.48× 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: AgentLoop lib/core/toolshell/agent_loop.dart:209 — ClassTooLong — 577 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 177 over it, 1.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _ApiServerCardState lib/features/settings/widgets/api_server_section.dart:51 — ClassTooLong — 544 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 144 over it, 1.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _VplEditorPageState lib/features/tools/vpl/vpl_editor.dart:24 — ClassTooLong — 518 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 118 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: _FlowchartEditorPageState lib/features/tools/flowchart/flowchart_editor.dart:38 — ClassTooLong — 515 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 115 over it, 1.29× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: VplCodeGenerator lib/features/tools/vpl/vpl_code_gen.dart:5 — ClassTooLong — 480 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 80 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WorktreeManager lib/core/toolshell/worktree_manager.dart:5 — ClassTooLong — 448 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 48 over it, 1.12× 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: _PaddleOcrUIState lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:120 — ClassTooLong — 425 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 25 over it, 1.06× 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: MemoryManager lib/core/memory/memory_manager.dart:30 — ClassTooLong — 415 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 15 over it, 1.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: _ModelCardDialogState lib/features/models/model_cards_page.dart:260 — ClassTooLong — 409 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 9 over it, 1.02× 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: _NewWorkspaceDialogState lib/features/chat/widgets/new_workspace_dialog.dart:37 — ClassTooLong — 405 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 5 over it, 1.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×10
  • Swallowed exception (caught, then discarded) packages/highlight/lib/src/mode_compiler.dart:54 — `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) lib/providers/memory_provider.dart:94 — `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) lib/features/toolchain/toolchain_page.dart:203 — `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) lib/features/settings/widgets/font_section.dart:36 — `catch (e)` 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) lib/features/multi_agent/providers/multi_agent_provider.dart:215 — `catch (e)` 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) lib/features/multi_agent/providers/multi_agent_provider.dart:934 — `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) lib/features/chat/widgets/message_attachments.dart:272 — `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) lib/features/chat/widgets/tool_call_card.dart:282 — `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) lib/core/toolshell/android_executor.dart:538 — `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) lib/core/toolshell/background_jobs.dart:176 — `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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×8
  • Duplicated block (11 lines × 2) lib/core/image/image_agent_service.dart:548 — lib/core/image/image_agent_service.dart:548-558 | lib/core/image/image_agent_service.dart:603-613 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/image/image_agent_service.dart:548` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/core/python/python_bootstrap.dart:94 — lib/core/python/python_bootstrap.dart:94-104 | lib/core/python/python_bootstrap.dart:106-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) lib/core/server/api_server.dart:300 — lib/core/server/api_server.dart:300-310 | lib/core/server/api_server.dart:539-549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/server/api_server.dart:300` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) lib/features/chat/widgets/new_workspace_dialog.dart:71 — lib/features/chat/widgets/new_workspace_dialog.dart:71-82 | lib/features/multi_agent/widgets/create_agent_dialog.dart:67-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/widgets/new_workspace_dialog.dart:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) lib/features/settings/settings_page.dart:248 — lib/features/settings/settings_page.dart:248-258 | lib/features/settings/settings_page.dart:464-474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/settings/settings_page.dart:248` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) lib/features/settings/widgets/embedding_editor_dialog.dart:58 — lib/features/settings/widgets/embedding_editor_dialog.dart:58-68 | lib/features/settings/widgets/embedding_editor_dialog.dart:140-150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) lib/shared/widgets/region_screenshot.dart:190 — lib/shared/widgets/region_screenshot.dart:190-200 | lib/shared/widgets/screenshot_editor.dart:529-539 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/shared/widgets/region_screenshot.dart:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) assets/office_engine/excel/excel_engine/protocol.py:29 — assets/office_engine/excel/excel_engine/protocol.py:29-39 | assets/office_engine/word/word_engine/protocol.py:39-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×8
  • Duplicated block (10 lines × 2) lib/features/chat/chat_page.dart:1160 — lib/features/chat/chat_page.dart:1160-1169 | lib/features/chat/chat_page.dart:1371-1380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/chat_page.dart:1160` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/features/chat/chat_page.dart:1382` calls `watch` and `lib/features/chat/chat_page.dart:1171` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) lib/features/chat/chat_page.dart:2107 — lib/features/chat/chat_page.dart:2107-2116 | lib/features/chat/chat_page.dart:2794-2803 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/chat_page.dart:2107` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) lib/features/chat/chat_page.dart:3048 — lib/features/chat/chat_page.dart:3048-3057 | lib/features/chat/widgets/message_bubble.dart:625-634 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/chat_page.dart:3048` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/features/models/model_cards_page.dart:739 — lib/features/models/model_cards_page.dart:739-748 | lib/features/models/model_cards_page.dart:773-782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/models/model_cards_page.dart:739` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) lib/features/tools/flowchart/flowchart_editor.dart:470 — lib/features/tools/flowchart/flowchart_editor.dart:470-479 | lib/features/tools/siyu/siyu_editor.dart:365-374 — `lib/features/tools/flowchart/flowchart_editor.dart` and `lib/features/tools/siyu/siyu_editor.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 37 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/flowchart/flowchart_editor.dart:470` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) lib/features/tools/formula_ocr/formula_ocr_tool.dart:603 — lib/features/tools/formula_ocr/formula_ocr_tool.dart:603-612 | lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:938-947 — `lib/features/tools/formula_ocr/formula_ocr_tool.dart` and `lib/features/tools/paddle_ocr/paddle_ocr_tool.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 176 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/formula_ocr/formula_ocr_tool.dart:603` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) lib/features/knowledge/knowledge_base_page.dart:78 — lib/features/knowledge/knowledge_base_page.dart:78-87 | lib/features/settings/widgets/embedding_section.dart:59-68 — before extracting anything, compare `lib/features/knowledge/knowledge_base_page.dart` and `lib/features/settings/widgets/embedding_section.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (10 lines × 2) assets/office_engine/excel/excel_engine/utils.py:108 — assets/office_engine/excel/excel_engine/utils.py:108-117 | assets/office_engine/word/word_engine/utils.py:140-155 — before extracting anything, compare `assets/office_engine/excel/excel_engine/utils.py` and `assets/office_engine/word/word_engine/utils.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, 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 (8 lines × 2) · ×8
  • Duplicated block (8 lines × 2) lib/features/experts/experts_page.dart:37 — lib/features/experts/experts_page.dart:37-44 | lib/features/memory/memory_page.dart:22-29 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/experts/experts_page.dart:37` it begins part-way through the construct above it, so those exact lines 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) lib/features/multi_agent/widgets/agent_badge_dialog.dart:43 — lib/features/multi_agent/widgets/agent_badge_dialog.dart:43-50 | lib/features/multi_agent/widgets/create_agent_dialog.dart:65-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/multi_agent/widgets/agent_badge_dialog.dart:43` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) lib/features/settings/widgets/embedding_section.dart:125 — lib/features/settings/widgets/embedding_section.dart:125-133 | lib/features/skills/skills_page.dart:601-608 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/settings/widgets/embedding_section.dart:125` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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) lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:228 — lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:228-236 | lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:840-847 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:228` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) lib/core/mcp/transports/sse_transport.dart:254 — lib/core/mcp/transports/sse_transport.dart:254-261 | lib/core/mcp/transports/streamable_http_transport.dart:247-254 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) lib/features/tools/formula_ocr/formula_ocr_tool.dart:473 — lib/features/tools/formula_ocr/formula_ocr_tool.dart:473-480 | lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:377-384 — `lib/features/tools/formula_ocr/formula_ocr_tool.dart` and `lib/features/tools/paddle_ocr/paddle_ocr_tool.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 176 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (8 lines × 2) assets/office_engine/excel/excel_engine/utils.py:69 — assets/office_engine/excel/excel_engine/utils.py:69-76 | assets/office_engine/word/word_engine/utils.py:76-83 — before extracting anything, compare `assets/office_engine/excel/excel_engine/utils.py` and `assets/office_engine/word/word_engine/utils.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) assets/office_engine/word/word_engine/reader.py:477 — assets/office_engine/word/word_engine/reader.py:477-484 | assets/office_engine/word/word_engine/writer.py:849-856 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×7
  • Duplicated block (9 lines × 2) lib/core/llm/anthropic_sdk_client.dart:229 — lib/core/llm/anthropic_sdk_client.dart:229-237 | lib/core/llm/anthropic_sdk_client.dart:286-294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/llm/anthropic_sdk_client.dart:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/core/llm/anthropic_sdk_client.dart:228` calls `_parseResponse` and `lib/core/llm/anthropic_sdk_client.dart:286` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) lib/core/toolshell/executor.dart:281 — lib/core/toolshell/executor.dart:281-289 | lib/core/toolshell/executor.dart:328-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) lib/features/mcp/mcp_page.dart:324 — lib/features/mcp/mcp_page.dart:324-333 | lib/features/skills/skills_page.dart:65-73 — `lib/features/mcp/mcp_page.dart` and `lib/features/skills/skills_page.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/mcp/mcp_page.dart:324` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) lib/features/settings/settings_page.dart:578 — lib/features/settings/settings_page.dart:578-586 | lib/features/settings/settings_page.dart:622-630 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/settings/settings_page.dart:578` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) lib/features/settings/widgets/api_server_section.dart:565 — lib/features/settings/widgets/api_server_section.dart:565-573 | lib/features/settings/widgets/api_server_section.dart:615-623 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/settings/widgets/api_server_section.dart:565` it does not close everything it opens, so those exact lines 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) assets/office_engine/excel/excel_engine/reader.py:357 — assets/office_engine/excel/excel_engine/reader.py:357-365 | assets/office_engine/excel/excel_engine/reader.py:386-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) assets/office_engine/excel/excel_engine/reader.py:1026 — assets/office_engine/excel/excel_engine/reader.py:1026-1034 | assets/office_engine/word/word_engine/writer.py:1061-1069 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `assets/office_engine/word/word_engine/writer.py:1057` calls `rmtree` and `assets/office_engine/excel/excel_engine/reader.py:1022` 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.
D3 · God Classes · TooManyMethods · ×6
  • TooManyMethods: ChatNotifier lib/features/chat/chat_provider.dart:310 — TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OnlineServer lib/core/online_service/online_server.dart:23 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Executor lib/core/toolshell/executor.dart:19 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ImageAgentService lib/core/image/image_agent_service.dart:70 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ContextCompactor lib/core/agent/transformers/context_compactor.dart:11 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ToolProgressTracker lib/core/toolshell/budget.dart:665 — 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.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×6
  • Duplicated block (7 lines × 2) lib/features/multi_agent/widgets/agent_chat_panel.dart:91 — lib/features/multi_agent/widgets/agent_chat_panel.dart:91-97 | lib/features/multi_agent/widgets/command_center.dart:55-61 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/multi_agent/widgets/agent_chat_panel.dart:91` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) lib/features/tools/formula_ocr/formula_ocr_tool.dart:99 — lib/features/tools/formula_ocr/formula_ocr_tool.dart:99-105 | lib/features/tools/image_gen/image_gen_tool.dart:153-159 — `lib/features/tools/formula_ocr/formula_ocr_tool.dart` and `lib/features/tools/image_gen/image_gen_tool.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/formula_ocr/formula_ocr_tool.dart:99` it begins part-way through the construct above it, so those 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) lib/core/db/daos/kb_dao.dart:15 — lib/core/db/daos/kb_dao.dart:15-21 | lib/core/db/daos/model_cards_dao.dart:11-17 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) assets/office_engine/word/word_engine/writer.py:313 — assets/office_engine/word/word_engine/writer.py:313-319 | assets/office_engine/word/word_engine/writer.py:326-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) assets/office_engine/excel/excel_engine/reader.py:239 — assets/office_engine/excel/excel_engine/reader.py:239-245 | assets/office_engine/excel/excel_engine/reader.py:563-569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) assets/office_engine/excel/excel_engine/utils.py:80 — assets/office_engine/excel/excel_engine/utils.py:80-86 | assets/office_engine/word/word_engine/utils.py:87-93 — before extracting anything, compare `assets/office_engine/excel/excel_engine/utils.py` and `assets/office_engine/word/word_engine/utils.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×5
  • Edited copy of a member (10 corresponding lines) assets/office_engine/excel/excel_engine/utils.py:56 — assets/office_engine/excel/excel_engine/utils.py:56-65 | assets/office_engine/word/word_engine/utils.py:60-71 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/core/online_service/online_session.dart:23 — lib/core/online_service/online_session.dart:23-32 | lib/core/settings/app_settings.dart:66-76 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/core/image/image_agent_service.dart:784 — lib/core/image/image_agent_service.dart:784-798 | lib/core/image/image_agent_service.dart:800-809 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) assets/office_engine/word/word_engine/writer.py:313 — assets/office_engine/word/word_engine/writer.py:313-322 | assets/office_engine/word/word_engine/writer.py:326-335 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) lib/features/tools/image_gen/image_gen_tool.dart:612 — lib/features/tools/image_gen/image_gen_tool.dart:612-621 | lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:794-803 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×5
  • Duplicated block (15 lines × 2) lib/core/mcp/transports/sse_transport.dart:231 — lib/core/mcp/transports/sse_transport.dart:231-245 | lib/core/mcp/transports/stdio_transport.dart:183-197 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/mcp/transports/sse_transport.dart:231` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) lib/features/online_service/online_service_page.dart:166 — lib/features/online_service/online_service_page.dart:166-180 | lib/features/online_service/online_service_page.dart:277-291 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/online_service/online_service_page.dart:166` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) lib/features/tools/flowchart/flowchart_editor.dart:250 — lib/features/tools/flowchart/flowchart_editor.dart:250-264 | lib/features/tools/vpl/vpl_editor.dart:155-169 — `lib/features/tools/flowchart/flowchart_editor.dart` and `lib/features/tools/vpl/vpl_editor.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 36 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/flowchart/flowchart_editor.dart:250` 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 (15 lines × 2) lib/features/tools/formula_ocr/formula_ocr_tool.dart:148 — lib/features/tools/formula_ocr/formula_ocr_tool.dart:148-162 | lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:293-307 — `lib/features/tools/formula_ocr/formula_ocr_tool.dart` and `lib/features/tools/paddle_ocr/paddle_ocr_tool.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 176 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) assets/office_engine/excel/excel_engine/utils.py:90 — assets/office_engine/excel/excel_engine/utils.py:90-104 | assets/office_engine/word/word_engine/utils.py:122-136 — before extracting anything, compare `assets/office_engine/excel/excel_engine/utils.py` and `assets/office_engine/word/word_engine/utils.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×5
  • Duplicated block (13 lines × 2) lib/core/llm/anthropic_client.dart:556 — lib/core/llm/anthropic_client.dart:556-568 | lib/core/llm/anthropic_sdk_client.dart:376-388 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/llm/anthropic_client.dart:556` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/features/pet/pet_page.dart:798 — lib/features/pet/pet_page.dart:798-810 | lib/features/pet/pet_page.dart:864-876 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/pet/pet_page.dart:798` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/features/settings/widgets/update_dialog.dart:144 — lib/features/settings/widgets/update_dialog.dart:144-156 | lib/features/settings/widgets/update_dialog.dart:327-339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/settings/widgets/update_dialog.dart:144` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) lib/features/tools/formula_ocr/formula_ocr_tool.dart:290 — lib/features/tools/formula_ocr/formula_ocr_tool.dart:290-302 | lib/features/tools/image_gen/image_gen_tool.dart:264-276 — `lib/features/tools/formula_ocr/formula_ocr_tool.dart` and `lib/features/tools/image_gen/image_gen_tool.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/formula_ocr/formula_ocr_tool.dart:290` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13 lines × 2) lib/features/tools/vpl/vpl_code_gen.dart:210 — lib/features/tools/vpl/vpl_code_gen.dart:210-222 | lib/features/tools/vpl/vpl_code_gen.dart:549-561 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/vpl/vpl_code_gen.dart:210` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 · Edited copy of a member (9 corresponding lines) · ×4
  • Edited copy of a member (9 corresponding lines) lib/core/settings/app_settings.dart:348 — lib/core/settings/app_settings.dart:348-358 | lib/providers/search_provider.dart:76-84 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) assets/office_engine/excel/excel_engine/protocol.py:73 — assets/office_engine/excel/excel_engine/protocol.py:73-81 | assets/office_engine/word/word_engine/protocol.py:91-100 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/features/tools/vpl/vpl_editor.dart:452 — lib/features/tools/vpl/vpl_editor.dart:452-462 | lib/features/tools/flowchart/flowchart_editor.dart:313-321 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) lib/core/online_service/online_session.dart:34 — lib/core/online_service/online_session.dart:34-42 | lib/core/settings/app_settings.dart:56-64 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×4
  • Duplicated block (6 lines × 2) lib/features/mcp/mcp_page.dart:73 — lib/features/mcp/mcp_page.dart:73-78 | lib/features/skills/skills_page.dart:118-123 — `lib/features/mcp/mcp_page.dart` and `lib/features/skills/skills_page.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/mcp/mcp_page.dart:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) lib/core/llm/anthropic_client.dart:37 — lib/core/llm/anthropic_client.dart:37-42 | lib/core/llm/anthropic_sdk_client.dart:41-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) lib/features/tools/flowchart/flowchart_editor.dart:364 — lib/features/tools/flowchart/flowchart_editor.dart:364-369 | lib/features/tools/siyu/siyu_editor.dart:225-230 — `lib/features/tools/flowchart/flowchart_editor.dart` and `lib/features/tools/siyu/siyu_editor.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 37 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) lib/features/tools/image_gen/image_gen_tool.dart:630 — lib/features/tools/image_gen/image_gen_tool.dart:630-635 | lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:812-817 — `lib/features/tools/image_gen/image_gen_tool.dart` and `lib/features/tools/paddle_ocr/paddle_ocr_tool.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 34 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: agent_context.dart ↔ chat_page.dart lib/core/agent/agent_context.dart:1 — `lib/core/agent/agent_context.dart` and `lib/features/chat/chat_page.dart` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `dceaf40e` Version 1.0.5 is expected to be released.; `49bb518d` Version 1.0.4 is expected to be released.; `428caf47` Version 1.0.4 is expected to be released. — run `git show` on any of them.
  • Change coupling: chat_provider.dart ↔ model_cards_page.dart lib/features/chat/chat_provider.dart:1 — `lib/features/chat/chat_provider.dart` and `lib/features/models/model_cards_page.dart` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `ef0e0de3` Version 1.0.5 is expected to be released.; `4ffd1063` Version 1.0.5 is expected to be released.; `7805afa8` Version 1.0.5 is expected to be released. — run `git show` on any of them.
  • Change coupling: agent_context.dart ↔ model_cards_page.dart lib/core/agent/agent_context.dart:1 — `lib/core/agent/agent_context.dart` and `lib/features/models/model_cards_page.dart` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `13120f13` Version 1.0.5 is expected to be released.; `dceaf40e` Version 1.0.5 is expected to be released.; `49bb518d` Version 1.0.4 is expected to be released. — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×3
  • Edited copy of a member (17 corresponding lines) assets/office_engine/excel/excel_engine/protocol.py:53 — assets/office_engine/excel/excel_engine/protocol.py:53-69 | assets/office_engine/word/word_engine/protocol.py:63-87 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) lib/core/llm/anthropic_client.dart:552 — lib/core/llm/anthropic_client.dart:552-568 | lib/core/llm/anthropic_sdk_client.dart:372-388 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) assets/office_engine/excel/excel_engine/cli.py:22 — assets/office_engine/excel/excel_engine/cli.py:22-38 | assets/office_engine/word/word_engine/cli.py:23-51 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×3
  • Edited copy of a member (12 corresponding lines) lib/features/chat/chat_page.dart:3048 — lib/features/chat/chat_page.dart:3048-3059 | lib/features/chat/widgets/message_bubble.dart:625-637 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/core/mcp/transports/sse_transport.dart:160 — lib/core/mcp/transports/sse_transport.dart:160-171 | lib/core/mcp/transports/streamable_http_transport.dart:115-130 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) lib/features/mcp/mcp_page.dart:16 — lib/features/mcp/mcp_page.dart:16-27 | lib/features/skills/skills_page.dart:16-27 — 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 (8 corresponding lines) · ×3
  • Edited copy of a member (8 corresponding lines) lib/features/chat/chat_page.dart:618 — lib/features/chat/chat_page.dart:618-625 | lib/features/chat/widgets/markdown_view.dart:247-254 — 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) assets/office_engine/excel/excel_engine/utils.py:69 — assets/office_engine/excel/excel_engine/utils.py:69-76 | assets/office_engine/word/word_engine/utils.py:75-83 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) lib/features/chat/chat_page.dart:3071 — lib/features/chat/chat_page.dart:3071-3078 | lib/features/chat/widgets/message_bubble.dart:652-660 — 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 (4 corresponding lines) · ×3
  • Edited copy of a member (4 corresponding lines) assets/office_engine/excel/excel_engine/utils.py:49 — assets/office_engine/excel/excel_engine/utils.py:49-52 | assets/office_engine/word/word_engine/utils.py:53-56 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) lib/core/db/daos/kb_dao.dart:247 — lib/core/db/daos/kb_dao.dart:247-250 | lib/core/db/daos/model_cards_dao.dart:120-123 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) lib/core/server/api_server_config.dart:194 — lib/core/server/api_server_config.dart:194-197 | lib/core/settings/app_settings.dart:288-291 — 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 (22 lines × 2) · ×3
  • Duplicated block (22 lines × 2) lib/core/server/api_server.dart:500 — lib/core/server/api_server.dart:500-521 | lib/core/server/api_server.dart:754-775 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (22 lines × 2) lib/features/chat/chat_provider.dart:1844 — lib/features/chat/chat_provider.dart:1844-1865 | lib/features/chat/chat_provider.dart:1916-1937 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `lib/features/chat/chat_provider.dart:1842` calls `log` and `lib/features/chat/chat_provider.dart:1914` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (22 lines × 2) assets/office_engine/word/word_engine/reader.py:169 — assets/office_engine/word/word_engine/reader.py:169-190 | assets/office_engine/word/word_engine/reader.py:214-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 × 2) · ×3
  • Duplicated block (14 lines × 2) lib/features/chat/widgets/message_bubble.dart:426 — lib/features/chat/widgets/message_bubble.dart:426-439 | lib/features/chat/widgets/message_bubble.dart:529-542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/widgets/message_bubble.dart:426` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (14 lines × 2) lib/features/knowledge/knowledge_base_page.dart:110 — lib/features/knowledge/knowledge_base_page.dart:110-123 | lib/features/knowledge/knowledge_base_page.dart:985-998 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/knowledge/knowledge_base_page.dart:110` 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) packages/dock_panel/lib/main.dart:543 — packages/dock_panel/lib/main.dart:543-556 | packages/dock_panel/lib/main.dart:561-574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `packages/dock_panel/lib/main.dart:543` 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 lines × 2) · ×3
  • Duplicated block (12 lines × 2) lib/core/toolshell/executor.dart:1055 — lib/core/toolshell/executor.dart:1055-1066 | lib/core/toolshell/executor.dart:1416-1427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) lib/features/chat/widgets/markdown_view.dart:368 — lib/features/chat/widgets/markdown_view.dart:368-379 | lib/features/chat/widgets/visualization_cards.dart:83-94 — before extracting anything, compare `lib/features/chat/widgets/markdown_view.dart` and `lib/features/chat/widgets/visualization_cards.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (12 lines × 2) lib/features/memory/memory_page.dart:128 — lib/features/memory/memory_page.dart:128-139 | lib/features/settings/widgets/embedding_section.dart:80-91 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/memory/memory_page.dart:128` 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 (5 lines × 2) · ×3
  • Duplicated block (5 lines × 2) lib/features/tools/vpl/vpl_code_gen.dart:151 — lib/features/tools/vpl/vpl_code_gen.dart:151-156 | lib/features/tools/vpl/vpl_code_gen.dart:492-496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/vpl/vpl_code_gen.dart:492` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) assets/office_engine/excel/excel_engine/utils.py:56 — assets/office_engine/excel/excel_engine/utils.py:56-60 | assets/office_engine/word/word_engine/utils.py:61-65 — before extracting anything, compare `assets/office_engine/excel/excel_engine/utils.py` and `assets/office_engine/word/word_engine/utils.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `fallback` to `str = "sheet"` in one and `str = "file"` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) assets/office_engine/excel/excel_engine/utils.py:27 — assets/office_engine/excel/excel_engine/utils.py:27-31 | assets/office_engine/word/word_engine/utils.py:31-35 — before extracting anything, compare `assets/office_engine/excel/excel_engine/utils.py` and `assets/office_engine/word/word_engine/utils.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
D2 · Cognitive Complexity · cli.main (cognitive 16) · ×2
  • cli.main (cognitive 16) assets/office_engine/excel/excel_engine/cli.py:41 — cli.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 3 (4 pts), boolean chains 1, loops 1, ternaries 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.
  • cli.main (cognitive 16) assets/office_engine/word/word_engine/cli.py:54 — cli.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 3 (4 pts), boolean chains 1, loops 1, ternaries 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.
D31 · IaC & Container Security · Medium IaC · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/features/chat/widgets/markdown_view.dart:387 — lib/features/chat/widgets/markdown_view.dart:387-451 | lib/features/chat/widgets/markdown_view.dart:510-559 | lib/features/chat/widgets/visualization_cards.dart:120-243 | lib/features/chat/widgets/visualization_cards.dart:332-450 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) lib/features/chat/widgets/visualization_cards.dart:120 — lib/features/chat/widgets/visualization_cards.dart:120-243 | lib/features/chat/widgets/visualization_cards.dart:332-450 | lib/features/chat/widgets/visualization_cards.dart:478-584 | lib/features/chat/widgets/visualization_cards.dart:643-729 — 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 (52 corresponding lines) · ×2
  • Edited copy of a member (52 corresponding lines) lib/shared/widgets/screenshot_editor.dart:423 — lib/shared/widgets/screenshot_editor.dart:423-493 | lib/shared/widgets/screenshot_editor.dart:552-603 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (52 corresponding lines) lib/features/online_service/online_service_page.dart:277 — lib/features/online_service/online_service_page.dart:277-328 | lib/features/online_service/online_service_page.dart:396-448 — These two members are one piece of code written twice and then edited apart: 52 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (39 corresponding lines) · ×2
  • Edited copy of a member (39 corresponding lines) lib/features/settings/widgets/api_server_section.dart:543 — lib/features/settings/widgets/api_server_section.dart:543-581 | lib/features/settings/widgets/api_server_section.dart:584-631 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (39 corresponding lines) lib/features/tools/flowchart/flowchart_editor.dart:373 — lib/features/tools/flowchart/flowchart_editor.dart:373-414 | lib/features/tools/vpl/vpl_editor.dart:466-504 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×2
  • Edited copy of a member (34 corresponding lines) lib/features/tools/flowchart/flowchart_editor.dart:416 — lib/features/tools/flowchart/flowchart_editor.dart:416-454 | lib/features/tools/vpl/vpl_editor.dart:506-539 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (34 corresponding lines) lib/features/chat/widgets/markdown_view.dart:273 — lib/features/chat/widgets/markdown_view.dart:273-309 | lib/features/chat/widgets/message_bubble.dart:343-376 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×2
  • Edited copy of a member (27 corresponding lines) lib/features/tools/flowchart/flowchart_editor.dart:245 — lib/features/tools/flowchart/flowchart_editor.dart:245-271 | lib/features/tools/vpl/vpl_editor.dart:150-176 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (27 corresponding lines) lib/features/models/model_card_tile_optimized.dart:185 — lib/features/models/model_card_tile_optimized.dart:185-215 | lib/features/settings/widgets/embedding_section.dart:215-241 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (36 corresponding lines) · ×2
  • Edited copy of a member (36 corresponding lines) lib/core/llm/anthropic_sdk_client.dart:209 — lib/core/llm/anthropic_sdk_client.dart:209-244 | lib/core/llm/anthropic_sdk_client.dart:267-304 — 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.
  • Edited copy of a member (36 corresponding lines) lib/features/chat/widgets/markdown_view.dart:918 — lib/features/chat/widgets/markdown_view.dart:918-953 | lib/features/pet/widgets/pet_bubble.dart:194-233 — 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 copy of a member (18 corresponding lines) · ×2
  • Edited copy of a member (18 corresponding lines) lib/core/mcp/transports/sse_transport.dart:226 — lib/core/mcp/transports/sse_transport.dart:226-245 | lib/core/mcp/transports/stdio_transport.dart:180-197 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) lib/features/tools/formula_ocr/formula_ocr_tool.dart:95 — lib/features/tools/formula_ocr/formula_ocr_tool.dart:95-112 | lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:144-161 — 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 (15 corresponding lines) · ×2
  • Edited copy of a member (15 corresponding lines) lib/features/chat/chat_page.dart:1143 — lib/features/chat/chat_page.dart:1143-1157 | lib/features/chat/chat_page.dart:1353-1368 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) lib/features/tools/flowchart/flowchart_editor.dart:188 — lib/features/tools/flowchart/flowchart_editor.dart:188-202 | lib/features/tools/vpl/vpl_editor.dart:117-131 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×2
  • Edited copy of a member (19 corresponding lines) lib/core/llm/anthropic_client.dart:262 — lib/core/llm/anthropic_client.dart:262-280 | lib/core/llm/gemini_client.dart:267-287 — 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) lib/core/db/tables/knowledge_base.dart:61 — lib/core/db/tables/knowledge_base.dart:61-80 | lib/core/settings/app_settings.dart:36-54 — 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 (13 corresponding lines) · ×2
  • Edited copy of a member (13 corresponding lines) lib/features/chat/widgets/chat_scroll_nav.dart:50 — lib/features/chat/widgets/chat_scroll_nav.dart:50-62 | lib/features/chat/widgets/chat_scroll_nav.dart:64-76 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) lib/core/toolshell/worktree_manager.dart:509 — lib/core/toolshell/worktree_manager.dart:509-521 | lib/core/toolshell/worktree_manager.dart:523-538 — 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 copy of a member (7 corresponding lines) · ×2
  • Edited copy of a member (7 corresponding lines) lib/core/llm/context_capacity.dart:82 — lib/core/llm/context_capacity.dart:82-88 | lib/core/llm/gemini_client.dart:62-72 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) lib/core/pet/pet_sprite.dart:62 — lib/core/pet/pet_sprite.dart:62-71 | lib/core/online_service/online_service_config.dart:104-110 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (22–23 lines × 2) · ×2
  • Duplicated block (22–23 lines × 2) lib/features/knowledge/knowledge_base_page.dart:229 — lib/features/knowledge/knowledge_base_page.dart:229-251 | lib/features/settings/widgets/embedding_section.dart:192-213 — before extracting anything, compare `lib/features/knowledge/knowledge_base_page.dart` and `lib/features/settings/widgets/embedding_section.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/knowledge/knowledge_base_page.dart:229` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (22–23 lines × 2) lib/features/tools/formula_ocr/formula_ocr_tool.dart:421 — lib/features/tools/formula_ocr/formula_ocr_tool.dart:421-443 | lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:688-709 — `lib/features/tools/formula_ocr/formula_ocr_tool.dart` and `lib/features/tools/paddle_ocr/paddle_ocr_tool.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 176 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/formula_ocr/formula_ocr_tool.dart:421` it begins part-way through the construct above it, so those 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 × 2) · ×2
  • Duplicated block (18 lines × 2) lib/features/chat/widgets/markdown_view.dart:889 — lib/features/chat/widgets/markdown_view.dart:889-906 | lib/features/chat/widgets/message_attachments.dart:144-161 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/widgets/markdown_view.dart:889` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) assets/office_engine/excel/excel_engine/cli.py:72 — assets/office_engine/excel/excel_engine/cli.py:72-89 | assets/office_engine/word/word_engine/cli.py:95-112 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `assets/office_engine/excel/excel_engine/cli.py:72` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×2
  • Duplicated block (16 lines × 2) lib/features/skills/skills_page.dart:513 — lib/features/skills/skills_page.dart:513-528 | lib/features/toolchain/toolchain_page.dart:439-454 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/skills/skills_page.dart:513` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16 lines × 2) assets/office_engine/excel/excel_engine/reader.py:329 — assets/office_engine/excel/excel_engine/reader.py:329-344 | assets/office_engine/excel/excel_engine/reader.py:642-657 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `assets/office_engine/excel/excel_engine/reader.py:329` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 3) · ×2
  • Duplicated block (14–15 lines × 3) lib/features/tools/vpl/vpl_code_gen.dart:157 — lib/features/tools/vpl/vpl_code_gen.dart:157-171 | lib/features/tools/vpl/vpl_code_gen.dart:194-208 | lib/features/tools/vpl/vpl_code_gen.dart:223-236 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/vpl/vpl_code_gen.dart:157` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/features/tools/vpl/vpl_code_gen.dart:172` calls `writeln` and `lib/features/tools/vpl/vpl_code_gen.dart:209` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14–15 lines × 3) lib/features/tools/vpl/vpl_code_gen.dart:496 — lib/features/tools/vpl/vpl_code_gen.dart:496-509 | lib/features/tools/vpl/vpl_code_gen.dart:533-547 | lib/features/tools/vpl/vpl_code_gen.dart:561-574 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/vpl/vpl_code_gen.dart:496` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/features/tools/vpl/vpl_code_gen.dart:510` calls `writeln` and `lib/features/tools/vpl/vpl_code_gen.dart:548` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) lib/core/llm/anthropic_client.dart:328 — lib/core/llm/anthropic_client.dart:328-341 | lib/core/llm/gemini_client.dart:309-321 — before extracting anything, compare `lib/core/llm/anthropic_client.dart` and `lib/core/llm/gemini_client.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/llm/anthropic_client.dart:328` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (13–14 lines × 2) lib/core/office/office_engine.dart:94 — lib/core/office/office_engine.dart:94-107 | lib/core/python/python_bootstrap.dart:293-305 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/office/office_engine.dart:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×2
  • Duplicated block (10 lines × 3) lib/core/toolshell/schedule_executor.dart:175 — lib/core/toolshell/schedule_executor.dart:175-184 | lib/core/toolshell/schedule_executor.dart:244-253 | lib/core/toolshell/schedule_executor.dart:331-340 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 3) lib/features/settings/widgets/font_section.dart:154 — lib/features/settings/widgets/font_section.dart:154-163 | lib/features/settings/widgets/font_section.dart:262-271 | lib/features/settings/widgets/font_section.dart:346-355 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/settings/widgets/font_section.dart:154` it does not close everything it opens, so those 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 (9 lines × 3) · ×2
  • Duplicated block (9 lines × 3) lib/features/chat/chat_page.dart:1161 — lib/features/chat/chat_page.dart:1161-1169 | lib/features/chat/chat_page.dart:1372-1380 | lib/features/chat/chat_page.dart:2249-2258 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/chat_page.dart:1161` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/features/chat/chat_page.dart:1382` calls `watch` and `lib/features/chat/chat_page.dart:1171` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 3) lib/features/tools/flowchart/flowchart_editor.dart:471 — lib/features/tools/flowchart/flowchart_editor.dart:471-479 | lib/features/tools/siyu/siyu_editor.dart:366-374 | lib/features/tools/vpl/vpl_editor.dart:560-568 — `lib/features/tools/flowchart/flowchart_editor.dart` and `lib/features/tools/siyu/siyu_editor.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 37 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/flowchart/flowchart_editor.dart:471` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×2
  • Duplicated block (8–9 lines × 2) lib/core/server/api_server.dart:283 — lib/core/server/api_server.dart:283-290 | lib/core/server/api_server.dart:519-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/server/api_server.dart:283` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8–9 lines × 2) lib/core/toolshell/schedule_executor.dart:134 — lib/core/toolshell/schedule_executor.dart:134-142 | lib/core/toolshell/schedule_executor.dart:293-300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) lib/features/tools/formula_ocr/formula_ocr_tool.dart:53 — lib/features/tools/formula_ocr/formula_ocr_tool.dart:53-58 | lib/features/tools/image_gen/image_gen_tool.dart:59-64 | lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:60-65 — `lib/features/tools/formula_ocr/formula_ocr_tool.dart` and `lib/features/tools/image_gen/image_gen_tool.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (6 lines × 3) assets/office_engine/excel/excel_engine/reader.py:888 — assets/office_engine/excel/excel_engine/reader.py:888-893 | assets/office_engine/word/word_engine/reader.py:475-480 | assets/office_engine/word/word_engine/writer.py:847-852 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: ImageAgentCapability (LCOM4 6) lib/core/image/image_agent_capability.dart:12 — ImageAgentCapability'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: ChatNotifier (LCOM4 5) lib/features/chat/chat_provider.dart:310 — ChatNotifier'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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×2
  • Sync-over-async blocking lib/core/font/custom_font_loader.dart:35 — `loadAll` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
  • Sync-over-async blocking lib/core/font/custom_font_loader.dart:80 — `removeFont` is async and calls listSync — a blocking call inside async code stalls the isolate's event loop — every other event, on Flutter the next frame, waits for as long as it runs.
R2 · Cyclomatic Complexity · Complex function routeVia (cyclomatic 17, cognitive 11) · ×2
  • Complex function routeVia (cyclomatic 17, cognitive 11) assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:207 — routeVia has cyclomatic complexity 17 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.
  • Complex function routeVia (cyclomatic 17, cognitive 11) assets/scripts/archify/renderers/workflow/render-workflow.mjs:213 — routeVia has cyclomatic complexity 17 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.
AC3 · Page structure · Page without a main landmark · ×1
  • Page without a main landmark assets/scripts/archify/assets/template.html:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC3 · Page structure · Heading level jumps from h1 to h3 · ×1
  • Heading level jumps from h1 to h3 assets/scripts/archify/assets/template.html:659 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×1
  • Animation without a prefers-reduced-motion guard assets/scripts/archify/assets/template.html:375 — `.archify-toast` moves (`transition: opacity 0.2s, transform 0.2s`) 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.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.7 · ×1
  • Low contrast colour pair in CSS (3.7:1) assets/web/style.css:155 — `#stop-btn` sets color: #fff on background-color: #f44336 — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D1 · Cyclomatic Complexity · AgentLoop.chat (cyclomatic 89) · ×1
  • AgentLoop.chat (cyclomatic 89) lib/core/toolshell/agent_loop.dart:275 — AgentLoop.chat has cyclomatic complexity 89 (threshold 15). To reduce it, separate the cases: extract each independent 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 · reader.read_word (cyclomatic 79) · ×1
  • reader.read_word (cyclomatic 79) assets/office_engine/word/word_engine/reader.py:474 — reader.read_word has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent 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 · reader._read_xlsx (cyclomatic 68) · ×1
  • reader._read_xlsx (cyclomatic 68) assets/office_engine/excel/excel_engine/reader.py:225 — reader._read_xlsx has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent 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 · OpenAiClient.chatStreamFull (cyclomatic 59) · ×1
  • OpenAiClient.chatStreamFull (cyclomatic 59) lib/core/llm/llm_client.dart:521 — OpenAiClient.chatStreamFull has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatNotifier._handleEvent (cyclomatic 43) · ×1
  • ChatNotifier._handleEvent (cyclomatic 43) lib/features/chat/chat_provider.dart:1667 — ChatNotifier._handleEvent has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VplCodeGenerator._generatePythonChain (cyclomatic 43) · ×1
  • VplCodeGenerator._generatePythonChain (cyclomatic 43) lib/features/tools/vpl/vpl_code_gen.dart:119 — VplCodeGenerator._generatePythonChain has cyclomatic complexity 43 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ChatNotifier.sendMessage (cyclomatic 42) · ×1
  • ChatNotifier.sendMessage (cyclomatic 42) lib/features/chat/chat_provider.dart:1039 — ChatNotifier.sendMessage has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ModelCardDialogState.build (cyclomatic 41) · ×1
  • _ModelCardDialogState.build (cyclomatic 41) lib/features/models/model_cards_page.dart:473 — _ModelCardDialogState.build has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · reader._read_xls (cyclomatic 41) · ×1
  • reader._read_xls (cyclomatic 41) assets/office_engine/excel/excel_engine/reader.py:553 — reader._read_xls has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgentContextBuilder.build (cyclomatic 40) · ×1
  • AgentContextBuilder.build (cyclomatic 40) lib/core/agent/agent_context.dart:179 — AgentContextBuilder.build has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · writer.edit_word (cyclomatic 40) · ×1
  • writer.edit_word (cyclomatic 40) assets/office_engine/word/word_engine/writer.py:846 — writer.edit_word has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between 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 · AutonomousLoop.run (cyclomatic 34) · ×1
  • AutonomousLoop.run (cyclomatic 34) lib/core/toolshell/autonomous_loop.dart:273 — AutonomousLoop.run has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · writer._replace_once (cyclomatic 33) · ×1
  • writer._replace_once (cyclomatic 33) assets/office_engine/word/word_engine/writer.py:338 — writer._replace_once has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContextCompactor._findRecentBoundary (cyclomatic 31) · ×1
  • ContextCompactor._findRecentBoundary (cyclomatic 31) lib/core/agent/transformers/context_compactor.dart:712 — ContextCompactor._findRecentBoundary 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 · ServerSessionBuilder.build (cyclomatic 31) · ×1
  • ServerSessionBuilder.build (cyclomatic 31) lib/core/server/server_session.dart:142 — ServerSessionBuilder.build 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 · Executor.run (cyclomatic 31) · ×1
  • Executor.run (cyclomatic 31) lib/core/toolshell/executor.dart:125 — Executor.run has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · AgentLoop._visualEvents (cyclomatic 30) · ×1
  • AgentLoop._visualEvents (cyclomatic 30) lib/core/toolshell/agent_loop.dart:871 — AgentLoop._visualEvents 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 · ToolPipeline._runParallel (cyclomatic 28) · ×1
  • ToolPipeline._runParallel (cyclomatic 28) lib/core/agent/tool_pipeline.dart:144 — ToolPipeline._runParallel 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 · ImageAgentCapability._execute (cyclomatic 28) · ×1
  • ImageAgentCapability._execute (cyclomatic 28) lib/core/image/image_agent_capability.dart:146 — ImageAgentCapability._execute 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 · ImageAgentService._geminiGenerate (cyclomatic 28) · ×1
  • ImageAgentService._geminiGenerate (cyclomatic 28) lib/core/image/image_agent_service.dart:628 — ImageAgentService._geminiGenerate 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 · MessageBubble.build (cyclomatic 28) · ×1
  • MessageBubble.build (cyclomatic 28) lib/features/chat/widgets/message_bubble.dart:42 — MessageBubble.build 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 · _McpServerFormDialogState._applyJsonPayload (cyclomatic 28) · ×1
  • _McpServerFormDialogState._applyJsonPayload (cyclomatic 28) lib/features/mcp/mcp_page.dart:1381 — _McpServerFormDialogState._applyJsonPayload has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · reader._render_sheet_md (cyclomatic 28) · ×1
  • reader._render_sheet_md (cyclomatic 28) assets/office_engine/excel/excel_engine/reader.py:779 — reader._render_sheet_md 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 · ContextCompactor._cleanOrphanedToolMessages (cyclomatic 27) · ×1
  • ContextCompactor._cleanOrphanedToolMessages (cyclomatic 27) lib/core/agent/transformers/context_compactor.dart:578 — ContextCompactor._cleanOrphanedToolMessages 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 · ImageAgentService._extractOpenAiChatImage (cyclomatic 27) · ×1
  • ImageAgentService._extractOpenAiChatImage (cyclomatic 27) lib/core/image/image_agent_service.dart:560 — ImageAgentService._extractOpenAiChatImage 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 · writer.create_word (cyclomatic 27) · ×1
  • writer.create_word (cyclomatic 27) assets/office_engine/word/word_engine/writer.py:228 — writer.create_word 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 · MultiAgentNotifier._friendlyError (cyclomatic 26) · ×1
  • MultiAgentNotifier._friendlyError (cyclomatic 26) lib/features/multi_agent/providers/multi_agent_provider.dart:939 — MultiAgentNotifier._friendlyError has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reader._render_markdown (cyclomatic 26) · ×1
  • reader._render_markdown (cyclomatic 26) assets/office_engine/word/word_engine/reader.py:406 — reader._render_markdown has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · writer._add_markdown (cyclomatic 26) · ×1
  • writer._add_markdown (cyclomatic 26) assets/office_engine/word/word_engine/writer.py:95 — writer._add_markdown has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenAiClient.chat (cyclomatic 24) · ×1
  • OpenAiClient.chat (cyclomatic 24) lib/core/llm/llm_client.dart:415 — OpenAiClient.chat has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OnlineServer._handleChat (cyclomatic 24) · ×1
  • OnlineServer._handleChat (cyclomatic 24) lib/core/online_service/online_server.dart:341 — OnlineServer._handleChat has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reader._collect_images_from_paragraph (cyclomatic 24) · ×1
  • reader._collect_images_from_paragraph (cyclomatic 24) assets/office_engine/word/word_engine/reader.py:149 — reader._collect_images_from_paragraph has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ocr_task.main (cyclomatic 24) · ×1
  • ocr_task.main (cyclomatic 24) assets/scripts/paddle_ocr/ocr_task.py:24 — ocr_task.main has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OnlineServer._handleWsMessage (cyclomatic 23) · ×1
  • OnlineServer._handleWsMessage (cyclomatic 23) lib/core/online_service/online_server.dart:273 — OnlineServer._handleWsMessage has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · _ModelCardDialogState._testConnection (cyclomatic 23) · ×1
  • _ModelCardDialogState._testConnection (cyclomatic 23) lib/features/models/model_cards_page.dart:336 — _ModelCardDialogState._testConnection 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 · VplCodeGenerator._generateDartChain (cyclomatic 23) · ×1
  • VplCodeGenerator._generateDartChain (cyclomatic 23) lib/features/tools/vpl/vpl_code_gen.dart:460 — VplCodeGenerator._generateDartChain 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 · reader.read_excel (cyclomatic 23) · ×1
  • reader.read_excel (cyclomatic 23) assets/office_engine/excel/excel_engine/reader.py:887 — reader.read_excel has cyclomatic complexity 23 (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 · Executor._runJs (cyclomatic 22) · ×1
  • Executor._runJs (cyclomatic 22) lib/core/toolshell/executor.dart:1312 — Executor._runJs 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 · ChatNotifier._handleLoopEvent (cyclomatic 22) · ×1
  • ChatNotifier._handleLoopEvent (cyclomatic 22) lib/features/chat/chat_provider.dart:1414 — ChatNotifier._handleLoopEvent 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 · MultiAgentNotifier._runAgentLoop (cyclomatic 22) · ×1
  • MultiAgentNotifier._runAgentLoop (cyclomatic 22) lib/features/multi_agent/providers/multi_agent_provider.dart:627 — MultiAgentNotifier._runAgentLoop has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · writer._add_blocks (cyclomatic 22) · ×1
  • writer._add_blocks (cyclomatic 22) assets/office_engine/word/word_engine/writer.py:192 — writer._add_blocks 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 · writer.file_operation (cyclomatic 22) · ×1
  • writer.file_operation (cyclomatic 22) assets/office_engine/word/word_engine/writer.py:1060 — writer.file_operation 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 · AnthropicClient._parseSse (cyclomatic 21) · ×1
  • AnthropicClient._parseSse (cyclomatic 21) lib/core/llm/anthropic_client.dart:454 — AnthropicClient._parseSse has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · McpConnectionsNotifier.connect (cyclomatic 21) · ×1
  • McpConnectionsNotifier.connect (cyclomatic 21) lib/providers/mcp_provider.dart:270 — McpConnectionsNotifier.connect has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ToolPipeline._targetKey (cyclomatic 20) · ×1
  • ToolPipeline._targetKey (cyclomatic 20) lib/core/agent/tool_pipeline.dart:302 — ToolPipeline._targetKey has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · GeminiClient._convertMessages (cyclomatic 20) · ×1
  • GeminiClient._convertMessages (cyclomatic 20) lib/core/llm/gemini_client.dart:76 — GeminiClient._convertMessages 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 · ApiServer._handle (cyclomatic 20) · ×1
  • ApiServer._handle (cyclomatic 20) lib/core/server/api_server.dart:89 — ApiServer._handle 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 · ApiServer._streamCompletion (cyclomatic 20) · ×1
  • ApiServer._streamCompletion (cyclomatic 20) lib/core/server/api_server.dart:397 — ApiServer._streamCompletion has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · reader.file_operation (cyclomatic 20) · ×1
  • reader.file_operation (cyclomatic 20) assets/office_engine/excel/excel_engine/reader.py:1025 — reader.file_operation 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 · ScheduleHook._buildSummary (cyclomatic 19) · ×1
  • ScheduleHook._buildSummary (cyclomatic 19) lib/core/agent/hooks/schedule_hook.dart:251 — ScheduleHook._buildSummary 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 · ContextCompactor.buildFallbackSummary (cyclomatic 19) · ×1
  • ContextCompactor.buildFallbackSummary (cyclomatic 19) lib/core/agent/transformers/context_compactor.dart:1295 — ContextCompactor.buildFallbackSummary 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 · OnlineServer._handleTestModel (cyclomatic 19) · ×1
  • OnlineServer._handleTestModel (cyclomatic 19) lib/core/online_service/online_server.dart:709 — OnlineServer._handleTestModel 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 · AnthropicProxy.convertMessages (cyclomatic 19) · ×1
  • AnthropicProxy.convertMessages (cyclomatic 19) lib/core/server/anthropic_proxy.dart:54 — AnthropicProxy.convertMessages 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 · _ChatPageState._buildMessageList (cyclomatic 19) · ×1
  • _ChatPageState._buildMessageList (cyclomatic 19) lib/features/chat/chat_page.dart:421 — _ChatPageState._buildMessageList 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 · AgentContextBuilder._loadTools (cyclomatic 18) · ×1
  • AgentContextBuilder._loadTools (cyclomatic 18) lib/core/agent/agent_context.dart:907 — AgentContextBuilder._loadTools 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 · StreamableHttpTransport._parseStreamResponse (cyclomatic 18) · ×1
  • StreamableHttpTransport._parseStreamResponse (cyclomatic 18) lib/core/mcp/transports/streamable_http_transport.dart:144 — StreamableHttpTransport._parseStreamResponse 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 · ScheduleExecutor._update (cyclomatic 18) · ×1
  • ScheduleExecutor._update (cyclomatic 18) lib/core/toolshell/schedule_executor.dart:239 — ScheduleExecutor._update 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 · SubReadersOrchestrator.runSubtask (cyclomatic 18) · ×1
  • SubReadersOrchestrator.runSubtask (cyclomatic 18) lib/core/toolshell/sub_readers_orchestrator.dart:269 — SubReadersOrchestrator.runSubtask has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ChatNotifier.cancelResponse (cyclomatic 18) · ×1
  • ChatNotifier.cancelResponse (cyclomatic 18) lib/features/chat/chat_provider.dart:2040 — ChatNotifier.cancelResponse 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 · AnthropicClient.chatStreamFull (cyclomatic 17) · ×1
  • AnthropicClient.chatStreamFull (cyclomatic 17) lib/core/llm/anthropic_client.dart:368 — AnthropicClient.chatStreamFull 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 · ScheduleExecutor._addTask (cyclomatic 17) · ×1
  • ScheduleExecutor._addTask (cyclomatic 17) lib/core/toolshell/schedule_executor.dart:91 — ScheduleExecutor._addTask 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 · WorktreeManager.finish (cyclomatic 17) · ×1
  • WorktreeManager.finish (cyclomatic 17) lib/core/toolshell/worktree_manager.dart:94 — WorktreeManager.finish 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 · _McpServerFormDialogState._extractPackageAndArgs (cyclomatic 17) · ×1
  • _McpServerFormDialogState._extractPackageAndArgs (cyclomatic 17) lib/features/mcp/mcp_page.dart:922 — _McpServerFormDialogState._extractPackageAndArgs 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 · ImageAgentCapability._normalizeIds (cyclomatic 16) · ×1
  • ImageAgentCapability._normalizeIds (cyclomatic 16) lib/core/image/image_agent_capability.dart:329 — ImageAgentCapability._normalizeIds 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 · AnthropicSdkClient._parseStream (cyclomatic 16) · ×1
  • AnthropicSdkClient._parseStream (cyclomatic 16) lib/core/llm/anthropic_sdk_client.dart:306 — AnthropicSdkClient._parseStream 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 · GeminiClient._parseSse (cyclomatic 16) · ×1
  • GeminiClient._parseSse (cyclomatic 16) lib/core/llm/gemini_client.dart:420 — GeminiClient._parseSse 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 · SkillRegistry.listProjectSkills (cyclomatic 16) · ×1
  • SkillRegistry.listProjectSkills (cyclomatic 16) lib/core/skill/skill_registry.dart:70 — SkillRegistry.listProjectSkills 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 · TtsService._speakVolcano (cyclomatic 16) · ×1
  • TtsService._speakVolcano (cyclomatic 16) lib/core/tts/tts_service.dart:271 — TtsService._speakVolcano 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 · _ChatInputState.build (cyclomatic 16) · ×1
  • _ChatInputState.build (cyclomatic 16) lib/features/chat/chat_page.dart:765 — _ChatInputState.build has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _LoopChip.build (cyclomatic 16) · ×1
  • _LoopChip.build (cyclomatic 16) lib/features/chat/chat_page.dart:2402 — _LoopChip.build has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _CommandCenterState._exportTimeline (cyclomatic 16) · ×1
  • _CommandCenterState._exportTimeline (cyclomatic 16) lib/features/multi_agent/widgets/command_center.dart:65 — _CommandCenterState._exportTimeline 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 · _ScreenshotEditorState._drawAction (cyclomatic 16) · ×1
  • _ScreenshotEditorState._drawAction (cyclomatic 16) lib/shared/widgets/screenshot_editor.dart:423 — _ScreenshotEditorState._drawAction has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (_EditorPainter._paintAction) 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.
D1 · Cyclomatic Complexity · _EditorPainter._paintAction (cyclomatic 16) · ×1
  • _EditorPainter._paintAction (cyclomatic 16) lib/shared/widgets/screenshot_editor.dart:552 — _EditorPainter._paintAction has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (_ScreenshotEditorState._drawAction) 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.
D1 · Cyclomatic Complexity · _DockSplitViewState._onDividerDrag (cyclomatic 16) · ×1
  • _DockSplitViewState._onDividerDrag (cyclomatic 16) packages/dock_panel/lib/src/widgets/dock_area.dart:110 — _DockSplitViewState._onDividerDrag has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · volcano_tts.synthesize (cyclomatic 16) · ×1
  • volcano_tts.synthesize (cyclomatic 16) assets/scripts/volcano_tts/volcano_tts.py:58 — volcano_tts.synthesize 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.
D17 · Explicit Debt · TodoComment · ×1
  • TodoComment lib/core/agent/transformers/context_compactor.dart:1402 — /// 3. 完整内容可选地沉淀到记忆系统(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.
D2 · Cognitive Complexity · AgentLoop.chat (cognitive 205) · ×1
  • AgentLoop.chat (cognitive 205) lib/core/toolshell/agent_loop.dart:275 — AgentLoop.chat has cognitive complexity 205 (threshold 15). Drivers by points: if/else 40 (100 pts), ternaries 10 (41 pts), loops 11 (29 pts), boolean chains 27, match/switch 1 (5 pts), error handling 1 (3 pts) (nesting depth added 115). 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 · reader.read_word (cognitive 168) · ×1
  • reader.read_word (cognitive 168) assets/office_engine/word/word_engine/reader.py:474 — reader.read_word has cognitive complexity 168 (threshold 15). Drivers by points: if/else 35 (85 pts), loops 15 (40 pts), boolean chains 21, ternaries 3 (15 pts), error handling 4 (7 pts) (nesting depth added 90). 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 · reader._read_xlsx (cognitive 157) · ×1
  • reader._read_xlsx (cognitive 157) assets/office_engine/excel/excel_engine/reader.py:225 — reader._read_xlsx has cognitive complexity 157 (threshold 15). Drivers by points: if/else 32 (97 pts), loops 10 (22 pts), boolean chains 16, error handling 7 (13 pts), ternaries 4 (9 pts) (nesting depth added 88). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAiClient.chatStreamFull (cognitive 149) · ×1
  • OpenAiClient.chatStreamFull (cognitive 149) lib/core/llm/llm_client.dart:521 — OpenAiClient.chatStreamFull has cognitive complexity 149 (threshold 15). Drivers by points: if/else 28 (93 pts), ternaries 7 (21 pts), boolean chains 12, loops 3 (11 pts), error handling 4 (9 pts), match/switch 1 (3 pts) (nesting depth added 94). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reader._read_xls (cognitive 87) · ×1
  • reader._read_xls (cognitive 87) assets/office_engine/excel/excel_engine/reader.py:553 — reader._read_xls has cognitive complexity 87 (threshold 15). Drivers by points: if/else 19 (48 pts), loops 11 (23 pts), boolean chains 7, error handling 4 (6 pts), ternaries 1 (3 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentLoop._visualEvents (cognitive 83) · ×1
  • AgentLoop._visualEvents (cognitive 83) lib/core/toolshell/agent_loop.dart:871 — AgentLoop._visualEvents has cognitive complexity 83 (threshold 15). Drivers by points: if/else 15 (52 pts), loops 4 (16 pts), boolean chains 6, error handling 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageAgentService._extractOpenAiChatImage (cognitive 75) · ×1
  • ImageAgentService._extractOpenAiChatImage (cognitive 75) lib/core/image/image_agent_service.dart:560 — ImageAgentService._extractOpenAiChatImage has cognitive complexity 75 (threshold 15). Drivers by points: if/else 15 (56 pts), loops 3 (10 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 49). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ChatNotifier.sendMessage (cognitive 68) · ×1
  • ChatNotifier.sendMessage (cognitive 68) lib/features/chat/chat_provider.dart:1039 — ChatNotifier.sendMessage has cognitive complexity 68 (threshold 15). Drivers by points: if/else 25 (38 pts), ternaries 7 (13 pts), error handling 4 (7 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextCompactor._findRecentBoundary (cognitive 66) · ×1
  • ContextCompactor._findRecentBoundary (cognitive 66) lib/core/agent/transformers/context_compactor.dart:712 — ContextCompactor._findRecentBoundary has cognitive complexity 66 (threshold 15). Drivers by points: if/else 16 (45 pts), loops 8 (15 pts), boolean chains 5, ternaries 1 (nesting depth added 36). 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 · AgentContextBuilder.build (cognitive 62) · ×1
  • AgentContextBuilder.build (cognitive 62) lib/core/agent/agent_context.dart:179 — AgentContextBuilder.build has cognitive complexity 62 (threshold 15). Drivers by points: if/else 23 (36 pts), boolean chains 11, error handling 3 (11 pts), loops 2, ternaries 2 (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 · OnlineServer._handleChat (cognitive 60) · ×1
  • OnlineServer._handleChat (cognitive 60) lib/core/online_service/online_server.dart:341 — OnlineServer._handleChat has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 3 (9 pts), ternaries 2 (8 pts), match/switch 1 (4 pts), error handling 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · McpConnectionsNotifier.connect (cognitive 60) · ×1
  • McpConnectionsNotifier.connect (cognitive 60) lib/providers/mcp_provider.dart:270 — McpConnectionsNotifier.connect has cognitive complexity 60 (threshold 15). Drivers by points: if/else 11 (30 pts), ternaries 6 (26 pts), match/switch 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 40). 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 · ChatNotifier._handleEvent (cognitive 58) · ×1
  • ChatNotifier._handleEvent (cognitive 58) lib/features/chat/chat_provider.dart:1667 — ChatNotifier._handleEvent has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 15 (32 pts), if/else 8 (17 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 29). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · writer._add_markdown (cognitive 57) · ×1
  • writer._add_markdown (cognitive 57) assets/office_engine/word/word_engine/writer.py:95 — writer._add_markdown has cognitive complexity 57 (threshold 15). Drivers by points: if/else 15 (40 pts), loops 5 (12 pts), boolean chains 5 (nesting depth added 32). 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 · ImageAgentService._geminiGenerate (cognitive 56) · ×1
  • ImageAgentService._geminiGenerate (cognitive 56) lib/core/image/image_agent_service.dart:628 — ImageAgentService._geminiGenerate has cognitive complexity 56 (threshold 15). Drivers by points: if/else 14 (35 pts), ternaries 4 (8 pts), boolean chains 6, loops 3 (6 pts), error handling 1 (nesting depth added 28). 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 · writer._replace_once (cognitive 55) · ×1
  • writer._replace_once (cognitive 55) assets/office_engine/word/word_engine/writer.py:338 — writer._replace_once has cognitive complexity 55 (threshold 15). Drivers by points: if/else 21 (39 pts), loops 6 (10 pts), boolean chains 6 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageAgentCapability._execute (cognitive 52) · ×1
  • ImageAgentCapability._execute (cognitive 52) lib/core/image/image_agent_capability.dart:146 — ImageAgentCapability._execute has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (39 pts), ternaries 3 (5 pts), loops 3 (4 pts), boolean chains 3, error handling 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerSessionBuilder.build (cognitive 52) · ×1
  • ServerSessionBuilder.build (cognitive 52) lib/core/server/server_session.dart:142 — ServerSessionBuilder.build has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 7, ternaries 3 (6 pts), error handling 1 (5 pts), loops 4 (5 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ModelCardDialogState._testConnection (cognitive 48) · ×1
  • _ModelCardDialogState._testConnection (cognitive 48) lib/features/models/model_cards_page.dart:336 — _ModelCardDialogState._testConnection has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (40 pts), boolean chains 5, loops 1 (2 pts), error handling 1 (nesting depth added 22). 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 · ContextCompactor._cleanOrphanedToolMessages (cognitive 47) · ×1
  • ContextCompactor._cleanOrphanedToolMessages (cognitive 47) lib/core/agent/transformers/context_compactor.dart:578 — ContextCompactor._cleanOrphanedToolMessages has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 10, loops 4 (6 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ocr_task.main (cognitive 46) · ×1
  • ocr_task.main (cognitive 46) assets/scripts/paddle_ocr/ocr_task.py:24 — ocr_task.main has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (37 pts), loops 4 (8 pts), ternaries 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnthropicClient._parseSse (cognitive 45) · ×1
  • AnthropicClient._parseSse (cognitive 45) lib/core/llm/anthropic_client.dart:454 — AnthropicClient._parseSse has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (34 pts), error handling 1 (3 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamableHttpTransport._parseStreamResponse (cognitive 45) · ×1
  • StreamableHttpTransport._parseStreamResponse (cognitive 45) lib/core/mcp/transports/streamable_http_transport.dart:144 — StreamableHttpTransport._parseStreamResponse has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (36 pts), error handling 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 28). 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 · AutonomousLoop.run (cognitive 45) · ×1
  • AutonomousLoop.run (cognitive 45) lib/core/toolshell/autonomous_loop.dart:273 — AutonomousLoop.run has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 5, ternaries 1 (4 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ModelCardDialogState.build (cognitive 42) · ×1
  • _ModelCardDialogState.build (cognitive 42) lib/features/models/model_cards_page.dart:473 — _ModelCardDialogState.build has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (17 pts), ternaries 14, boolean chains 11 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ToolPipeline._runParallel (cognitive 39) · ×1
  • ToolPipeline._runParallel (cognitive 39) lib/core/agent/tool_pipeline.dart:144 — ToolPipeline._runParallel has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 8 (10 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScheduleExecutor._addTask (cognitive 39) · ×1
  • ScheduleExecutor._addTask (cognitive 39) lib/core/toolshell/schedule_executor.dart:91 — ScheduleExecutor._addTask has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 4 (13 pts), boolean chains 3, ternaries 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reader._collect_images_from_paragraph (cognitive 39) · ×1
  • reader._collect_images_from_paragraph (cognitive 39) assets/office_engine/word/word_engine/reader.py:149 — reader._collect_images_from_paragraph has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 5 (9 pts), boolean chains 6, error handling 2 (4 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 · GeminiClient._parseSse (cognitive 38) · ×1
  • GeminiClient._parseSse (cognitive 38) lib/core/llm/gemini_client.dart:420 — GeminiClient._parseSse has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 3 (6 pts), error handling 1 (3 pts), ternaries 2, boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnthropicProxy.convertMessages (cognitive 38) · ×1
  • AnthropicProxy.convertMessages (cognitive 38) lib/core/server/anthropic_proxy.dart:54 — AnthropicProxy.convertMessages has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 2 (7 pts), loops 3 (6 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _McpServerFormDialogState._applyJsonPayload (cognitive 38) · ×1
  • _McpServerFormDialogState._applyJsonPayload (cognitive 38) lib/features/mcp/mcp_page.dart:1381 — _McpServerFormDialogState._applyJsonPayload has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 7, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · reader._render_markdown (cognitive 38) · ×1
  • reader._render_markdown (cognitive 38) assets/office_engine/word/word_engine/reader.py:406 — reader._render_markdown has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 3 (11 pts), boolean chains 8, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · writer._add_blocks (cognitive 38) · ×1
  • writer._add_blocks (cognitive 38) assets/office_engine/word/word_engine/writer.py:192 — writer._add_blocks has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (28 pts), boolean chains 6, ternaries 1 (3 pts), 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 · writer.file_operation (cognitive 37) · ×1
  • writer.file_operation (cognitive 37) assets/office_engine/word/word_engine/writer.py:1060 — writer.file_operation has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 6, error handling 1 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatNotifier.cancelResponse (cognitive 36) · ×1
  • ChatNotifier.cancelResponse (cognitive 36) lib/features/chat/chat_provider.dart:2040 — ChatNotifier.cancelResponse has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 3 (6 pts), boolean chains 5, loops 1 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reader._render_sheet_md (cognitive 36) · ×1
  • reader._render_sheet_md (cognitive 36) assets/office_engine/excel/excel_engine/reader.py:779 — reader._render_sheet_md has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 11, loops 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · writer.create_word (cognitive 36) · ×1
  • writer.create_word (cognitive 36) assets/office_engine/word/word_engine/writer.py:228 — writer.create_word has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 11, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OnlineServer._handleTestModel (cognitive 35) · ×1
  • OnlineServer._handleTestModel (cognitive 35) lib/core/online_service/online_server.dart:709 — OnlineServer._handleTestModel has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 3 (10 pts), boolean chains 4, error handling 2, match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Executor._runJs (cognitive 35) · ×1
  • Executor._runJs (cognitive 35) lib/core/toolshell/executor.dart:1312 — Executor._runJs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 5 (9 pts), boolean chains 5, error handling 2 (3 pts), loops 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MessageBubble.build (cognitive 35) · ×1
  • MessageBubble.build (cognitive 35) lib/features/chat/widgets/message_bubble.dart:42 — MessageBubble.build has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 10, ternaries 6 (10 pts), if/else 8 (9 pts), loops 3 (6 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 · writer.edit_word (cognitive 35) · ×1
  • writer.edit_word (cognitive 35) assets/office_engine/word/word_engine/writer.py:846 — writer.edit_word has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (22 pts), boolean chains 10, error handling 1, loops 1, ternaries 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 · OpenAiClient.chat (cognitive 33) · ×1
  • OpenAiClient.chat (cognitive 33) lib/core/llm/llm_client.dart:415 — OpenAiClient.chat has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, ternaries 2 (6 pts), error handling 3 (5 pts), match/switch 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkillRegistry.listProjectSkills (cognitive 33) · ×1
  • SkillRegistry.listProjectSkills (cognitive 33) lib/core/skill/skill_registry.dart:70 — SkillRegistry.listProjectSkills has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (25 pts), error handling 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ScheduleExecutor._update (cognitive 33) · ×1
  • ScheduleExecutor._update (cognitive 33) lib/core/toolshell/schedule_executor.dart:239 — ScheduleExecutor._update has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 4 (11 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeminiClient._convertMessages (cognitive 32) · ×1
  • GeminiClient._convertMessages (cognitive 32) lib/core/llm/gemini_client.dart:76 — GeminiClient._convertMessages has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 6, loops 3 (5 pts), match/switch 1 (2 pts), ternaries 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 · AgentContextBuilder._loadTools (cognitive 31) · ×1
  • AgentContextBuilder._loadTools (cognitive 31) lib/core/agent/agent_context.dart:907 — AgentContextBuilder._loadTools has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 8 (13 pts), ternaries 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 · ChatNotifier._handleLoopEvent (cognitive 31) · ×1
  • ChatNotifier._handleLoopEvent (cognitive 31) lib/features/chat/chat_provider.dart:1414 — ChatNotifier._handleLoopEvent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 3 (9 pts), error handling 1 (3 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · VplCodeGenerator._generatePythonChain (cognitive 31) · ×1
  • VplCodeGenerator._generatePythonChain (cognitive 31) lib/features/tools/vpl/vpl_code_gen.dart:119 — VplCodeGenerator._generatePythonChain has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 8, match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reader.file_operation (cognitive 30) · ×1
  • reader.file_operation (cognitive 30) assets/office_engine/excel/excel_engine/reader.py:1025 — reader.file_operation has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageAgentCapability._normalizeIds (cognitive 29) · ×1
  • ImageAgentCapability._normalizeIds (cognitive 29) lib/core/image/image_agent_capability.dart:329 — ImageAgentCapability._normalizeIds has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (8 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Executor._findJsRuntime (cognitive 29) · ×1
  • Executor._findJsRuntime (cognitive 29) lib/core/toolshell/executor.dart:1447 — Executor._findJsRuntime has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 4 (9 pts), loops 2 (3 pts), error handling 1 (2 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextCompactor.buildFallbackSummary (cognitive 28) · ×1
  • ContextCompactor.buildFallbackSummary (cognitive 28) lib/core/agent/transformers/context_compactor.dart:1295 — ContextCompactor.buildFallbackSummary has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 5 (9 pts), ternaries 3 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnthropicClient.chatStreamFull (cognitive 28) · ×1
  • AnthropicClient.chatStreamFull (cognitive 28) lib/core/llm/anthropic_client.dart:368 — AnthropicClient.chatStreamFull has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 7, error handling 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApiServer._handle (cognitive 28) · ×1
  • ApiServer._handle (cognitive 28) lib/core/server/api_server.dart:89 — ApiServer._handle has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 9, error handling 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Executor._findPython (cognitive 28) · ×1
  • Executor._findPython (cognitive 28) lib/core/toolshell/executor.dart:1183 — Executor._findPython has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 3 (7 pts), error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TtsService._speakVolcano (cognitive 27) · ×1
  • TtsService._speakVolcano (cognitive 27) lib/core/tts/tts_service.dart:271 — TtsService._speakVolcano has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 2 (4 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentContextBuilder._collectCapabilities (cognitive 26) · ×1
  • AgentContextBuilder._collectCapabilities (cognitive 26) lib/core/agent/agent_context.dart:1243 — AgentContextBuilder._collectCapabilities has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 3 (10 pts), if/else 4 (9 pts), loops 1 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServerSessionBuilder.resolveModelCard (cognitive 26) · ×1
  • ServerSessionBuilder.resolveModelCard (cognitive 26) lib/core/server/server_session.dart:105 — ServerSessionBuilder.resolveModelCard has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (9 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkillRouter._extractKeywords (cognitive 26) · ×1
  • SkillRouter._extractKeywords (cognitive 26) lib/core/skill/skill_router.dart:175 — SkillRouter._extractKeywords has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 4 (9 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 · AndroidExecutor._install (cognitive 26) · ×1
  • AndroidExecutor._install (cognitive 26) lib/core/toolshell/android_executor.dart:373 — AndroidExecutor._install has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentLoop._fixToolCallPairing (cognitive 25) · ×1
  • AgentLoop._fixToolCallPairing (cognitive 25) lib/core/toolshell/agent_loop.dart:1135 — AgentLoop._fixToolCallPairing has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 6, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultiAgentNotifier._compressAndRoute (cognitive 25) · ×1
  • MultiAgentNotifier._compressAndRoute (cognitive 25) lib/features/multi_agent/providers/multi_agent_provider.dart:826 — MultiAgentNotifier._compressAndRoute has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (7 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultiAgentNotifier._friendlyError (cognitive 25) · ×1
  • MultiAgentNotifier._friendlyError (cognitive 25) lib/features/multi_agent/providers/multi_agent_provider.dart:939 — MultiAgentNotifier._friendlyError has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 13, if/else 12. 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 · ScheduleHook._buildSummary (cognitive 24) · ×1
  • ScheduleHook._buildSummary (cognitive 24) lib/core/agent/hooks/schedule_hook.dart:251 — ScheduleHook._buildSummary has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 3 (5 pts), match/switch 1 (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 · ConversationExporter._exportWithFormat (cognitive 24) · ×1
  • ConversationExporter._exportWithFormat (cognitive 24) lib/core/export/conversation_exporter.dart:213 — ConversationExporter._exportWithFormat has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), error handling 3 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConversationImageExporter.export (cognitive 24) · ×1
  • ConversationImageExporter.export (cognitive 24) lib/core/export/conversation_image_exporter.dart:49 — ConversationImageExporter.export has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAiClient.chatStream (cognitive 24) · ×1
  • OpenAiClient.chatStream (cognitive 24) lib/core/llm/llm_client.dart:477 — OpenAiClient.chatStream has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 1 (4 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SystemExecutor._androidDetails (cognitive 24) · ×1
  • SystemExecutor._androidDetails (cognitive 24) lib/core/toolshell/system_executor.dart:161 — SystemExecutor._androidDetails has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 pts), boolean chains 2, error handling 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reader.read_excel (cognitive 24) · ×1
  • reader.read_excel (cognitive 24) assets/office_engine/excel/excel_engine/reader.py:887 — reader.read_excel has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, if/else 12. 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 · writer._center_tables (cognitive 24) · ×1
  • writer._center_tables (cognitive 24) assets/office_engine/word/word_engine/writer.py:726 — writer._center_tables has cognitive complexity 24 (threshold 15). Drivers by points: loops 5 (12 pts), error handling 2 (6 pts), if/else 3 (5 pts), boolean chains 1 (nesting depth added 13). 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 · KbRecallHook.onBeforeUserMessage (cognitive 23) · ×1
  • KbRecallHook.onBeforeUserMessage (cognitive 23) lib/core/agent/hooks/kb_recall_hook.dart:27 — KbRecallHook.onBeforeUserMessage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (6 pts), loops 2 (5 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageAgentService._extractOpenAiImage (cognitive 23) · ×1
  • ImageAgentService._extractOpenAiImage (cognitive 23) lib/core/image/image_agent_service.dart:526 — ImageAgentService._extractOpenAiImage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnthropicClient.chat (cognitive 23) · ×1
  • AnthropicClient.chat (cognitive 23) lib/core/llm/anthropic_client.dart:284 — AnthropicClient.chat has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, ternaries 1 (3 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkillRegistry.loadSkillTools (cognitive 23) · ×1
  • SkillRegistry.loadSkillTools (cognitive 23) lib/core/skill/skill_registry.dart:369 — SkillRegistry.loadSkillTools has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkillRegistry._loadSkillFromDir (cognitive 23) · ×1
  • SkillRegistry._loadSkillFromDir (cognitive 23) lib/core/skill/skill_registry.dart:448 — SkillRegistry._loadSkillFromDir has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SystemExecutor._env (cognitive 23) · ×1
  • SystemExecutor._env (cognitive 23) lib/core/toolshell/system_executor.dart:285 — SystemExecutor._env has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KbDocumentsNotifier.indexAllPending (cognitive 23) · ×1
  • KbDocumentsNotifier.indexAllPending (cognitive 23) lib/providers/kb_provider.dart:189 — KbDocumentsNotifier.indexAllPending has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConversationExporter.showExportMenu (cognitive 22) · ×1
  • ConversationExporter.showExportMenu (cognitive 22) lib/core/export/conversation_exporter.dart:337 — ConversationExporter.showExportMenu has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 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 · VplCodeGenerator._generateDartChain (cognitive 22) · ×1
  • VplCodeGenerator._generateDartChain (cognitive 22) lib/features/tools/vpl/vpl_code_gen.dart:460 — VplCodeGenerator._generateDartChain has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 7, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SettingsNotifier._migrateDirectoryWithProgress (cognitive 22) · ×1
  • SettingsNotifier._migrateDirectoryWithProgress (cognitive 22) lib/providers/settings_provider.dart:546 — SettingsNotifier._migrateDirectoryWithProgress has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (4 pts), error handling 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reader._normalize_image (cognitive 22) · ×1
  • reader._normalize_image (cognitive 22) assets/office_engine/word/word_engine/reader.py:326 — reader._normalize_image has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (7 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SystemProbeHook._buildSummary (cognitive 21) · ×1
  • SystemProbeHook._buildSummary (cognitive 21) lib/core/agent/hooks/system_probe_hook.dart:56 — SystemProbeHook._buildSummary has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnthropicSdkClient._convertUserMessage (cognitive 21) · ×1
  • AnthropicSdkClient._convertUserMessage (cognitive 21) lib/core/llm/anthropic_sdk_client.dart:124 — AnthropicSdkClient._convertUserMessage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ApiServer._collectStream (cognitive 21) · ×1
  • ApiServer._collectStream (cognitive 21) lib/core/server/api_server.dart:845 — ApiServer._collectStream has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Executor._searchDart (cognitive 21) · ×1
  • Executor._searchDart (cognitive 21) lib/core/toolshell/executor.dart:500 — Executor._searchDart has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (4 pts), error handling 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Executor._exec (cognitive 21) · ×1
  • Executor._exec (cognitive 21) lib/core/toolshell/executor.dart:647 — Executor._exec has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 6, error handling 3 (6 pts), ternaries 2 (5 pts), if/else 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkillsPageBody.importZip (cognitive 21) · ×1
  • SkillsPageBody.importZip (cognitive 21) lib/features/skills/skills_page.dart:38 — SkillsPageBody.importZip has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (6 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextCompactor._summarizeOnce (cognitive 20) · ×1
  • ContextCompactor._summarizeOnce (cognitive 20) lib/core/agent/transformers/context_compactor.dart:1098 — ContextCompactor._summarizeOnce has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (7 pts), boolean chains 1, error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImageAgentService._openAiGenerate (cognitive 20) · ×1
  • ImageAgentService._openAiGenerate (cognitive 20) lib/core/image/image_agent_service.dart:289 — ImageAgentService._openAiGenerate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (5 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemoryManager.recall (cognitive 20) · ×1
  • MemoryManager.recall (cognitive 20) lib/core/memory/memory_manager.dart:435 — MemoryManager.recall has cognitive complexity 20 (threshold 15). Drivers by points: error handling 5 (12 pts), if/else 4 (8 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorktreeManager.finish (cognitive 20) · ×1
  • WorktreeManager.finish (cognitive 20) lib/core/toolshell/worktree_manager.dart:94 — WorktreeManager.finish has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _ChatPageState._buildMessageList (cognitive 20) · ×1
  • _ChatPageState._buildMessageList (cognitive 20) lib/features/chat/chat_page.dart:421 — _ChatPageState._buildMessageList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 6 (7 pts), boolean chains 6 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · _McpServerFormDialogState._extractPackageAndArgs (cognitive 20) · ×1
  • _McpServerFormDialogState._extractPackageAndArgs (cognitive 20) lib/features/mcp/mcp_page.dart:922 — _McpServerFormDialogState._extractPackageAndArgs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 9 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _EmbeddingEditorDialogState._testConnection (cognitive 20) · ×1
  • _EmbeddingEditorDialogState._testConnection (cognitive 20) lib/features/settings/widgets/embedding_editor_dialog.dart:57 — _EmbeddingEditorDialogState._testConnection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, error handling 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · doc_parse_task.main (cognitive 20) · ×1
  • doc_parse_task.main (cognitive 20) assets/scripts/paddle_ocr/doc_parse_task.py:24 — doc_parse_task.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · volcano_tts.synthesize (cognitive 20) · ×1
  • volcano_tts.synthesize (cognitive 20) assets/scripts/volcano_tts/volcano_tts.py:58 — volcano_tts.synthesize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 4 (5 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemoryManager._supersedeSimilar (cognitive 19) · ×1
  • MemoryManager._supersedeSimilar (cognitive 19) lib/core/memory/memory_manager.dart:329 — MemoryManager._supersedeSimilar has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (5 pts), loops 2 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QdrantService._cleanWalLocks (cognitive 19) · ×1
  • QdrantService._cleanWalLocks (cognitive 19) lib/core/memory/qdrant_service.dart:122 — QdrantService._cleanWalLocks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (5 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ScheduleExecutor._archive (cognitive 19) · ×1
  • ScheduleExecutor._archive (cognitive 19) lib/core/toolshell/schedule_executor.dart:407 — ScheduleExecutor._archive has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3, boolean chains 1, 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 · _ImageGenSettingsState._testConnection (cognitive 19) · ×1
  • _ImageGenSettingsState._testConnection (cognitive 19) lib/features/tools/image_gen/image_gen_tool.dart:637 — _ImageGenSettingsState._testConnection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _PaddleOcrUIState._recognize (cognitive 19) · ×1
  • _PaddleOcrUIState._recognize (cognitive 19) lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:163 — _PaddleOcrUIState._recognize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · writer._replace_text (cognitive 19) · ×1
  • writer._replace_text (cognitive 19) assets/office_engine/word/word_engine/writer.py:436 — writer._replace_text has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextCompactor._compressLargeToolResults (cognitive 18) · ×1
  • ContextCompactor._compressLargeToolResults (cognitive 18) lib/core/agent/transformers/context_compactor.dart:1390 — ContextCompactor._compressLargeToolResults has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnthropicClient._convertAssistantContent (cognitive 18) · ×1
  • AnthropicClient._convertAssistantContent (cognitive 18) lib/core/llm/anthropic_client.dart:210 — AnthropicClient._convertAssistantContent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 1 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnthropicSdkClient._parseStream (cognitive 18) · ×1
  • AnthropicSdkClient._parseStream (cognitive 18) lib/core/llm/anthropic_sdk_client.dart:306 — AnthropicSdkClient._parseStream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 3, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeminiClient._convertAssistantParts (cognitive 18) · ×1
  • GeminiClient._convertAssistantParts (cognitive 18) lib/core/llm/gemini_client.dart:195 — GeminiClient._convertAssistantParts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 1 (4 pts), loops 1 (2 pts), boolean chains 1, ternaries 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 · AgentLoop._runToolSafely (cognitive 18) · ×1
  • AgentLoop._runToolSafely (cognitive 18) lib/core/toolshell/agent_loop.dart:795 — AgentLoop._runToolSafely has cognitive complexity 18 (threshold 15). Drivers by points: error handling 3 (7 pts), if/else 2 (7 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Executor._buildEnvironment (cognitive 18) · ×1
  • Executor._buildEnvironment (cognitive 18) lib/core/toolshell/executor.dart:1652 — Executor._buildEnvironment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 2, boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _SlashCommandButton.build (cognitive 18) · ×1
  • _SlashCommandButton.build (cognitive 18) lib/features/chat/chat_page.dart:1033 — _SlashCommandButton.build has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (14 pts), if/else 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatNotifier.regenerateMessage (cognitive 18) · ×1
  • ChatNotifier.regenerateMessage (cognitive 18) lib/features/chat/chat_provider.dart:2304 — ChatNotifier.regenerateMessage has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3, boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MultiAgentNotifier._loadToolsForAgent (cognitive 18) · ×1
  • MultiAgentNotifier._loadToolsForAgent (cognitive 18) lib/features/multi_agent/providers/multi_agent_provider.dart:488 — MultiAgentNotifier._loadToolsForAgent has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (5 pts), match/switch 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _FormulaOcrUIState._exportWord (cognitive 18) · ×1
  • _FormulaOcrUIState._exportWord (cognitive 18) lib/features/tools/formula_ocr/formula_ocr_tool.dart:164 — _FormulaOcrUIState._exportWord has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 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 · _PaddleOcrUIState._exportWord (cognitive 18) · ×1
  • _PaddleOcrUIState._exportWord (cognitive 18) lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:309 — _PaddleOcrUIState._exportWord has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 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 · writer._delete_image (cognitive 18) · ×1
  • writer._delete_image (cognitive 18) assets/office_engine/word/word_engine/writer.py:663 — writer._delete_image has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), boolean chains 3 (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 · ContextCompactor._estimateTokens (cognitive 17) · ×1
  • ContextCompactor._estimateTokens (cognitive 17) lib/core/agent/transformers/context_compactor.dart:529 — ContextCompactor._estimateTokens has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeminiClient._convertUserParts (cognitive 17) · ×1
  • GeminiClient._convertUserParts (cognitive 17) lib/core/llm/gemini_client.dart:154 — GeminiClient._convertUserParts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentLoop._estimateTokens (cognitive 17) · ×1
  • AgentLoop._estimateTokens (cognitive 17) lib/core/toolshell/agent_loop.dart:1051 — AgentLoop._estimateTokens has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolProgressTracker.record (cognitive 17) · ×1
  • ToolProgressTracker.record (cognitive 17) lib/core/toolshell/budget.dart:788 — ToolProgressTracker.record has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Executor.run (cognitive 17) · ×1
  • Executor.run (cognitive 17) lib/core/toolshell/executor.dart:125 — Executor.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 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 · SubReadersOrchestrator._parsePlan (cognitive 17) · ×1
  • SubReadersOrchestrator._parsePlan (cognitive 17) lib/core/toolshell/sub_readers_orchestrator.dart:225 — SubReadersOrchestrator._parsePlan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _CommandCenterState._exportTimeline (cognitive 17) · ×1
  • _CommandCenterState._exportTimeline (cognitive 17) lib/features/multi_agent/widgets/command_center.dart:65 — _CommandCenterState._exportTimeline has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (6 pts), match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ScreenshotEditorState._drawAction (cognitive 17) · ×1
  • _ScreenshotEditorState._drawAction (cognitive 17) lib/shared/widgets/screenshot_editor.dart:423 — _ScreenshotEditorState._drawAction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (_EditorPainter._paintAction) 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 · _EditorPainter._paintAction (cognitive 17) · ×1
  • _EditorPainter._paintAction (cognitive 17) lib/shared/widgets/screenshot_editor.dart:552 — _EditorPainter._paintAction has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (_ScreenshotEditorState._drawAction) 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 · _DockSplitViewState._onDividerDrag (cognitive 17) · ×1
  • _DockSplitViewState._onDividerDrag (cognitive 17) packages/dock_panel/lib/src/widgets/dock_area.dart:110 — _DockSplitViewState._onDividerDrag has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, boolean chains 6, loops 2 (4 pts) (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _DockSplitViewState.build (cognitive 17) · ×1
  • _DockSplitViewState.build (cognitive 17) packages/dock_panel/lib/src/widgets/dock_area.dart:188 — _DockSplitViewState.build has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextCompactor._sinkToMemory (cognitive 16) · ×1
  • ContextCompactor._sinkToMemory (cognitive 16) lib/core/agent/transformers/context_compactor.dart:942 — ContextCompactor._sinkToMemory has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (4 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextCompactor._summarizeInChunks (cognitive 16) · ×1
  • ContextCompactor._summarizeInChunks (cognitive 16) lib/core/agent/transformers/context_compactor.dart:1016 — ContextCompactor._summarizeInChunks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (6 pts), error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnthropicClient._convertMessages (cognitive 16) · ×1
  • AnthropicClient._convertMessages (cognitive 16) lib/core/llm/anthropic_client.dart:107 — AnthropicClient._convertMessages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 5, match/switch 1 (2 pts), loops 1, ternaries 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 · StreamableHttpTransport.sendRequest (cognitive 16) · ×1
  • StreamableHttpTransport.sendRequest (cognitive 16) lib/core/mcp/transports/streamable_http_transport.dart:47 — StreamableHttpTransport.sendRequest has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ApiServer._streamCompletion (cognitive 16) · ×1
  • ApiServer._streamCompletion (cognitive 16) lib/core/server/api_server.dart:397 — ApiServer._streamCompletion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 1 (3 pts), loops 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkillInjector.inject (cognitive 16) · ×1
  • SkillInjector.inject (cognitive 16) lib/core/skill/skill_injector.dart:84 — SkillInjector.inject has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentLoop._validateToolCallPairing (cognitive 16) · ×1
  • AgentLoop._validateToolCallPairing (cognitive 16) lib/core/toolshell/agent_loop.dart:1097 — AgentLoop._validateToolCallPairing has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 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 · AndroidExecutor._tap (cognitive 16) · ×1
  • AndroidExecutor._tap (cognitive 16) lib/core/toolshell/android_executor.dart:310 — AndroidExecutor._tap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolProgressTracker._walkForArtifacts (cognitive 16) · ×1
  • ToolProgressTracker._walkForArtifacts (cognitive 16) lib/core/toolshell/budget.dart:1055 — ToolProgressTracker._walkForArtifacts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Executor._runPython (cognitive 16) · ×1
  • Executor._runPython (cognitive 16) lib/core/toolshell/executor.dart:914 — Executor._runPython has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), boolean chains 4, error handling 2 (3 pts), if/else 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Executor._runOffice (cognitive 16) · ×1
  • Executor._runOffice (cognitive 16) lib/core/toolshell/executor.dart:1081 — Executor._runOffice has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), error handling 2 (4 pts), if/else 4, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Executor._memStore (cognitive 16) · ×1
  • Executor._memStore (cognitive 16) lib/core/toolshell/executor.dart:1708 — Executor._memStore has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, error handling 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ChatInputState.build (cognitive 16) · ×1
  • _ChatInputState.build (cognitive 16) lib/features/chat/chat_page.dart:765 — _ChatInputState.build has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, ternaries 6, if/else 3 (4 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _LoopChip.build (cognitive 16) · ×1
  • _LoopChip.build (cognitive 16) lib/features/chat/chat_page.dart:2402 — _LoopChip.build has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7, boolean chains 5, if/else 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · _FlowchartEditorPageState._exportImage (cognitive 16) · ×1
  • _FlowchartEditorPageState._exportImage (cognitive 16) lib/features/tools/flowchart/flowchart_editor.dart:325 — _FlowchartEditorPageState._exportImage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Near-duplicate member family (5 members, 24 shared lines) · ×1
  • Near-duplicate member family (5 members, 24 shared lines) lib/features/settings/settings_page.dart:676 — lib/features/settings/settings_page.dart:676-713 | lib/features/settings/widgets/custom_license_page.dart:170-217 | lib/features/settings/widgets/custom_license_page.dart:270-307 | lib/shared/layout/app_scaffold.dart:302-351 | lib/shared/layout/app_scaffold.dart:510-549 — These 5 members are variants of one another: a block of 24 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member pair (60 shared lines) · ×1
  • Near-duplicate member pair (60 shared lines) lib/features/tools/vpl/vpl_code_gen.dart:119 — lib/features/tools/vpl/vpl_code_gen.dart:119-374 | lib/features/tools/vpl/vpl_code_gen.dart:460-607 — These two members are variants of one another: 60 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) lib/features/tools/formula_ocr/formula_ocr_tool.dart:242 — lib/features/tools/formula_ocr/formula_ocr_tool.dart:242-471 | lib/features/tools/image_gen/image_gen_tool.dart:193-439 — 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 · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (5 members, 50+ identical tokens) lib/features/knowledge/knowledge_base_page.dart:259 — lib/features/knowledge/knowledge_base_page.dart:259-293 | lib/features/mcp/mcp_page.dart:386-420 | lib/features/models/model_cards_page.dart:181-215 | lib/features/settings/widgets/embedding_section.dart:265-295 | lib/features/skills/skills_page.dart:447-481 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Edited copy of a member (93 corresponding lines) · ×1
  • Edited copy of a member (93 corresponding lines) assets/scripts/paddle_ocr/doc_parse_task.py:25 — assets/scripts/paddle_ocr/doc_parse_task.py:25-117 | assets/scripts/paddle_ocr/ocr_task.py:25-140 — These two members are one piece of code written twice and then edited apart: 93 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (125 corresponding lines) · ×1
  • Edited copy of a member (125 corresponding lines) lib/features/chat/chat_page.dart:1159 — lib/features/chat/chat_page.dart:1159-1283 | lib/features/chat/chat_page.dart:1370-1505 — These two members are one piece of code written twice and then edited apart: 125 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (67 corresponding lines) · ×1
  • Edited copy of a member (67 corresponding lines) assets/office_engine/excel/excel_engine/reader.py:1026 — assets/office_engine/excel/excel_engine/reader.py:1026-1092 | assets/office_engine/word/word_engine/writer.py:1061-1141 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (100 corresponding lines) · ×1
  • Edited copy of a member (100 corresponding lines) lib/features/models/model_card_tile_optimized.dart:79 — lib/features/models/model_card_tile_optimized.dart:79-183 | lib/features/settings/widgets/embedding_section.dart:114-213 — These two members are one piece of code written twice and then edited apart: 100 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (77 corresponding lines) · ×1
  • Edited copy of a member (77 corresponding lines) lib/core/server/api_server.dart:270 — lib/core/server/api_server.dart:270-346 | lib/core/server/api_server.dart:499-592 — These two members are one piece of code written twice and then edited apart: 77 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (61 corresponding lines) · ×1
  • Edited copy of a member (61 corresponding lines) lib/features/mcp/mcp_page.dart:69 — lib/features/mcp/mcp_page.dart:69-129 | lib/features/skills/skills_page.dart:114-196 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) assets/office_engine/excel/excel_engine/cli.py:42 — assets/office_engine/excel/excel_engine/cli.py:42-89 | assets/office_engine/word/word_engine/cli.py:57-112 — 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 (63 corresponding lines) · ×1
  • Edited copy of a member (63 corresponding lines) lib/features/pet/pet_page.dart:765 — lib/features/pet/pet_page.dart:765-827 | lib/features/pet/pet_page.dart:829-893 — These two members are one piece of code written twice and then edited apart: 63 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (47 corresponding lines) · ×1
  • Edited copy of a member (47 corresponding lines) lib/features/settings/widgets/update_dialog.dart:144 — lib/features/settings/widgets/update_dialog.dart:144-190 | lib/features/settings/widgets/update_dialog.dart:327-383 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×1
  • Edited copy of a member (42 corresponding lines) packages/dock_panel/lib/main.dart:293 — packages/dock_panel/lib/main.dart:293-344 | packages/dock_panel/lib/main.dart:584-625 — 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 (38 corresponding lines) · ×1
  • Edited copy of a member (38 corresponding lines) lib/features/settings/settings_page.dart:578 — lib/features/settings/settings_page.dart:578-615 | lib/features/settings/settings_page.dart:622-668 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) lib/features/chat/widgets/markdown_view.dart:469 — lib/features/chat/widgets/markdown_view.dart:469-508 | lib/features/chat/widgets/visualization_cards.dart:262-304 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) lib/core/llm/gemini_client.dart:291 — lib/core/llm/gemini_client.dart:291-321 | lib/core/llm/gemini_client.dart:375-418 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) lib/features/chat/chat_page.dart:1540 — lib/features/chat/chat_page.dart:1540-1572 | lib/features/mcp/mcp_page.dart:307-345 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (28 corresponding lines) · ×1
  • Edited copy of a member (28 corresponding lines) lib/features/tools/flowchart/flowchart_editor.dart:470 — lib/features/tools/flowchart/flowchart_editor.dart:470-497 | lib/features/tools/siyu/siyu_editor.dart:365-392 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) lib/features/history/history_page.dart:147 — lib/features/history/history_page.dart:147-177 | lib/features/history/history_page.dart:179-203 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (24 corresponding lines) · ×1
  • Edited copy of a member (24 corresponding lines) lib/features/experts/experts_page.dart:25 — lib/features/experts/experts_page.dart:25-48 | lib/features/memory/memory_page.dart:10-33 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 23+ corresponding lines) lib/features/experts/experts_page.dart:143 — lib/features/experts/experts_page.dart:143-168 | lib/features/knowledge/knowledge_base_page.dart:100-126 | lib/features/knowledge/knowledge_base_page.dart:979-1001 | lib/features/memory/memory_page.dart:122-147 | lib/features/settings/widgets/embedding_section.dart:70-95 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 26+ corresponding lines) lib/features/mcp/mcp_page.dart:351 — lib/features/mcp/mcp_page.dart:351-378 | lib/features/models/model_card_tile_optimized.dart:277-302 | lib/features/skills/skills_page.dart:342-369 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) lib/features/skills/skills_page.dart:507 — lib/features/skills/skills_page.dart:507-528 | lib/features/toolchain/toolchain_page.dart:433-454 — 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 copies of one member (3 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) lib/features/chat/chat_page.dart:1711 — lib/features/chat/chat_page.dart:1711-1730 | lib/features/chat/chat_page.dart:1906-1927 | lib/features/chat/chat_page.dart:2052-2075 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) lib/features/chat/chat_page.dart:736 — lib/features/chat/chat_page.dart:736-752 | lib/features/multi_agent/widgets/agent_chat_panel.dart:87-101 | lib/features/multi_agent/widgets/command_center.dart:51-63 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 18+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 18+ corresponding lines) packages/dock_panel/lib/src/providers/dock_manager.dart:195 — packages/dock_panel/lib/src/providers/dock_manager.dart:195-212 | packages/dock_panel/lib/src/providers/dock_manager.dart:283-300 | packages/dock_panel/lib/src/providers/dock_manager.dart:302-324 | packages/dock_panel/lib/src/providers/dock_manager.dart:354-372 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×1
  • Edited copy of a member (14 corresponding lines) lib/providers/settings_provider.dart:241 — lib/providers/settings_provider.dart:241-258 | lib/providers/settings_provider.dart:260-273 — 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 copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) lib/core/export/conversation_image_exporter.dart:506 — lib/core/export/conversation_image_exporter.dart:506-510 | lib/core/toolshell/worktree_manager.dart:727-732 | lib/features/memory/memory_page.dart:241-248 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×1
  • Edited copy of a member (11 corresponding lines) lib/core/toolshell/android_executor.dart:271 — lib/core/toolshell/android_executor.dart:271-282 | lib/core/toolshell/system_executor.dart:88-98 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×1
  • Edited copy of a member (16 corresponding lines) lib/features/tools/image_gen/image_gen_tool.dart:32 — lib/features/tools/image_gen/image_gen_tool.dart:32-47 | lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:35-51 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×1
  • Edited copy of a member (6 corresponding lines) lib/core/db/daos/kb_dao.dart:23 — lib/core/db/daos/kb_dao.dart:23-30 | lib/core/db/daos/model_cards_dao.dart:36-41 — 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) lib/core/llm/llm_client.dart:1054 — lib/core/llm/llm_client.dart:1054-1058 | lib/core/llm/models.dart:145-149 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (2 corresponding lines) · ×1
  • Edited copy of a member (2 corresponding lines) lib/core/image/image_agent_service.dart:996 — lib/core/image/image_agent_service.dart:996-997 | lib/core/image/session_image_registry.dart:287-288 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 4+ corresponding lines) lib/core/llm/context_capacity.dart:312 — lib/core/llm/context_capacity.dart:312-315 | lib/core/pet/pet_economy.dart:711-714 | lib/core/shortcuts/shortcut_config.dart:135-138 | lib/features/pet/widgets/floating_pet.dart:403-406 | lib/shared/layout/app_scaffold.dart:183-186 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (67–75 lines × 2) · ×1
  • Duplicated block (67–75 lines × 2) lib/features/tools/formula_ocr/formula_ocr_tool.dart:164 — lib/features/tools/formula_ocr/formula_ocr_tool.dart:164-238 | lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:309-375 — `lib/features/tools/formula_ocr/formula_ocr_tool.dart` and `lib/features/tools/paddle_ocr/paddle_ocr_tool.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 176 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
D4 · Code Duplication · Duplicated block (61 lines × 3) · ×1
  • Duplicated block (61 lines × 3) lib/features/chat/widgets/visualization_cards.dart:120 — lib/features/chat/widgets/visualization_cards.dart:120-180 | lib/features/chat/widgets/visualization_cards.dart:332-392 | lib/features/chat/widgets/visualization_cards.dart:478-538 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/widgets/visualization_cards.dart:120` it does not close everything it opens, so those 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 (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) lib/features/chat/widgets/markdown_view.dart:387 — lib/features/chat/widgets/markdown_view.dart:387-424 | lib/features/chat/widgets/markdown_view.dart:510-547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/widgets/markdown_view.dart:387` it does not close everything it opens, so those 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 (34–36 lines × 2) · ×1
  • Duplicated block (34–36 lines × 2) lib/features/settings/widgets/font_section.dart:260 — lib/features/settings/widgets/font_section.dart:260-293 | lib/features/settings/widgets/font_section.dart:344-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 `lib/features/settings/widgets/font_section.dart:260` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) lib/core/llm/anthropic_client.dart:302 — lib/core/llm/anthropic_client.dart:302-334 | lib/core/llm/anthropic_client.dart:410-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/llm/anthropic_client.dart:302` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (29–31 lines × 2) · ×1
  • Duplicated block (29–31 lines × 2) lib/features/chat/chat_provider.dart:1878 — lib/features/chat/chat_provider.dart:1878-1906 | lib/features/chat/chat_provider.dart:1947-1977 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/chat_provider.dart:1878` it begins part-way through the construct above it, so those 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 (29–30 lines × 2) · ×1
  • Duplicated block (29–30 lines × 2) lib/features/tools/vpl/vpl_code_gen.dart:120 — lib/features/tools/vpl/vpl_code_gen.dart:120-149 | lib/features/tools/vpl/vpl_code_gen.dart:461-489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/vpl/vpl_code_gen.dart:120` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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 (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) lib/core/toolshell/schedule_executor.dart:173 — lib/core/toolshell/schedule_executor.dart:173-199 | lib/core/toolshell/schedule_executor.dart:329-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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–26 lines × 5) · ×1
  • Duplicated block (24–26 lines × 5) lib/features/settings/settings_page.dart:685 — lib/features/settings/settings_page.dart:685-708 | lib/features/settings/widgets/custom_license_page.dart:183-206 | lib/features/settings/widgets/custom_license_page.dart:279-302 | lib/shared/layout/app_scaffold.dart:320-343 | lib/shared/layout/app_scaffold.dart:519-544 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/settings/settings_page.dart:685` 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 (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) lib/features/models/model_card_tile_optimized.dart:191 — lib/features/models/model_card_tile_optimized.dart:191-215 | lib/features/settings/widgets/embedding_section.dart:217-241 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/settings/widgets/embedding_section.dart:217` 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 (24 lines × 4) · ×1
  • Duplicated block (24 lines × 4) lib/features/chat/widgets/visualization_cards.dart:165 — lib/features/chat/widgets/visualization_cards.dart:165-188 | lib/features/chat/widgets/visualization_cards.dart:377-400 | lib/features/chat/widgets/visualization_cards.dart:523-546 | lib/features/chat/widgets/visualization_cards.dart:682-705 — 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 `lib/features/chat/widgets/visualization_cards.dart:165` 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 (22–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) lib/features/chat/widgets/markdown_view.dart:924 — lib/features/chat/widgets/markdown_view.dart:924-947 | lib/features/pet/widgets/pet_bubble.dart:200-221 — 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 (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) lib/features/chat/chat_page.dart:1183 — lib/features/chat/chat_page.dart:1183-1205 | lib/features/chat/chat_page.dart:1395-1417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/chat_page.dart:1183` 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 (22 lines × 3) · ×1
  • Duplicated block (22 lines × 3) lib/features/tools/formula_ocr/formula_ocr_tool.dart:242 — lib/features/tools/formula_ocr/formula_ocr_tool.dart:242-263 | lib/features/tools/image_gen/image_gen_tool.dart:193-214 | lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:388-409 — `lib/features/tools/formula_ocr/formula_ocr_tool.dart` and `lib/features/tools/image_gen/image_gen_tool.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/formula_ocr/formula_ocr_tool.dart:242` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) lib/features/tools/vpl/vpl_code_gen.dart:198 — lib/features/tools/vpl/vpl_code_gen.dart:198-218 | lib/features/tools/vpl/vpl_code_gen.dart:227-246 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/vpl/vpl_code_gen.dart:198` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) lib/features/tools/vpl/vpl_code_gen.dart:537 — lib/features/tools/vpl/vpl_code_gen.dart:537-557 | lib/features/tools/vpl/vpl_code_gen.dart:564-584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/vpl/vpl_code_gen.dart:537` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) lib/features/tools/formula_ocr/formula_ocr_tool.dart:357 — lib/features/tools/formula_ocr/formula_ocr_tool.dart:357-375 | lib/features/tools/image_gen/image_gen_tool.dart:360-378 — `lib/features/tools/formula_ocr/formula_ocr_tool.dart` and `lib/features/tools/image_gen/image_gen_tool.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/formula_ocr/formula_ocr_tool.dart:357` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18 lines × 4) · ×1
  • Duplicated block (18 lines × 4) lib/features/knowledge/knowledge_base_page.dart:262 — lib/features/knowledge/knowledge_base_page.dart:262-279 | lib/features/mcp/mcp_page.dart:389-406 | lib/features/models/model_cards_page.dart:184-201 | lib/features/skills/skills_page.dart:450-467 — `lib/features/mcp/mcp_page.dart` and `lib/features/skills/skills_page.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 46 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/knowledge/knowledge_base_page.dart:262` it does not close everything it opens, so those 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 (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) lib/features/chat/widgets/markdown_view.dart:469 — lib/features/chat/widgets/markdown_view.dart:469-485 | lib/features/chat/widgets/visualization_cards.dart:262-279 — before extracting anything, compare `lib/features/chat/widgets/markdown_view.dart` and `lib/features/chat/widgets/visualization_cards.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/widgets/markdown_view.dart:469` it does not close everything it opens, so those 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 (17 lines × 2) · ×1
  • Duplicated block (17 lines × 2) lib/core/llm/anthropic_client.dart:436 — lib/core/llm/anthropic_client.dart:436-452 | lib/core/llm/gemini_client.dart:402-418 — before extracting anything, compare `lib/core/llm/anthropic_client.dart` and `lib/core/llm/gemini_client.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/llm/anthropic_client.dart:436` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) lib/features/multi_agent/widgets/agent_chat_panel.dart:455 — lib/features/multi_agent/widgets/agent_chat_panel.dart:455-469 | lib/features/multi_agent/widgets/command_center.dart:270-286 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/multi_agent/widgets/agent_chat_panel.dart:455` it begins part-way through the construct above it, so those 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 (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) lib/features/tools/formula_ocr/formula_ocr_tool.dart:335 — lib/features/tools/formula_ocr/formula_ocr_tool.dart:335-351 | lib/features/tools/paddle_ocr/paddle_ocr_tool.dart:501-516 — `lib/features/tools/formula_ocr/formula_ocr_tool.dart` and `lib/features/tools/paddle_ocr/paddle_ocr_tool.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 176 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/tools/formula_ocr/formula_ocr_tool.dart:335` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) lib/features/chat/widgets/markdown_view.dart:844 — lib/features/chat/widgets/markdown_view.dart:844-857 | lib/features/chat/widgets/message_attachments.dart:121-136 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/widgets/markdown_view.dart:844` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) lib/core/llm/gemini_client.dart:304 — lib/core/llm/gemini_client.dart:304-315 | lib/core/llm/gemini_client.dart:394-408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/llm/gemini_client.dart:304` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13–14 lines × 3) · ×1
  • Duplicated block (13–14 lines × 3) lib/features/online_service/online_service_page.dart:171 — lib/features/online_service/online_service_page.dart:171-183 | lib/features/online_service/online_service_page.dart:282-295 | lib/features/online_service/online_service_page.dart:402-414 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/online_service/online_service_page.dart:171` it does not close everything it opens, so those 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, `lib/features/online_service/online_service_page.dart:400` calls `watch` and `lib/features/online_service/online_service_page.dart:169` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) lib/features/tools/vpl/vpl_code_gen.dart:156 — lib/features/tools/vpl/vpl_code_gen.dart:156-168 | lib/features/tools/vpl/vpl_code_gen.dart:193-205 | lib/features/tools/vpl/vpl_code_gen.dart:222-234 | lib/features/tools/vpl/vpl_code_gen.dart:323-335 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `lib/features/tools/vpl/vpl_code_gen.dart:172` calls `writeln` and `lib/features/tools/vpl/vpl_code_gen.dart:209` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) lib/features/chat/widgets/sub_readers_card.dart:21 — lib/features/chat/widgets/sub_readers_card.dart:21-33 | lib/features/chat/widgets/tool_call_card.dart:32-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/widgets/sub_readers_card.dart:21` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (4–13 lines × 4) · ×1
  • Duplicated block (4–13 lines × 4) lib/features/tools/vpl/vpl_code_gen.dart:238 — lib/features/tools/vpl/vpl_code_gen.dart:238-250 | lib/features/tools/vpl/vpl_code_gen.dart:255-258 | lib/features/tools/vpl/vpl_code_gen.dart:262-265 | lib/features/tools/vpl/vpl_code_gen.dart:576-588 — 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 `lib/features/tools/vpl/vpl_code_gen.dart:238` it begins part-way through the construct above it, so those 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 after the matched lines, `lib/features/tools/vpl/vpl_code_gen.dart:250` calls `_resolveInput` and `lib/features/tools/vpl/vpl_code_gen.dart:258` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×1
  • Duplicated block (12 lines × 5) lib/features/knowledge/knowledge_base_page.dart:259 — lib/features/knowledge/knowledge_base_page.dart:259-270 | lib/features/mcp/mcp_page.dart:386-397 | lib/features/models/model_cards_page.dart:181-192 | lib/features/settings/widgets/embedding_section.dart:265-276 | lib/features/skills/skills_page.dart:447-458 — before extracting anything, compare `lib/features/knowledge/knowledge_base_page.dart` and `lib/features/settings/widgets/embedding_section.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/knowledge/knowledge_base_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. 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 (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) lib/features/tools/flowchart/flowchart_editor.dart:457 — lib/features/tools/flowchart/flowchart_editor.dart:457-468 | lib/features/tools/siyu/siyu_editor.dart:352-363 | lib/features/tools/vpl/vpl_editor.dart:542-553 — `lib/features/tools/flowchart/flowchart_editor.dart` and `lib/features/tools/siyu/siyu_editor.dart` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 37 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) lib/features/chat/widgets/markdown_view.dart:394 — lib/features/chat/widgets/markdown_view.dart:394-404 | lib/features/chat/widgets/markdown_view.dart:517-527 | lib/features/chat/widgets/visualization_cards.dart:195-207 | lib/features/chat/widgets/visualization_cards.dart:407-419 — before extracting anything, compare `lib/features/chat/widgets/markdown_view.dart` and `lib/features/chat/widgets/visualization_cards.dart` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/chat/widgets/markdown_view.dart:394` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) lib/core/online_service/online_server.dart:1018 — lib/core/online_service/online_server.dart:1018-1028 | lib/core/online_service/online_server.dart:1044-1054 | lib/core/online_service/online_server.dart:1066-1076 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/online_service/online_server.dart:1018` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–10 lines × 4) · ×1
  • Duplicated block (6–10 lines × 4) lib/core/agent/agent_context.dart:918 — lib/core/agent/agent_context.dart:918-927 | lib/core/agent/agent_context.dart:929-939 | lib/core/agent/agent_context.dart:941-950 | lib/core/agent/agent_context.dart:951-956 — 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 `lib/core/agent/agent_context.dart:929` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) lib/features/history/history_page.dart:157 — lib/features/history/history_page.dart:157-166 | lib/features/history/history_page.dart:185-192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `lib/features/history/history_page.dart:157` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 4) · ×1
  • Duplicated block (9 lines × 4) lib/core/llm/anthropic_client.dart:327 — lib/core/llm/anthropic_client.dart:327-335 | lib/core/llm/anthropic_client.dart:435-443 | lib/core/llm/gemini_client.dart:308-316 | lib/core/llm/gemini_client.dart:401-409 — before extracting anything, compare `lib/core/llm/anthropic_client.dart` and `lib/core/llm/gemini_client.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/llm/anthropic_client.dart:327` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–9 lines × 3) · ×1
  • Duplicated block (7–9 lines × 3) lib/core/llm/anthropic_client.dart:438 — lib/core/llm/anthropic_client.dart:438-446 | lib/core/llm/anthropic_sdk_client.dart:291-297 | lib/core/llm/gemini_client.dart:404-412 — before extracting anything, compare `lib/core/llm/anthropic_client.dart` and `lib/core/llm/gemini_client.dart` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `lib/core/llm/anthropic_client.dart:438` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (71–74 lines × 2) · ×1
  • Duplicated block (71–74 lines × 2) assets/scripts/paddle_ocr/doc_parse_task.py:25 — assets/scripts/paddle_ocr/doc_parse_task.py:25-95 | assets/scripts/paddle_ocr/ocr_task.py:25-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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 (37 lines × 2) · ×1
  • Duplicated block (37 lines × 2) assets/office_engine/excel/excel_engine/reader.py:949 — assets/office_engine/excel/excel_engine/reader.py:949-986 | assets/office_engine/word/word_engine/reader.py:731-767 — 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 (40–42 lines × 2) · ×1
  • Duplicated block (40–42 lines × 2) assets/office_engine/excel/excel_engine/reader.py:1046 — assets/office_engine/excel/excel_engine/reader.py:1046-1085 | assets/office_engine/word/word_engine/writer.py:1092-1133 — 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 `assets/office_engine/excel/excel_engine/reader.py:1046` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (22–26 lines × 2) · ×1
  • Duplicated block (22–26 lines × 2) assets/office_engine/excel/excel_engine/cli.py:49 — assets/office_engine/excel/excel_engine/cli.py:49-70 | assets/office_engine/word/word_engine/cli.py:64-89 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–17 lines × 2) · ×1
  • Duplicated block (13–17 lines × 2) assets/office_engine/excel/excel_engine/protocol.py:53 — assets/office_engine/excel/excel_engine/protocol.py:53-65 | assets/office_engine/word/word_engine/protocol.py:64-80 — 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 `assets/office_engine/word/word_engine/protocol.py:64` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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–8 lines × 2) · ×1
  • Duplicated block (6–8 lines × 2) assets/office_engine/excel/excel_engine/reader.py:915 — assets/office_engine/excel/excel_engine/reader.py:915-922 | assets/office_engine/word/word_engine/reader.py:490-495 — 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 `assets/office_engine/excel/excel_engine/reader.py:915` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: dock_panel — dock_panel: abstractness 0.05, instability 0.00, distance 0.95 — an application entry point, so it is concrete by design — the distance is expected; what is worth checking is that other projects depend on it at all, since a host should be a leaf of the graph.
P1 · CI/CD gates · No CI pipeline · ×1
  • No CI pipeline — No CI workflow found (.github/workflows, azure-pipelines.yml, .gitlab-ci.yml, …) — changes aren't gated by an automated build/test.
P2 · Observability · No structured logging · ×1
  • No structured logging — No logging or diagnostics emission found. This repository ships a binary its users launch rather than a service you operate, so there is no operator to page — but when a run fails on a user's machine, neither they nor you have anything to read.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 0 typed · 10 plain JS — the untyped files are assets/scripts/archify/renderers/architecture/render-architecture.mjs, assets/scripts/archify/renderers/dataflow/render-dataflow.mjs, assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs, assets/scripts/archify/renderers/sequence/render-sequence.mjs, assets/scripts/archify/renderers/shared/cli.mjs, assets/scripts/archify/renderers/shared/geometry.mjs (+4 more).
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (13 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (13 clone groups) assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:88 — 13 duplicated blocks under assets/scripts/archify/renderers/ have copies in at least two of the sibling directories architecture, dataflow, lifecycle, sequence, workflow — 11 of them are reported below, and 2 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 13 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 13 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 13 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 (160 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (160 matched lines × 2 locations) assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:88 — assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:88 · assets/scripts/archify/renderers/workflow/render-workflow.mjs:66 — the two spans are one implementation copied and then locally edited — 1442 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 (91 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (91 matched lines × 2 locations) assets/scripts/archify/renderers/architecture/render-architecture.mjs:113 — assets/scripts/archify/renderers/architecture/render-architecture.mjs:113 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:148 — the two spans are one implementation copied and then locally edited — 900 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 (72 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (72 matched lines × 2 locations) assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:59 — assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:59 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:97 — the two spans are one implementation copied and then locally edited — 901 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 (39 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (39 matched lines × 2 locations) assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:181 — assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:181 · assets/scripts/archify/renderers/workflow/render-workflow.mjs:242 — the two spans are one implementation copied and then locally edited — 419 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 (23 lines × 2 locations) · ×1
  • Duplicated block (23 lines × 2 locations) assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:153 — assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:153 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:200 — 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 × 3 locations) · ×1
  • Duplicated block (15 lines × 3 locations) assets/scripts/archify/renderers/architecture/render-architecture.mjs:286 — assets/scripts/archify/renderers/architecture/render-architecture.mjs:286 · assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:264 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:353 — the 3 copies are spread across 3 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. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication · Duplicated block (11 lines × 4 locations) · ×1
  • Duplicated block (11 lines × 4 locations) assets/scripts/archify/renderers/architecture/render-architecture.mjs:194 — assets/scripts/archify/renderers/architecture/render-architecture.mjs:194 · assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:181 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:236 · assets/scripts/archify/renderers/workflow/render-workflow.mjs:242 — 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 (11 lines × 3 locations) · ×1
  • Duplicated block (11 lines × 3 locations) assets/scripts/archify/renderers/architecture/render-architecture.mjs:218 — assets/scripts/archify/renderers/architecture/render-architecture.mjs:218 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:293 · assets/scripts/archify/renderers/workflow/render-workflow.mjs:276 — 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 (7 lines × 3 locations) · ×1
  • Duplicated block (7 lines × 3 locations) assets/scripts/archify/renderers/architecture/render-architecture.mjs:150 — assets/scripts/archify/renderers/architecture/render-architecture.mjs:150 · assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:122 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:174 — 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 (6 lines × 4 locations) · ×1
  • Duplicated block (6 lines × 4 locations) assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:143 — assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:143 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:195 · assets/scripts/archify/renderers/sequence/render-sequence.mjs:119 · assets/scripts/archify/renderers/workflow/render-workflow.mjs:188 — the 4 copies are spread across 4 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. There is one copy in each of 4 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication · Duplicated block (5 lines × 3 locations) · ×1
  • Duplicated block (5 lines × 3 locations) assets/scripts/archify/renderers/architecture/render-architecture.mjs:140 — assets/scripts/archify/renderers/architecture/render-architecture.mjs:140 · assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:111 · assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:164 — 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.
R11 · Import Boundaries · Boundary violation [package · ×1
  • Boundary violation [package:third-party-deep-import] assets/scripts/archify/renderers/shared/validator.mjs:14 — assets/scripts/archify/renderers/shared/validator.mjs:14 imports ajv/dist/2020.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
R2 · Cyclomatic Complexity · Complex function validateWorkflow (cyclomatic 53, cognitive 77) · ×1
  • Complex function validateWorkflow (cyclomatic 53, cognitive 77) assets/scripts/archify/renderers/workflow/render-workflow.mjs:80 — validateWorkflow has cyclomatic complexity 53 and cognitive complexity 77; 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 validateLifecycle (cyclomatic 53, cognitive 74) · ×1
  • Complex function validateLifecycle (cyclomatic 53, cognitive 74) assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:102 — validateLifecycle has cyclomatic complexity 53 and cognitive complexity 74; 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 validateDataflow (cyclomatic 51, cognitive 70) · ×1
  • Complex function validateDataflow (cyclomatic 51, cognitive 70) assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:64 — validateDataflow has cyclomatic complexity 51 and cognitive complexity 70; 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 validateArchitecture (cyclomatic 49, cognitive 62) · ×1
  • Complex function validateArchitecture (cyclomatic 49, cognitive 62) assets/scripts/archify/renderers/architecture/render-architecture.mjs:91 — validateArchitecture has cyclomatic complexity 49 and cognitive complexity 62; 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 validateSequence (cyclomatic 44, cognitive 62) · ×1
  • Complex function validateSequence (cyclomatic 44, cognitive 62) assets/scripts/archify/renderers/sequence/render-sequence.mjs:48 — validateSequence has cyclomatic complexity 44 and cognitive complexity 62; 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 measureState (cyclomatic 13, cognitive 12) · ×1
  • Complex function measureState (cyclomatic 13, cognitive 12) assets/scripts/archify/renderers/lifecycle/render-lifecycle.mjs:77 — measureState has cyclomatic complexity 13 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 routeVia (cyclomatic 13, cognitive 10) · ×1
  • Complex function routeVia (cyclomatic 13, cognitive 10) assets/scripts/archify/renderers/dataflow/render-dataflow.mjs:160 — routeVia has cyclomatic complexity 13 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 annotatePath (cyclomatic 12, cognitive 16) · ×1
  • Complex function annotatePath (cyclomatic 12, cognitive 16) assets/scripts/archify/renderers/shared/validator.mjs:70 — annotatePath has cyclomatic complexity 12 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.
R6 · Tooling · No test, lint or typecheck script · ×1
  • No test, lint or typecheck 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.
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 packages/highlight/lib/src/compile_keywords.dart:42 — `compileKeywords` is public and takes `dynamic rawKeywords` from its caller, and it calls itself at line 42 (`compileKeywords`) with a piece of `rawKeywords` — and nowhere in `compileKeywords` 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. `jsonDecode` sets no nesting limit: 2 MB of brackets parse to a million levels, while a walk like this one throws `StackOverflowError` from about 20,000 levels — 40,000 bytes (Dart 3.13 VM; on the web the limit is the browser's stack). That is an `Error`, not an `Exception`: an `on Exception catch` around the call does not stop it, so the request, the frame or the isolate fails with it. Thread a depth argument through `compileKeywords` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Minor — 52 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×21
  • Duplicated predicate lib/core/agent/transformers/context_compactor.dart:677 — `content == null || (content is String && content.trim().isEmpty) || (content is List && content.isEmpty)` appears character-identically in 2 files — lib/core/agent/transformers/context_compactor.dart, lib/core/toolshell/agent_loop.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate lib/features/knowledge/knowledge_base_page.dart:522 — `d.status == KbDocStatus.pending || d.status == KbDocStatus.failed` appears character-identically in 2 files — lib/features/knowledge/knowledge_base_page.dart, lib/providers/kb_provider.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate lib/core/agent/agent_context.dart:647 — `explicitPath != null && explicitPath.isNotEmpty` appears character-identically in 2 files — lib/core/agent/agent_context.dart, lib/core/image/image_agent_capability.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate lib/core/image/image_agent_service.dart:743 — `finishReason != null && finishReason != 'STOP'` appears character-identically in 2 files — lib/core/image/image_agent_service.dart, lib/features/tools/image_gen/image_gen_tool.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate lib/core/llm/anthropic_client.dart:473 — `line.isEmpty || !line.startsWith('data:')` appears character-identically in 2 files — lib/core/llm/anthropic_client.dart, lib/core/llm/gemini_client.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate lib/core/agent/agent_context.dart:1227 — `m['role'] == 'user' || m['role'] == 'assistant'` appears character-identically in 3 files — lib/core/agent/agent_context.dart, lib/core/online_service/online_server.dart, lib/core/server/server_session.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate lib/core/mcp/transports/sse_transport.dart:227 — `message.containsKey('id') && message['id'] != null` appears character-identically in 2 files — lib/core/mcp/transports/sse_transport.dart, lib/core/mcp/transports/stdio_transport.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate lib/core/db/daos/conversations_dao.dart:276 — `message.toolCalls != null && message.toolCalls!.isNotEmpty` appears character-identically in 2 files — lib/core/db/daos/conversations_dao.dart, lib/features/chat/widgets/message_bubble.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate lib/core/export/conversation_exporter.dart:160 — `msg.role == ChatRole.assistant && msg.toolCalls != null && msg.toolCalls!.isNotEmpty && (msg.content == null || msg.content!.startsWith('[工具…` appears character-identically in 2 files — lib/core/export/conversation_exporter.dart, lib/features/chat/chat_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 lib/core/agent/transformers/context_compactor.dart:603 — `msg['role'] == 'assistant' && msg['tool_calls'] is List` appears character-identically in 2 files — lib/core/agent/transformers/context_compactor.dart, lib/core/llm/gemini_client.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate lib/core/agent/hooks/memory_store_hook.dart:93 — `result.isEmpty || result.toUpperCase().startsWith('SKIP')` appears character-identically in 2 files — lib/core/agent/hooks/memory_store_hook.dart, lib/core/agent/transformers/context_compactor.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate lib/core/llm/anthropic_client.dart:327 — `status != null && status >= 400 && status < 500 && looksLikeMaxTokensRejected(detail) && _degradeMaxTokens()` appears character-identically in 3 files — lib/core/llm/anthropic_client.dart, lib/core/llm/gemini_client.dart, lib/core/llm/llm_client.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate lib/core/llm/llm_client.dart:55 — `toolCalls != null && toolCalls!.isNotEmpty` appears character-identically in 2 files — lib/core/llm/llm_client.dart, lib/core/llm/models.dart. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate assets/office_engine/excel/excel_engine/cli.py:65 — `action is not None and str(action).lower() != args.command` appears character-identically in 2 files — assets/office_engine/excel/excel_engine/cli.py, assets/office_engine/word/word_engine/cli.py. 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 assets/office_engine/excel/excel_engine/reader.py:1079 — `dest.exists() and request.get("overwrite") is not True` appears character-identically in 2 files — assets/office_engine/excel/excel_engine/reader.py, assets/office_engine/word/word_engine/writer.py. 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 assets/office_engine/excel/excel_engine/reader.py:919 — `isinstance(output_value, str) and output_value.strip()` appears character-identically in 3 files — assets/office_engine/excel/excel_engine/reader.py, assets/office_engine/word/word_engine/reader.py, assets/office_engine/word/word_engine/writer.py. 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 assets/office_engine/excel/excel_engine/reader.py:881 — `max_chars and max_chars > 0 and len(text) > max_chars` appears character-identically in 2 files — assets/office_engine/excel/excel_engine/reader.py, assets/office_engine/word/word_engine/reader.py. 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 assets/office_engine/excel/excel_engine/reader.py:1076 — `not isinstance(dest_value, str) or not dest_value.strip()` appears character-identically in 2 files — assets/office_engine/excel/excel_engine/reader.py, assets/office_engine/word/word_engine/writer.py. 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 assets/office_engine/excel/excel_engine/reader.py:889 — `not isinstance(path_value, str) or not path_value.strip()` appears character-identically in 3 files — assets/office_engine/excel/excel_engine/reader.py, assets/office_engine/word/word_engine/reader.py, assets/office_engine/word/word_engine/writer.py. 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 assets/office_engine/excel/excel_engine/reader.py:1075 — `request.get("dest") or request.get("destination")` appears character-identically in 2 files — assets/office_engine/excel/excel_engine/reader.py, assets/office_engine/word/word_engine/writer.py. 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 assets/office_engine/excel/excel_engine/reader.py:888 — `request.get("path") or request.get("source")` appears character-identically in 2 files — assets/office_engine/excel/excel_engine/reader.py, assets/office_engine/word/word_engine/reader.py. 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 · ×10
  • Silent fallback default in catch assets/office_engine/word/word_engine/reader.py:97 — `_paragraph_text` 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 lib/core/llm/llm_client.dart:946 — `_tryFixIncompleteJson` turns every thrown error into `{}` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/core/memory/memory_manager.dart:666 — `getPointCount` turns every thrown error into `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 lib/core/memory/memory_manager.dart:677 — `listCollections` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/core/memory/memory_manager.dart:707 — `listPoints` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/core/memory/qdrant_service.dart:77 — `storageSize` turns every thrown error into `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 lib/core/toolshell/android_executor.dart:538 — `_currentFocus` turns every thrown error into `''` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/core/toolshell/budget.dart:1026 — `_extractArtifacts` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/core/toolshell/sub_readers_orchestrator.dart:250 — `_parsePlan` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
  • Silent fallback default in catch lib/features/multi_agent/providers/multi_agent_provider.dart:215 — `listSnapshots` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or rethrow it. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch` or in the `///` doc, and the row stops firing.
IC1 · Incompleteness & stubs · Disabled test · ×6
  • Disabled test packages/gpt_markdown/test/bugs/link_url_not_stored_test.dart:20 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test packages/gpt_markdown/test/bugs/link_url_not_stored_test.dart:38 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test packages/gpt_markdown/test/bugs/link_with_title_test.dart:22 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test packages/gpt_markdown/test/bugs/link_with_title_test.dart:36 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test packages/gpt_markdown/test/bugs/link_with_title_test.dart:56 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test packages/gpt_markdown/test/bugs/link_with_title_test.dart:72 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
M4 · Documentation accuracy · README/code drift · ×2
  • README/code drift assets/office_engine/word/README.md:139 — assets/office_engine/word/README.md links to `images/图1.png`, but `assets/office_engine/word/images/图1.png` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
  • README/code drift packages/gpt_markdown/test/README.md:86 — packages/gpt_markdown/test/README.md links to `img.png`, but `packages/gpt_markdown/test/img.png` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
AX6 · Interface segregation · Fat interface · ×1
  • Fat interface: S (1183 abstract methods) lib/l10n/app_localizations.dart:13 — `S` declares 1183 abstract methods: `appTitle`, `navChat`, `navModels`, `navSkills`, `navTools`, `navMultiAgent`, `navExperts`, `navMcp`, `navSettings`, `navHistory`, `navMemory`, `navLogs`, `navPet`, `settingsTitle`, `settingsAppearance`, `settingsTheme`, `settingsAccentColorTitle`, `settingsAccentColorPurple`, `settingsAccentColorGreen`, `settingsAccentColorBlue`, `settingsAccentColorCyan`, `settingsAccentColorTwilight`, `settingsNotifyOnBlur`, `settingsNotifyOnBlurDesc`, `settingsEnterAction`, `settingsEnterSend`, `settingsEnterNewline`, `settingsEnterSendHint`, `settingsEnterNewlineHint`, `settingsStorage`, `settingsDatabasePath`, `settingsHistoryPath`, `settingsSkillsPath`, `settingsLogsPath`, `settingsToolPaths`, `settingsPandocPath`, `settingsPandocNotDetected`, `settingsQdrant`, `settingsEmbedding`, `settingsAbout`, and 1143 more. Counted over its public methods with no body, once per name; concrete methods and `_`-private members are not counted, because no implementer that extends it is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
C2 · Access Controls · Thin authorization enforcement · ×1
  • Thin authorization enforcement — Only 1 place(s) refuse an unauthorized caller — too few to demonstrate default-deny across handlers.
D19 · Documentation Quality · Documentation · ×1
  • Documentation: no map of the repository's parts README.md:1 — The repository has 5 units (`archify`, `dock_panel`, `flutter_highlight`, `gpt_markdown`, `highlight`); `README.md` and the documents it links name none of them. Add a short list of the parts and what each does.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found packages/dock_panel/lib/main.dart:6 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `packages/dock_panel/lib/main.dart` makes this repository a deployable product (line 6).
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion pubspec.yaml:1 — `(repository root)` (71426 LoC, 404 module-visible types across 78 directories) overshoots its size bounds. 1 of 8 build unit(s) (Python, npm, pub) overshoot their size bounds, lowering Project Cohesion to 7.5/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.
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 — No static application security testing detected. For this repository's stack, add the Dart analyzer's security lints plus `semgrep --config=auto` — this repository has no CI pipeline yet, so run it locally to clear the existing findings, then make it a step of the first workflow you add so a regression fails the build. What was searched, so you can tell an absence from a miss: the 0 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation assets/scripts/archify/package.json:11 — `assets/scripts/archify/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`.
S1 · Web-Security Posture · No app-layer HTTPS enforcement detected · ×1
  • No app-layer HTTPS enforcement detected — This repository runs an HTTP server that is not bound to the loopback interface alone — or binds it at an address its source does not spell out — and nothing in its Dart source secures the transport: no `HttpServer.bindSecure` or `securityContext:`, no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: lib/core/server/api_server.dart:53 — `HttpServer.bind(`.
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Dart server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: lib/core/server/api_server.dart:53 — `HttpServer.bind(`.
X2 · Cancellation propagation · Not all functions that make a request accept a CancelToken · ×1
  • Not all functions that make a request accept a CancelToken — Only 3/37 functions that make a cancellable request (Dio, AbortableRequest) accept a CancelToken or pass one on, so a request keeps running after whatever wanted it has given up — a screen navigated away from, a disposed widget, a superseded search. Take a `CancelToken? cancelToken` and hand it to the request as `cancelToken:` (or hold one and cancel it in `dispose`); where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×1
  • Hand-rolled JSON/XML parsing via regex lib/features/multi_agent/providers/multi_agent_provider.dart:995 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Dart code already uses a real parser in the same package; use it here too.
Minor — 8 finding(s)
D12 · Dependency Hygiene · Outdated · ×8
  • Outdated: archive — `archive` is locked at 4.0.9 but 4.7.1 is the current stable release on pub.dev, and it already satisfies the `^4.0.2` constraint declared in pubspec.yaml — so the lockfile is behind this repository's own declared range. Run `dart pub upgrade archive` and commit the updated pubspec.lock.
  • Outdated: dio — `dio` is locked at 5.10.0 but 5.11.1 is the current stable release on pub.dev, and it already satisfies the `^5.7.0` constraint declared in pubspec.yaml — so the lockfile is behind this repository's own declared range. Run `dart pub upgrade dio` and commit the updated pubspec.lock.
  • Outdated: flutter_mobx — `flutter_mobx` is locked at 2.3.0 but 2.4.0 is the current stable release on pub.dev, and it already satisfies the `^2.2.1` constraint declared in pubspec.yaml — so the lockfile is behind this repository's own declared range. Run `dart pub upgrade flutter_mobx` and commit the updated pubspec.lock.
  • Outdated: flutter_quill — `flutter_quill` is locked at 11.5.1 but 11.6.0 is the current stable release on pub.dev, and it already satisfies the `^11.5.1` constraint declared in pubspec.yaml — so the lockfile is behind this repository's own declared range. Run `dart pub upgrade flutter_quill` and commit the updated pubspec.lock.
  • Outdated: flutter_svg — `flutter_svg` is locked at 2.3.0 but 2.4.0 is the current stable release on pub.dev, and it already satisfies the `^2.0.10+1` constraint declared in pubspec.yaml — so the lockfile is behind this repository's own declared range. Run `dart pub upgrade flutter_svg` and commit the updated pubspec.lock.
  • Outdated: html — `html` is locked at 0.15.6 but 0.15.7 is the current stable release on pub.dev, and it already satisfies the `^0.15.4` constraint declared in pubspec.yaml — so the lockfile is behind this repository's own declared range. Run `dart pub upgrade html` and commit the updated pubspec.lock.
  • Outdated: mobx — `mobx` is locked at 2.6.0 but 2.7.0 is the current stable release on pub.dev, and it already satisfies the `^2.4.0` constraint declared in pubspec.yaml — so the lockfile is behind this repository's own declared range. Run `dart pub upgrade mobx` and commit the updated pubspec.lock.
  • Outdated: url_launcher — `url_launcher` is locked at 6.3.2 but 6.3.3 is the current stable release on pub.dev, and it already satisfies the `^6.3.2` constraint declared in pubspec.yaml — so the lockfile is behind this repository's own declared range. Run `dart pub upgrade url_launcher` and commit the updated pubspec.lock.

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-97efd779024e444f863e4560af80b513/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-97efd779024e444f863e4560af80b513/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 --exclude packages/flutter_highlight/lib/themes --exclude packages/highlight/lib/languages .0artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .1artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .2artifacts/raw/trivy-config.json
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) — `assets/scripts/archify/renderers/shared/utils.mjs` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D36 · Supply-chain Provenance & Signingprovenance—provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.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 01a1e979-6ff8-7acc-bb1c-03ef394cf7cd · 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