Public report — Planet, published 1 Oct 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this surveyFiledcd_dc9fd69279784ad3a339b855e685298d
Filed 1 October 2026, 10:19 UTC
Public
Medium · 64,576 LoC · 4 projects · rebuild ~0.4 person-years · weakest lens: Readiness (36%)
Findings by grade
71 critical599 serious47 minor42 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
1 October 2026, 10:16 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
662findings with an exact file:lineof 717 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
44/119dimensions across the health lenses64576 LoC · 4 projects — wide & deep
Preview (pre-1.0). This repo hasn't declared a stable release, so it's judged against a relaxed, pre-production bar.
The system holds an adequate standing with a health score of 47%, indicating a workable asset carrying significant operational risk. While the architecture is sound, the low readiness score suggests the team lacks confidence in deploying changes safely, which threatens delivery speed and reliability. This medium-sized system, comprising roughly 65,000 lines of production code, represents a modest investment of approximately 0.4 person-years to rebuild, valued at around €59,000. The business value is concentrated in a codebase that is difficult to operate reliably, making immediate stabilization critical to protect this asset.
The most pressing theme is operational fragility. With a readiness score of 36%, the system lacks the testing, observability, and disaster recovery procedures needed for safe production use. This creates a high risk of prolonged outages and data loss, as backups alone do not constitute a recovery plan. Without addressing this, every release carries a disproportionate risk of failure, potentially leading to costly incident response and reputational damage. The team is effectively flying blind, unable to quickly detect or resolve issues when they arise.
A secondary theme is the hidden cost of technical debt. Code quality signals indicate a complexity tax that slows down every change, adding an estimated 6–13% effort to modifications. This drag compounds over time, making the system increasingly expensive to maintain and slower to adapt to new business requirements. While the architecture is robust, the lack of clarity and cohesion in the code means new engineers will struggle to contribute effectively, further increasing the velocity tax and long-term maintenance costs.
Despite these risks, the system benefits from a solid architectural foundation and a relatively small, manageable size. The low boilerplate content suggests the codebase is focused on business logic rather than infrastructure overhead. To maximize leverage, the team should first integrate static analysis into the continuous integration pipeline to catch security regressions early. This single step offers the highest return on effort, preventing future vulnerabilities and establishing a baseline for code quality. Subsequent efforts should focus on improving test coverage and documenting recovery procedures to stabilize operations.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
123 finding(s) are new versus the previous scan (2026-09-15) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
0.7× (at 47% quality) — the last 20% of quality is most of the work
Size & shape
Medium · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~0.4 person-years of build effort (about ~€59,000 to rebuild). Its weakest lens is Readiness at 36% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Resolve the 5 Floating branch dependency finding(s) in Dependency Hygiene.
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
Value concentrated against a weak lens · High · Value at risk
This is a Medium asset (~0.4 person-years to rebuild), and its weakest lens is Readiness at 36%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Readiness first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 5.8/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 6–13% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 5.8/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
The top fix pays for itself · Medium · Economics
The top-ranked fix costs roughly 1–3 engineer-days once. Not doing it costs about 0–0.2 engineer-days every year, paid as drag on the ~182 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 78–1406 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 6–13% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 45 line(s) changed over a 90-day window ⇒ ~182/year · D1/D2/D4/D6 code quality: averaging 5.8/10 ⇒ a 6–13% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 1406 months.
At a glance — Code Health · 75% · Adequate · gated by D2 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A03:2021 — Injection
67
High / Critical
Roadmap
First, integrate automated security scanning into the CI pipeline to block regressions and enforce timeouts and retry logic on all outbound HTTP calls to prevent indefinite hangs. Second, document disaster recovery procedures with clear recovery targets and implement manual approval gates for releases to allow human intervention before bad builds reach users. Finally, ensure every release is traceable by stamping a version number in the build manifest or using semantic versioning tags.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 5 Floating branch dependency finding(s) in Dependency Hygiene.
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
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.
Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.
Consider OpenTelemetry tracing/metrics (swift-otel with swift-distributed-tracing) and a health-check endpoint (a /health route on your Vapor/Hummingbird router) for operability.
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 — 71
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 — 599
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 — 47
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 42
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
Watchdog 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. 41 of 44 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 3 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three 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; ◐ Advisory — an LLM prose judgement. 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; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 44 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 662 of 717 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Swift Package.swift/Package.resolved, but the licence verdict published here was taken over its Python distribution dependencies. Nothing was read about its SwiftPM dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is engineering on that marker — no change to the scan image can close it.
D26 Project Cohesion — not measured this run — Watchdog 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. Project size and spread are measured over build units (a .NET project, a Maven or Gradle module, an npm package, a Go module, a Cargo crate, a Python, Composer, Bundler, Mix, rebar3, sbt, SwiftPM or pub package) whose source a code model reads. This repository's production source is in a language no model reads, or in units whose build tool D26 does not recognise. That is a gap in this analyzer's language reach — not a finding that the repository's projects are cohesive.
D30 Dependency Vulnerabilities — not measured this run — Watchdog 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. Osv: osv-scanner exited 1 with no findings — dependency CVEs were not measured. 'osv-scanner' exited 1 and produced no findings, and that exit code has no documented repo-side meaning — so this run measured nothing, and nothing here is a statement about the repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog 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. `Planet/API/PlanetAPILogMiddleware.swift`, `Planet/Entities/FollowingPlanetModel.swift`, `Planet/Entities/MyPlanetModel.swift`, `Planet/Entities/PlanetStore+Timer.swift`, `Planet/Entities/PlanetStore.swift`, … (+20 more) 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.
D43 Malicious Dependencies — not measured this run — Watchdog 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. Osv: osv-scanner exited 1 with no findings — dependency CVEs were not measured. 'osv-scanner' exited 1 and produced no findings, and that exit code has no documented repo-side meaning — so this run measured nothing, and nothing here is a statement about the repository.
AX6 Interface segregation — not measured this run — Watchdog 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 is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog 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: 5 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, or an npm dev script. None was found, 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. Watchdog then boots 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
GD1 Unfinished & placeholder code — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
P10 Library API & versioning — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads NuGet packaging and C# public API, and npm, PyPI, crates.io, Maven/Gradle, Go module, RubyGems, Composer, SwiftPM, pub.dev and Hex package manifests only, and no .NET project and no package manifest of those ecosystems was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
PF3 Async & latency hygiene — not measured this run — Watchdog 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. Those languages colour their functions async, so blocking inside them is the same defect this card counts elsewhere, but their blocking vocabulary is not modelled yet. That is a gap in this analyzer's language reach — not a finding that the code is free of it.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X1 Async correctness — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X12 Unreachable branch — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X13 Undrained process stream — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X14 Bypassable address classification — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X16 Unfloored truncation loop — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X19 Unrestored process-global state — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X2 Cancellation propagation — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X20 Mistyped argument guard — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X21 Side-effecting pattern guard — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X22 Contradicted release guard — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X23 Unguarded diagnostic materialisation — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript and Java source only, and no C# was loaded and no JavaScript/TypeScript or Java was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript and Java source only, and no C# was loaded and no JavaScript/TypeScript or Java was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Kotlin and Scala source only, and no C# was loaded, no Java, Kotlin or Scala was found, and this repository's Python, Swift is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java and Rust source only, and no C# was loaded and no Java or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Scala source only, and no C# was loaded and no Scala was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X3 Exception handling — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Scala source only, and no C# was loaded and no Scala was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — Watchdog 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 is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X7 Silent fallback defaults — not measured this run — Watchdog 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. X7 measured the part of this repository it reads (C#, Python, TypeScript/JavaScript, Rust, Go, Java and Kotlin), and its Swift source is outside the check's reach, so the card covers only part of the product. That is a gap in this analyzer's language reach — not a finding that the unread source is free of silent defaults.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does 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.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
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.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
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: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
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".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (3): D19, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
73 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ArticleAIChatView.parseCompletionStepFromStreamingBytes at 172. A further 2 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being PlanetError.errorDescription at 54 — they are counted neither in the figure above nor in this dimension's score. 2 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: Planet/PlanetError.swift (PlanetError.errorDescription at 54), Planet/Writer/VideoAttachmentInfo.swift (VideoAttachmentInfo.codecName at 17). 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.
+ 68 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 ArticleAIChatView.parseCompletionStepFromStreamingBytes (cyclomatic 172) finding(s) in Cyclomatic Complexity — start with ArticleAIChatView.swift. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 MyPlanetModel.== (cyclomatic 77) finding(s) in Cyclomatic Complexity — start with MyPlanetModel.swift. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 MyPlanetModel.importBackup (cyclomatic 66) finding(s) in Cyclomatic Complexity — start with MyPlanetModel.swift. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 128 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 ArticleAIChatView.parseCompletionStepFromStreamingBytes (cognitive 303) finding(s) in Cognitive Complexity — start with ArticleAIChatView.swift. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 MyPlanetModel.savePublic (cognitive 140) finding(s) in Cognitive Complexity — start with MyPlanetModel.swift. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 FollowingPlanetModel.update (cognitive 103) finding(s) in Cognitive Complexity — start with FollowingPlanetModel.swift. — One of this dimension's main actionable groups (1 warning-level).
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.1 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 38 MethodTooLong finding(s) in God Classes — start with MyPlanetModel.swift (5), ArticleAIChatView.swift (4), MyPlanetEditView.swift (2). — One of this dimension's main actionable groups (38 warning-level).
Resolve the 17 FileTooLong finding(s) in God Classes — start with ArticleAIChatView.swift, MyPlanetModel.swift, FollowingPlanetModel.swift. — One of this dimension's main actionable groups (17 warning-level).
Resolve the 15 ClassTooLong finding(s) in God Classes — start with ArticleAIChatView.swift, MyPlanetModel.swift, FollowingPlanetModel.swift. — One of this dimension's main actionable groups (15 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
213 duplicated block group(s) detected. A further 13 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 90 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 14 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with FollowingArticleModel.swift, MyArticleModel+Save.swift, MyPlanetModel.swift. — One of this dimension's main actionable groups (14 warning-level).
Resolve the 13 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with ArticleAIChatView.swift (2), ArticleAIChatWindowManager.swift (2), WriterTextView.swift (2). — One of this dimension's main actionable groups (13 warning-level).
Resolve the 13 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with ArticleAIChatView.swift (2), PlanetAPILogMiddleware.swift, FollowingArticleModel.swift. — One of this dimension's main actionable groups (13 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
4 production modules (Xcode), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; a workspace's implicit (product-name) dependency is not visible there; 0 module(s) off the main sequence, with abstractness counted on 2 of the 4 (the rest declare no modelled class or interface, export only macros, or have no source directory of their own).
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 22 Low cohesion finding(s) in Cohesion (LCOM4) — start with PNError.swift, PlanetAppDelegate.swift, IPFSDaemon.swift. — One of this dimension's main actionable groups (22 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
11 test methods: 11 unit, 0 integration, 0 BDD, 0 e2e.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality8.2 / 10Strong✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
Resolve the 1 Skipped test finding(s) in Test Quality — start with PNDiskStoreTests.swift. — One of this dimension's main actionable groups (1 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
33 outdated direct SwiftPM dependencies, 5 pinning defect(s). 49 of 54 direct dependencies had their releases listed (0 naming no readable repository, 5 pinned to a branch or a revision rather than a version). SwiftPM has no package registry: a dependency is a repository URL and its releases are that repository's semver tags, so currency is answered by listing tags rather than by querying an index. Only a newer tag on the SAME MAJOR is reported — a `from:` requirement admits everything below the next major and nothing above it, so a major crossing needs a Package.swift edit rather than an update, and naming the update as its remedy would be wrong. Whether any dependency is DEPRECATED or ABANDONED is not graded and cannot be: a repository publishes no such marker, and there is no registry that could carry one. Known CVEs in this dependency graph are D30's question.
Resolve the 5 Floating branch dependency finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (5 warning-level).
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 16 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 3 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (13 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 2 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's Python distribution dependencies and nothing else. The repository also declares a Swift Package.swift/Package.resolved, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
66 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is Planet/Views/Articles/ArticleAIChatView.swift. Counted over 172 of the 268 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)
What to do
Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
39 deducted task-comment markers across 64576 LoC (0.1/KLoC) → score 9.9. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 38 TodoComment finding(s) in Explicit Debt — start with ArticleWebViewModel.swift (4), FeedUtils.swift (3), WalletManager.swift (3). — One of this dimension's main actionable groups (38 warning-level).
Resolve the 1 FixmeComment finding(s) in Explicit Debt — start with FollowingArticleModel.swift. — One of this dimension's main actionable groups (1 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The Planet root README is clear and well-structured: a one-line overview of what Planet does (peer-to-peer publishing with .eth ENS), an image showing the planetable.eth landing page, features listed as bullet points with links to external standards like EIP-1577, a Sites Using Planet list, and a build-time feature flags section. The three tool READMEs document their own directories rather than the repository (e.g., /save-session is a directory README), so they are not flagged for missing overview/installation/usage/contributing; the only visible defect is that no architecture or design documentation exists among the files, which would fall under 'missing-architecture-docs'.
What to do
Improve Documentation Quality — currently 7.0/10. — The Planet root README is clear and well-structured: a one-line overview of what Planet does (peer-to-peer publishing with .eth ENS), an image showing the planetable.eth landing page, features listed as bullet points with links to external standards like EIP-1577, a Sites Using Planet list, and a build-time feature flags section. The three tool READMEs document their own directories rather than the repository (e.g., /save-session is a directory README), so they are not flagged for missing overview/installation/usage/contributing; the only visible defect is that no architecture or design documentation exists among the files, which would fall under 'missing-architecture-docs'.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
67 finding(s): 0 critical, 65 high, 1 medium, 1 low. 14 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 9 file(s) — `Planet/Entities/PlanetStore.swift` (line 130), `Planet/Labs/Published Folders/PlanetPublishedServiceStore.swift` (line 297, line 298, line 301, …), `Planet/Labs/Wallet/WalletManager.swift` (line 288), `Planet/Quick Share/PlanetQuickShareViewModel.swift` (line 281), `Planet/Views/Articles/ArticleAIChatView.swift`, … (+4 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 4 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 28 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (9), REDACTED (9), REDACTED (9). — One of this dimension's main actionable groups (28 issue-level).
Resolve the 18 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (6), REDACTED (6), REDACTED (4). — One of this dimension's main actionable groups (18 issue-level).
No action in Static Analysis (SAST) — all 14 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (14 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
29 of 172 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift. Counted over 172 of the 268 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with PFDashboardWindowController.swift. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 8 Change coupling finding(s) in Change Coupling — start with PFDashboardContentView.swift, MyArticleModel+Save.swift, PFDashboardView.swift. — One of this dimension's main actionable groups (8 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 3 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.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC2 · Forms & labels10.0 / 10Exemplary○ Nothing flagged
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
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>. (×2) — REDACTED:2, Planet/Templates/NoSelection.html:2
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×3) — Planet/Templates/NoSelection.html:2, Planet/Templates/TemplatePlaceholder.html:2, Planet/Templates/WriterBasic.html:2
A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. (×2) — Planet/Templates/NoSelection.html:2, Planet/Templates/TemplatePlaceholder.html:2
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
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.
This stylesheet animates but never checks prefers-reduced-motion, so motion-sensitive users can't opt out. Wrap motion in @media (prefers-reduced-motion: no-preference). — Planet/Templates/TemplatePlaceholder.html:4
`hr` sets color: #2b2b2d on background-color: #2b2b2d — 1.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — Planet/Templates/WriterBasic.html:11
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.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no accessibility linting at author time and no automated accessibility check in tests or CI. Add your UI toolkit's own accessibility assertion to the test suite (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in the pipeline. What was searched, so you can tell an absence from a miss: the 5 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain your project already uses: assert accessibility in your UI test suite with your toolkit's own matcher (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in CI so a regression blocks the merge.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
`PlanetAPIController` serves requests (Vapor route handlers run concurrently — SwiftNIO serves one event loop per core and async handlers run on the cooperative thread pool — and every request shares the one `PlanetAPIController` instance the router holds) but writes shared state outside any lock (PlanetStore.shared; e.g. `PlanetStore.shared` in `routeCreatePlanet` at line 628). Unsynchronised concurrent writes are a data race in Swift: an update is lost, and a concurrent Array or Dictionary write corrupts its storage. — REDACTED:11
What to do
Swift: move the state handlers share into an actor, or guard it with a lock held for the whole update (NIOLockedValueBox, Mutex, or NSLock with `defer { lock.unlock() }`) or an atomic (ManagedAtomic); keep per-request data in locals or `req.storage`. Building in the Swift 6 language mode makes the compiler reject an unsynchronised capture.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
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.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a 'Testing' section to the root README — how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
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 significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
What to do
Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
README claims a sandboxed macOS app built with SwiftUI 3 but the evidence shows no such project — searched for: `SwiftUI 3`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest files (package.json, *.csproj, *.props, *.slnx, *.yml, Dockerfile); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong.
What to do
Reconcile the README with reality: README claims a sandboxed macOS app built with SwiftUI 3 but the evidence shows no such project.
Do you agree with this assessment?
P1 · CI/CD gates7.0 / 10Strong✓ 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.
A CI pipeline exists but no test-runner invocation (your stack's test command, or a test job) was found — changes may merge without the suite running.
What to do
Run the test suite in CI via an explicit runner step (`xcodebuild test` for the toolchain this pipeline already uses) and gate merges on it.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Consider OpenTelemetry tracing/metrics (swift-otel with swift-distributed-tracing) and a health-check endpoint (a /health route on your Vapor/Hummingbird router) for operability.
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 CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 26837 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.
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
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.
Do you agree with this assessment?
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
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.
What to do
Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`urllib.request.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. 3 of the 3 files that make outbound calls are unbounded; the first 3 are listed. — tools/claude-code-skill/save_session.py:30
`requests.Session(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — tools/generate-sparkle-notes/planet.py:11
`urllib.request.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — tools/save-session/scripts/save_session.py:66
What to do
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 10 of 55 WCAG 2.2 Level A/AA success criteria (18%; ≈20% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 45 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
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.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
Not included — 72 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AC5 ARIA correctness — No ARIA usage found in the parsed markup — AC5 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's Swift imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
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: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D11 Test Reliability — Test source is present (.swift) and this repository's suite is reachable only from an Apple platform: it ships Planet.xcodeproj and no SwiftPM manifest, so it is built by Xcode rather than by `swift test`. The analyzer runs on Linux, where no simulator exists, so the suite was not re-run. Not scored: nothing was exercised.
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. 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 — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — D26 measured no build unit over this repository's .py, .swift source. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D27 Navigability — symbol resolution incomplete — navigability not assessed
D30 Dependency Vulnerabilities — Scanner failed to run — not a clean result
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 25 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D43 Malicious Dependencies — Scanner failed to run — not a clean result
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage NOT MEASURED: this repository's test suite is reachable only from an Apple platform — it ships Planet.xcodeproj and no SwiftPM manifest, so it is built by Xcode rather than by `swift test`. The analyzer runs on Linux, where no simulator exists, so the suite was not run and no coverage was instrumented. Not scored. To have the real number read, produce a coverage report in a standard format (lcov — `swift test --enable-code-coverage` (SwiftPM) or `xcodebuild test -scheme <YourScheme> -enableCodeCoverage YES` (an .xcodeproj/.xcworkspace suite), then `xcrun llvm-cov export -format=lcov`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures.
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, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P10 Library API & versioning — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `swift test --enable-code-coverage` (SwiftPM) or `xcodebuild test -scheme <YourScheme> -enableCodeCoverage YES` (an .xcodeproj/.xcworkspace suite), then `xcrun llvm-cov export -format=lcov`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `Benchmark("…")` in a file importing package-benchmark, or package-benchmark in Package.swift, 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 applicable: allocation awareness is rated where code engineers for it — at least 400 production lines that ship benchmarks or already use allocation-aware idioms (8 or more). This repository's Swift has 69,364 production line(s), 7 such use(s) and no benchmarks, so there is no allocation work to rate. The card is reward-only: its absence costs nothing.
PF3 Async & latency hygiene — Sync-over-async was not assessed: this repository's async code is written in Swift, whose blocking calls this check does not model yet. That is a gap in the analyzer's language reach, not a finding about your code.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X10 Duplicated predicate — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X24 Document value interpolated into markup unescaped — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X25 Inert configuration knob — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X26 Unsynchronised callback handoff — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X27 Collection changed while being enumerated — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X28 Index access outside its own emptiness guard — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X29 Per-element action decided by a fixed element — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X30 Support guard that admits what it rejects — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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 — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
<html> without a lang Planet/Templates/NoSelection.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang Planet/Templates/TemplatePlaceholder.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang Planet/Templates/WriterBasic.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC3 · Page structure· Document without a <title> · ×2
Document without a <title> Planet/Templates/NoSelection.html:2— A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
Document without a <title> Planet/Templates/TemplatePlaceholder.html:2— A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
Orphaned knowledge Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
TodoComment REDACTED:739— // TODO: What if the saveToArticle operation is a Task.detached? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Downloads/PlanetDownloadsViewModel.swift:21— // MARK: TODO: handle downloads history. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Entities/MyPlanetModel.swift:3977— // TODO: Is this the best way to check if a planet is pinned? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Entities/MyPlanetModel+Aggregate.swift:1015— // TODO: Extract summary — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Entities/MyPlanetModel+Aggregate.swift:1016— // TODO: Reuse original ID is dangerous if user do not understand the full implications — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Entities/MyArticleModel.swift:14— // TODO: Use more runtime flags to optimize the time to rebuild Planet — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Entities/MyArticleModel+SavePublic.swift:45— // TODO: Fix a potential crash here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Entities/FollowingArticleModel.swift:242— // TODO: Fix how type 0 planet was mishandled as a dnslink — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Helper/ViewUtils.swift:52— // TODO: SwiftUI Image has `resizable` and `aspectRatio` modifier, check if these options can resize image for us — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Helper/FeedUtils.swift:56— // TODO: Make an UI for this choice — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Helper/FeedUtils.swift:429— // TODO: Should prefer HTML from the feed — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Helper/FeedUtils.swift:441— // TODO: Extract og:image and put it here — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Helper/Extensions.swift:170— // TODO: Control this with a xcconfig — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/IPFS/Open Views/IPFSOpenView.swift:106— // TODO: What if user simply pastes an http:// or https:// link?
TodoComment Planet/Labs/Quick Post/QuickPostView.swift:304— // TODO: Support tags in Quick Post — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Labs/Wallet/WalletManager.swift:301— // TODO: Save the transaction — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Labs/Wallet/WalletManager.swift:361— // TODO: code for handling Sign — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Labs/Wallet/WalletManager.swift:362— // TODO: Since Sign can work with MetaMask, we'll remove Auth after Sign is fully working. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Labs/Wallet/TipSelectView.swift:61— // TODO: If we want to allow users to switch network, we need to add this back, and pass the chain ID to the send function — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Quick Share/PlanetQuickShareViewModel.swift:167— // TODO: handle mp3 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Quick Share/PlanetQuickShareView.swift:50— // TODO: move this func to MyPlanetModel — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Quick Share/PlanetQuickShareView.swift:51— // TODO: Consolidate duplicated code in MyArticleItemView — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/TemplateBrowser/TemplateBrowserSidebar.swift:90— // TODO: Needs a general method for opening template in various installed apps. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/TemplateBrowser/Template.swift:130— // TODO: A more detailed documentation about the template structure — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment Planet/Views/Articles/ArticleWebViewModel.swift:73— // TODO: Include an example here — 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.
MethodTooLong: ArticleAIChatView.parseCompletionStepFromStreamingBytes Planet/Views/Articles/ArticleAIChatView.swift:3554— MethodTooLong — parseCompletionStepFromStreamingBytes runs 422 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 322 over it, 4.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MyPlanetModel.savePublic Planet/Entities/MyPlanetModel.swift:2185— MethodTooLong — savePublic runs 364 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 264 over it, 3.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: MyPlanetModel.importBackup Planet/Entities/MyPlanetModel.swift:1470— MethodTooLong — importBackup runs 262 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FollowingPlanetModel.update Planet/Entities/FollowingPlanetModel.swift:1018— MethodTooLong — update runs 239 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 139 over it, 2.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: MyPlanetEditView.body Planet/Views/My/MyPlanetEditView.swift:849— MethodTooLong — body runs 222 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 122 over it, 2.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MyPlanetSidebarItem.body Planet/Views/Sidebar/MyPlanetSidebarItem.swift:10— MethodTooLong — body runs 221 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 121 over it, 2.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ArticleAIChatView.requestReply Planet/Views/Articles/ArticleAIChatView.swift:2839— MethodTooLong — requestReply runs 195 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 95 over it, 1.95× 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: MyArticleItemView.body Planet/Views/My/MyArticleItemView.swift:7— MethodTooLong — body runs 195 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 95 over it, 1.95× 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: PlanetSidebarView.body Planet/Views/Sidebar/PlanetSidebarView.swift:25— MethodTooLong — body runs 161 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 61 over it, 1.61× 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: WalletManager.setupV2 Planet/Labs/Wallet/WalletManager.swift:191— MethodTooLong — setupV2 runs 160 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ArticleAIChatView.aiToolDefinitions Planet/Views/Articles/ArticleAIChatView.swift:4388— MethodTooLong — aiToolDefinitions runs 159 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 59 over it, 1.59× 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: PlanetSettingsAIView.body Planet/Settings/PlanetSettingsAIView.swift:88— MethodTooLong — body 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: PFDashboardWindowController.toolbar Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:201— MethodTooLong — toolbar 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: ArticleAIChatView.body Planet/Views/Articles/ArticleAIChatView.swift:383— MethodTooLong — body runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MyArticleGridView.body Planet/Views/My/MyArticleGridView.swift:16— MethodTooLong — body 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: MyArticleSettingsView.body Planet/Views/My/MyArticleSettingsView.swift:51— MethodTooLong — body 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: WalletAccountView.body Planet/Labs/Wallet/WalletAccountView.swift:29— MethodTooLong — body runs 135 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MyPlanetModel.exportBackup Planet/Entities/MyPlanetModel.swift:3323— MethodTooLong — exportBackup runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× 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: Template.renderPreview Planet/TemplateBrowser/Template.swift:580— MethodTooLong — renderPreview runs 128 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MyPlanetCustomCodeView.body Planet/Views/My/MyPlanetCustomCodeView.swift:55— MethodTooLong — body runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AppSidebarItemView.body PlanetLite/AppSidebarItemView.swift:145— MethodTooLong — body runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MyPlanetModel.performPublish Planet/Entities/MyPlanetModel.swift:2784— MethodTooLong — performPublish 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: MyPlanetEditView.publishingTab Planet/Views/My/MyPlanetEditView.swift:230— MethodTooLong — publishingTab 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: AppContentView.body PlanetLite/AppContentView.swift:27— MethodTooLong — body 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.
MethodTooLong: DraftModel.saveToArticle Planet/Entities/DraftModel.swift:433— MethodTooLong — saveToArticle runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Low cohesion: String (LCOM4 15) PlanetCLI/PNError.swift:32— String's methods fall into 15 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 15 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: PlanetAppDelegate (LCOM4 14) Planet/PlanetAppDelegate.swift:12— PlanetAppDelegate's methods fall into 14 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 14 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: IPFSDaemon (LCOM4 13) Planet/IPFS/IPFSDaemon.swift:15— IPFSDaemon's methods fall into 13 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 13 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Coordinator (LCOM4 13) Planet/Views/Articles/ArticleWebView.swift:34— Coordinator's methods fall into 13 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 13 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: WriterWindow (LCOM4 9) Planet/Writer/WriterWindow.swift:5— WriterWindow's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: WalletManager (LCOM4 8) Planet/Labs/Wallet/WalletManager.swift:81— WalletManager's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Coordinator (LCOM4 7) Planet/TemplateBrowser/TemplateBrowserPreviewWebView.swift:59— Coordinator's methods fall into 7 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 7 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: ArticleAIChatWindowController (LCOM4 6) Planet/Views/Articles/ArticleAIChatWindowManager.swift:50— ArticleAIChatWindowController'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: WriterEditorTextView (LCOM4 5) Planet/Writer/WriterTextView.swift:365— WriterEditorTextView's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: WriterViewModel (LCOM4 5) Planet/Writer/WriterViewModel.swift:4— WriterViewModel's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: OnDeviceToolContext (LCOM4 5) Planet/Views/Articles/ArticleAIOnDeviceTools.swift:478— OnDeviceToolContext's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: PNDiskStore (LCOM4 4) PlanetCLI/PNDiskStore.swift:15— PNDiskStore's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: PlanetAPIService (LCOM4 4) Planet/API/PlanetAPIService.swift:11— PlanetAPIService's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MyArticleModel (LCOM4 4) Planet/Entities/MyArticleModel.swift:5— MyArticleModel's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: PlanetStore (LCOM4 4) Planet/Entities/PlanetStore.swift:127— PlanetStore's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: KeyboardShortcutHelper (LCOM4 4) Planet/Helper/KeyboardShortcutHelper.swift:12— KeyboardShortcutHelper's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: IPFSState (LCOM4 4) Planet/IPFS/IPFSState.swift:4— IPFSState's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: WriterTitleEditorTextView (LCOM4 4) Planet/Writer/WriterTitleView.swift:442— WriterTitleEditorTextView's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ArticleAILinkOnlyTextView (LCOM4 4) Planet/Views/Articles/ArticleAIChatView.swift:7326— ArticleAILinkOnlyTextView's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: PlanetAIChatWindowController (LCOM4 4) Planet/Views/Articles/PlanetAIChatWindowController.swift:155— PlanetAIChatWindowController's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Coordinator (LCOM4 4) Planet/Views/Components/CLTextFieldView.swift:13— Coordinator's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Coordinator (LCOM4 4) Planet/Labs/Published Folders/Dashboard/PFDashboardContentView.swift:61— Coordinator's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
FileTooLong: Articles/ArticleAIChatView.swift Planet/Views/Articles/ArticleAIChatView.swift— FileTooLong — 5280 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: ArticleAIChatView (262-6868). The bar is 500 significant lines; this is 4780 over it, 10.56× 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: Entities/MyPlanetModel.swift Planet/Entities/MyPlanetModel.swift— FileTooLong — 2873 significant lines (blank, comment-only and punctuation-only lines excluded), about 97% of them inside a single declaration: MyPlanetModel (17-3890). The bar is 500 significant lines; this is 2373 over it, 5.75× 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: Entities/FollowingPlanetModel.swift Planet/Entities/FollowingPlanetModel.swift— FileTooLong — 1338 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: FollowingPlanetModel (16-1865). The bar is 500 significant lines; this is 838 over it, 2.68× 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: My/MyPlanetEditView.swift Planet/Views/My/MyPlanetEditView.swift— FileTooLong — 1022 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: MyPlanetEditView (3-1175). The bar is 500 significant lines; this is 522 over it, 2.04× 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: generate-sparkle-notes/app.py tools/generate-sparkle-notes/app.py— FileTooLong — 986 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 486 over it, 1.97× 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: Entities/MyPlanetModel+Aggregate.swift Planet/Entities/MyPlanetModel+Aggregate.swift— FileTooLong — 898 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 398 over it, 1.80× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: PlanetCLI/PNCommandRunner.swift PlanetCLI/PNCommandRunner.swift— FileTooLong — 822 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: PNCommandRunner (66-1066). 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: Entities/PlanetStore.swift Planet/Entities/PlanetStore.swift— 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: Articles/ArticleView.swift Planet/Views/Articles/ArticleView.swift— FileTooLong — 733 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: ArticleView (231-1065). The bar is 500 significant lines; this is 233 over it, 1.47× 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: IPFS/IPFSDaemon.swift Planet/IPFS/IPFSDaemon.swift— FileTooLong — 696 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 196 over it, 1.39× 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: Articles/ArticleAIOnDeviceTools.swift Planet/Views/Articles/ArticleAIOnDeviceTools.swift— FileTooLong — 633 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 133 over it, 1.27× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Wallet/WalletManager.swift Planet/Labs/Wallet/WalletManager.swift— FileTooLong — 630 significant lines (blank, comment-only and punctuation-only lines excluded), about 71% of them inside a single declaration: WalletManager (81-754). The bar is 500 significant lines; this is 130 over it, 1.26× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: TemplateBrowser/Template.swift Planet/TemplateBrowser/Template.swift— FileTooLong — 615 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: Template (97-834). The bar is 500 significant lines; this is 115 over it, 1.23× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: PlanetCLI/PNDiskStore.swift PlanetCLI/PNDiskStore.swift— FileTooLong — 604 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: PNDiskStore (15-815). The bar is 500 significant lines; this is 104 over it, 1.21× 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: Writer/VideoInfoRow.swift Planet/Writer/VideoInfoRow.swift— FileTooLong — 571 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: VideoInfoRow (22-811). The bar is 500 significant lines; this is 71 over it, 1.14× 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: Entities/MyArticleModel.swift Planet/Entities/MyArticleModel.swift— FileTooLong — 562 significant lines (blank, comment-only and punctuation-only lines excluded), about 89% of them inside a single declaration: MyArticleModel (5-680). The bar is 500 significant lines; this is 62 over it, 1.12× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 554 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: PlanetAPIController (11-919). The bar is 500 significant lines; this is 54 over it, 1.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.
ClassTooLong: ArticleAIChatView Planet/Views/Articles/ArticleAIChatView.swift:262— ClassTooLong — 4700 significant lines (blank, comment-only and punctuation-only lines excluded), 180 methods. The bar is 400 significant lines; this is 4300 over it, 11.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: MyPlanetModel Planet/Entities/MyPlanetModel.swift:17— ClassTooLong — 2799 significant lines (blank, comment-only and punctuation-only lines excluded), 129 methods. The bar is 400 significant lines; this is 2399 over it, 7.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FollowingPlanetModel Planet/Entities/FollowingPlanetModel.swift:16— ClassTooLong — 1326 significant lines (blank, comment-only and punctuation-only lines excluded), 55 methods. The bar is 400 significant lines; this is 926 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: MyPlanetEditView Planet/Views/My/MyPlanetEditView.swift:3— ClassTooLong — 799 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 399 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PNCommandRunner PlanetCLI/PNCommandRunner.swift:66— ClassTooLong — 784 significant lines (blank, comment-only and punctuation-only lines excluded), 53 methods. The bar is 400 significant lines; this is 384 over it, 1.96× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PNDiskStore PlanetCLI/PNDiskStore.swift:15— ClassTooLong — 593 significant lines (blank, comment-only and punctuation-only lines excluded), 57 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: ArticleView Planet/Views/Articles/ArticleView.swift:231— ClassTooLong — 561 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 161 over it, 1.40× 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: VideoInfoRow Planet/Writer/VideoInfoRow.swift:22— ClassTooLong — 557 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 157 over it, 1.39× 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: PlanetAPIController REDACTED:11— ClassTooLong — 551 significant lines (blank, comment-only and punctuation-only lines excluded), 38 methods. The bar is 400 significant lines; this is 151 over it, 1.38× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Template Planet/TemplateBrowser/Template.swift:97— ClassTooLong — 548 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 148 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MyArticleModel Planet/Entities/MyArticleModel.swift:5— ClassTooLong — 500 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 400 significant lines; this is 100 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DraftModel Planet/Entities/DraftModel.swift:8— ClassTooLong — 463 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 63 over it, 1.16× 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: WalletManager Planet/Labs/Wallet/WalletManager.swift:81— 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: KeyboardShortcutHelper Planet/Helper/KeyboardShortcutHelper.swift:12— ClassTooLong — 419 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 19 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SearchEmbedding Planet/Search/SearchEmbedding.swift:12— ClassTooLong — 415 significant lines (blank, comment-only and punctuation-only lines excluded), 16 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.
Duplicated block (9 lines × 2) Planet/Entities/FollowingArticleModel.swift:195— Planet/Entities/FollowingArticleModel.swift:195-203 | Planet/Entities/FollowingArticleModel.swift:249-257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/FollowingArticleModel.swift:195` it begins part-way through the construct above it, so those 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) Planet/Entities/MyArticleModel+Save.swift:659— Planet/Entities/MyArticleModel+Save.swift:659-667 | Planet/Entities/MyArticleModel+Save.swift:673-681 — both copies are in the same file, so extract the 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) Planet/Entities/MyPlanetModel.swift:3561— Planet/Entities/MyPlanetModel.swift:3561-3569 | Planet/Entities/MyPlanetModel.swift:3719-3727 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyPlanetModel.swift:3561` it does not close everything it opens, so those exact lines 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) Planet/Helper/KeyboardShortcutHelper.swift:476— Planet/Helper/KeyboardShortcutHelper.swift:476-484 | PlanetLite/CroptopApp.swift:83-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 `Planet/Helper/KeyboardShortcutHelper.swift:476` it does not close everything it opens, so those 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) Planet/Labs/Published Folders/PlanetPublishedServiceStore.swift:552— Planet/Labs/Published Folders/PlanetPublishedServiceStore.swift:552-560 | Planet/Labs/Published Folders/PlanetPublishedServiceStore.swift:634-642 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) Planet/Search/PlanetStore+Search.swift:148— Planet/Search/PlanetStore+Search.swift:148-156 | Planet/Search/PlanetStore+Search.swift:167-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Search/PlanetStore+Search.swift:148` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) Planet/Search/RelatedArticlesView.swift:17— Planet/Search/RelatedArticlesView.swift:17-25 | Planet/Search/SearchView.swift:30-38 — before extracting anything, compare `Planet/Search/RelatedArticlesView.swift` and `Planet/Search/SearchView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 134 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 `Planet/Search/RelatedArticlesView.swift:17` it does not close everything it opens, so those exact lines 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) Planet/Search/SearchDatabase.swift:177— Planet/Search/SearchDatabase.swift:177-185 | Planet/Search/SearchIndex.swift:555-563 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) Planet/Search/SearchEmbedding.swift:111— Planet/Search/SearchEmbedding.swift:111-119 | Planet/Search/SearchEmbedding.swift:201-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Search/SearchEmbedding.swift:111` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) Planet/Views/Articles/ArticleAIChatView.swift:4721— Planet/Views/Articles/ArticleAIChatView.swift:4721-4729 | Planet/Views/Articles/ArticleAIChatView.swift:4881-4889 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Articles/ArticleAIChatView.swift:4721` it begins part-way through the construct above it, so those exact lines 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) Planet/Views/My/MyArticleItemView.swift:57— Planet/Views/My/MyArticleItemView.swift:57-65 | Planet/Views/My/MyArticleItemView.swift:68-76 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/My/MyArticleItemView.swift:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) Planet/Writer/WriterView.swift:111— Planet/Writer/WriterView.swift:111-119 | Planet/Writer/WriterView.swift:123-131 — both copies are in the same file, so extract the 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) PlanetCLI/PNAPIClient.swift:166— PlanetCLI/PNAPIClient.swift:166-174 | PlanetCLI/PNAPIClient.swift:176-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `PlanetCLI/PNAPIClient.swift:166` it begins part-way through the construct above it, so those 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) Planet/Writer/WriterTextView.swift:416— Planet/Writer/WriterTextView.swift:416-424 | Planet/Writer/WriterTitleView.swift:445-453 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) Planet/IPFS/IPFSDaemon.swift:1087— Planet/IPFS/IPFSDaemon.swift:1087-1092 | Planet/IPFS/IPFSDaemon.swift:1114-1119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) Planet/Integrations/dWebServices.swift:18— Planet/Integrations/dWebServices.swift:18-23 | Planet/Integrations/dWebServices.swift:47-52 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Integrations/dWebServices.swift:18` it begins part-way through the construct above it, so those 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, `Planet/Integrations/dWebServices.swift:25` calls `debugPrint` and `Planet/Integrations/dWebServices.swift:54` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) Planet/Search/SearchEmbedding.swift:258— Planet/Search/SearchEmbedding.swift:258-267 | Planet/Search/SearchIndex.swift:210-215 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Search/SearchEmbedding.swift:258` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) Planet/Views/Articles/ArticleAIChatView.swift:1568— Planet/Views/Articles/ArticleAIChatView.swift:1568-1573 | Planet/Views/Articles/ArticleAIChatView.swift:1584-1589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Articles/ArticleAIChatView.swift:1568` it does not close everything it opens, so those exact lines 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) Planet/Views/Articles/ArticleAIChatView.swift:5558— Planet/Views/Articles/ArticleAIChatView.swift:5558-5563 | Planet/Views/Articles/ArticleAIOnDeviceTools.swift:525-530 — 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 `Planet/Views/Articles/ArticleAIChatView.swift:5558` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) Planet/Views/Articles/ArticleAIChatWindowManager.swift:290— Planet/Views/Articles/ArticleAIChatWindowManager.swift:290-295 | Planet/Views/Articles/PlanetAIChatWindowController.swift:558-563 — before extracting anything, compare `Planet/Views/Articles/ArticleAIChatWindowManager.swift` and `Planet/Views/Articles/PlanetAIChatWindowController.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 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 `Planet/Views/Articles/ArticleAIChatWindowManager.swift: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 (6 lines × 2) Planet/Writer/WriterTextView.swift:405— Planet/Writer/WriterTextView.swift:405-410 | Planet/Writer/WriterTitleView.swift:505-510 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 2) Planet/Downloads/PlanetDownloadsViewController.swift:33— Planet/Downloads/PlanetDownloadsViewController.swift:33-38 | Planet/Key Manager/PlanetKeyManagerViewController.swift:34-39 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Planet/Views/Articles/ArticleAIChatWindowManager.swift:10— Planet/Views/Articles/ArticleAIChatWindowManager.swift:10-15 | Planet/Views/Articles/PlanetAIChatWindowController.swift:13-18 — before extracting anything, compare `Planet/Views/Articles/ArticleAIChatWindowManager.swift` and `Planet/Views/Articles/PlanetAIChatWindowController.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Planet/Views/Articles/ArticleAIChatWindowManager.swift:8` calls `NSSize` and `Planet/Views/Articles/PlanetAIChatWindowController.swift:11` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) Planet/Downloads/PlanetDownloadsWindow.swift:26— Planet/Downloads/PlanetDownloadsWindow.swift:26-31 | Planet/TemplateBrowser/Window Controller/TBWindow.swift:23-28 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) Planet/Writer/VideoCompressionJob.swift:8— Planet/Writer/VideoCompressionJob.swift:8-13 | Planet/Writer/VideoInfoRow.swift:565-570 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) Planet/Writer/VideoCompressionJob.swift:15— Planet/Writer/VideoCompressionJob.swift:15-20 | Planet/Writer/VideoInfoRow.swift:776-781 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) Planet/Writer/WriterTextView.swift:397— Planet/Writer/WriterTextView.swift:397-402 | Planet/Writer/WriterTitleView.swift:497-502 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) Planet/API/PlanetAPILogMiddleware.swift:41— Planet/API/PlanetAPILogMiddleware.swift:41-45 | Planet/API/PlanetAPILogMiddleware.swift:48-52 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/API/PlanetAPILogMiddleware.swift:41` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) Planet/Entities/FollowingArticleModel.swift:344— Planet/Entities/FollowingArticleModel.swift:344-348 | Planet/Entities/MyArticleModel.swift:341-345 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:19— Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:19-23 | Planet/TemplateBrowser/Window Controller/TBWindowController.swift:18-22 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Planet/TemplateBrowser/Window Controller/TBWindowController.swift:23` calls `updateTemplateWindowTitles` and `Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:24` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) Planet/Labs/Wallet/WalletAccountView.swift:249— Planet/Labs/Wallet/WalletAccountView.swift:249-253 | Planet/Views/Sidebar/AccountBadgeView.swift:146-150 — 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 `Planet/Labs/Wallet/WalletAccountView.swift:249` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Planet/Log/PlanetLogger.swift:180— Planet/Log/PlanetLogger.swift:180-184 | Planet/Quick Share/PlanetQuickShareDropDelegate.swift:316-320 — 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 `Planet/Log/PlanetLogger.swift:180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 2) Planet/PlanetAppDelegate.swift:248— Planet/PlanetAppDelegate.swift:248-252 | PlanetLite/AppDelegate.swift:98-102 — 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 `Planet/PlanetAppDelegate.swift: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.
Duplicated block (5 lines × 2) Planet/Writer/VideoCompressionJob.swift:400— Planet/Writer/VideoCompressionJob.swift:400-404 | Planet/Writer/VideoCompressionJob.swift:408-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Writer/VideoCompressionJob.swift:400` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Planet/Downloads/PlanetDownloadsWebView.swift:94— Planet/Downloads/PlanetDownloadsWebView.swift:94-98 | Planet/TemplateBrowser/TemplateWebView.swift:62-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) Planet/Entities/FollowingPlanetModel.swift:91— Planet/Entities/FollowingPlanetModel.swift:91-95 | Planet/Entities/MyPlanetModel.swift:650-654 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) Planet/Labs/Published Folders/Dashboard/PFDashboardContainerViewController.swift:19— Planet/Labs/Published Folders/Dashboard/PFDashboardContainerViewController.swift:19-23 | Planet/TemplateBrowser/Window Controller/TBContainerViewController.swift:19-23 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) Planet/Search/PlanetStore+Spotlight.swift:288— Planet/Search/PlanetStore+Spotlight.swift:288-292 | Planet/Search/PlanetStore+Spotlight.swift:341-345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Search/PlanetStore+Spotlight.swift:288` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Planet/Views/Articles/ArticleAIChatView.swift:3285— Planet/Views/Articles/ArticleAIChatView.swift:3285-3289 | Planet/Views/Articles/ArticleAIChatView.swift:3341-3345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Articles/ArticleAIChatView.swift:3285` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) Planet/Views/Articles/ArticleAIChatView.swift:4754— Planet/Views/Articles/ArticleAIChatView.swift:4754-4758 | Planet/Views/Articles/ArticleAIOnDeviceTools.swift:689-693 — 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 (10 lines × 2) Planet/Downloads/PlanetDownloadsWebView.swift:77— Planet/Downloads/PlanetDownloadsWebView.swift:77-86 | Planet/TemplateBrowser/TemplateWebView.swift:51-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) Planet/Entities/FollowingPlanetModel.swift:869— Planet/Entities/FollowingPlanetModel.swift:869-878 | Planet/Entities/FollowingPlanetModel.swift:935-944 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/FollowingPlanetModel.swift:869` it does not close everything it opens, so those 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) Planet/Entities/FollowingPlanetModel.swift:1713— Planet/Entities/FollowingPlanetModel.swift:1713-1722 | Planet/Entities/FollowingPlanetModel.swift:1777-1786 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/FollowingPlanetModel.swift:1713` it does not close everything it opens, so those exact lines 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) Planet/Entities/MyArticleModel+Save.swift:386— Planet/Entities/MyArticleModel+Save.swift:386-395 | Planet/Entities/MyArticleModel+Save.swift:405-414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyArticleModel+Save.swift:386` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) Planet/Entities/MyPlanetModel.swift:2377— Planet/Entities/MyPlanetModel.swift:2377-2386 | Planet/Entities/MyPlanetModel.swift:2575-2584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyPlanetModel.swift:2377` it begins part-way through the construct above it, so those exact lines 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) Planet/Key Manager/PlanetKeyManagerWindowController.swift:107— Planet/Key Manager/PlanetKeyManagerWindowController.swift:107-116 | Planet/Settings/PlanetSettingsGeneralView.swift:191-200 — 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.
Duplicated block (10 lines × 2) Planet/Labs/Published Folders/PlanetPublishedServiceStore.swift:252— Planet/Labs/Published Folders/PlanetPublishedServiceStore.swift:252-261 | Planet/Labs/Published Folders/PlanetPublishedServiceStore.swift:540-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 `Planet/Labs/Published Folders/PlanetPublishedServiceStore.swift:252` it begins part-way through the construct above it, so those exact lines 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) Planet/Labs/Wallet/WalletConnectV1.swift:129— Planet/Labs/Wallet/WalletConnectV1.swift:129-138 | Planet/Labs/Wallet/WalletConnectV1.swift:207-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Labs/Wallet/WalletConnectV1.swift:129` it does not close everything it opens, so those 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) Planet/Quick Share/PlanetQuickShareView.swift:424— Planet/Quick Share/PlanetQuickShareView.swift:424-433 | Planet/Writer/WriterTitleView.swift:212-225 — 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 `Planet/Quick Share/PlanetQuickShareView.swift:424` it begins part-way through the construct above it, so those exact lines 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) Planet/Views/Articles/ArticleAIChatView.swift:5327— Planet/Views/Articles/ArticleAIChatView.swift:5327-5336 | Planet/Views/Articles/ArticleAIChatView.swift:5342-5351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Articles/ArticleAIChatView.swift:5327` it does not close everything it opens, so those 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) Planet/Views/PlanetMainView.swift:92— Planet/Views/PlanetMainView.swift:92-101 | PlanetLite/AppSidebarView.swift:126-135 — 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 `Planet/Views/PlanetMainView.swift:92` it begins part-way through the construct above it, so those exact lines 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) Planet/Views/PlanetMainView.swift:102— Planet/Views/PlanetMainView.swift:102-111 | PlanetLite/AppContentView.swift:199-208 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/PlanetMainView.swift:102` it begins part-way through the construct above it, so those exact lines 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) Planet/Entities/MyPlanetModel.swift:400— Planet/Entities/MyPlanetModel.swift:400-406 | Planet/Views/My/MyPlanetTemplateSettingsView.swift:205-211 — 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 `Planet/Entities/MyPlanetModel.swift:400` it does not close everything it opens, so those 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) Planet/Helper/HttpRequest.swift:42— Planet/Helper/HttpRequest.swift:42-48 | Planet/Helper/HttpRequest.swift:65-71 — both copies are in the same file, so extract the 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) Planet/Integrations/Plausible.swift:23— Planet/Integrations/Plausible.swift:23-29 | Planet/Integrations/dWebServices.swift:51-57 — 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 `Planet/Integrations/Plausible.swift:23` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) Planet/Quick Share/PlanetQuickShareDropDelegate.swift:67— Planet/Quick Share/PlanetQuickShareDropDelegate.swift:67-73 | PlanetLite/AppContentDropDelegate.swift:63-69 — 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 `Planet/Quick Share/PlanetQuickShareDropDelegate.swift:67` it begins part-way through the construct above it, so those exact lines 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) Planet/Quick Share/PlanetQuickShareViewModel.swift:250— Planet/Quick Share/PlanetQuickShareViewModel.swift:250-256 | Planet/Writer/WriterDragAndDrop.swift:121-127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) Planet/Settings/PlanetSettingsAIView.swift:433— Planet/Settings/PlanetSettingsAIView.swift:433-439 | Planet/Settings/PlanetSettingsAIView.swift:449-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Settings/PlanetSettingsAIView.swift:433` it does not close everything it opens, so those exact lines 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) Planet/Views/Articles/ArticleAIChatView.swift:3293— Planet/Views/Articles/ArticleAIChatView.swift:3293-3299 | Planet/Views/Articles/ArticleAIChatView.swift:3309-3315 — both copies are in the same file, so extract the 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) Planet/Views/Articles/ArticleAIChatView.swift:3381— Planet/Views/Articles/ArticleAIChatView.swift:3381-3387 | Planet/Views/Articles/ArticleAIChatView.swift:3392-3398 — both copies are in the same file, so extract the 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) Planet/Views/Articles/ArticleAIChatView.swift:4713— Planet/Views/Articles/ArticleAIChatView.swift:4713-4719 | Planet/Views/Articles/ArticleAIChatView.swift:4873-4879 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Articles/ArticleAIChatView.swift:4713` it begins part-way through the construct above it, so those 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) Planet/Views/Sidebar/PlanetSidebarView.swift:229— Planet/Views/Sidebar/PlanetSidebarView.swift:229-236 | PlanetLite/AppSidebarView.swift:139-145 — before extracting anything, compare `Planet/Views/Sidebar/PlanetSidebarView.swift` and `PlanetLite/AppSidebarView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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 `Planet/Views/Sidebar/PlanetSidebarView.swift: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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) Planet/Entities/FollowingPlanetModel.swift:1611— Planet/Entities/FollowingPlanetModel.swift:1611-1617 | Planet/Entities/MyPlanetModel.swift:3478-3484 — 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) Planet/Integrations/Filebase.swift:20— Planet/Integrations/Filebase.swift:20-26 | Planet/Integrations/Filebase.swift:96-102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Integrations/Filebase.swift:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) Planet/Entities/MyArticleModel.swift:527— Planet/Entities/MyArticleModel.swift:527-534 | Planet/Entities/MyArticleModel.swift:536-543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Planet/Entities/MyArticleModel.swift:545` calls `fileExists`, `detached` and `Planet/Entities/MyArticleModel.swift:536` 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 (8 lines × 2) Planet/Labs/Icon Gallery/IconManager.swift:274— Planet/Labs/Icon Gallery/IconManager.swift:274-281 | Planet/Labs/Icon Gallery/IconManager.swift:462-469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Labs/Icon Gallery/IconManager.swift:274` it does not close everything it opens, so those 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) Planet/Search/SearchEmbedding.swift:99— Planet/Search/SearchEmbedding.swift:99-106 | Planet/Search/SearchIndex.swift:45-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) Planet/Views/Articles/ArticleAIChatView.swift:1322— Planet/Views/Articles/ArticleAIChatView.swift:1322-1329 | Planet/Views/Articles/ArticleAIChatView.swift:1370-1377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Articles/ArticleAIChatView.swift:1322` it begins part-way through the construct above it, so those exact lines 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) Planet/Views/Articles/ArticleAIChatView.swift:3863— Planet/Views/Articles/ArticleAIChatView.swift:3863-3871 | Planet/Views/Articles/ArticleAIChatView.swift:3909-3916 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Articles/ArticleAIChatView.swift:3909` it does not close everything it opens, so those 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) Planet/Views/Articles/ArticleAIChatView.swift:6306— Planet/Views/Articles/ArticleAIChatView.swift:6306-6313 | Planet/Views/Articles/ArticleAIChatView.swift:6628-6635 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) Planet/Views/Articles/ArticleAIChatView.swift:6344— Planet/Views/Articles/ArticleAIChatView.swift:6344-6351 | Planet/Views/Articles/ArticleAIChatView.swift:6628-6635 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) Planet/Views/My/MyArticleGridView.swift:272— Planet/Views/My/MyArticleGridView.swift:272-279 | Planet/Views/My/MyArticleGridView.swift:287-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.
Duplicated block (8 lines × 2) PlanetCLI/PNAPIClient.swift:121— PlanetCLI/PNAPIClient.swift:121-129 | PlanetCLI/PNAPIClient.swift:202-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `PlanetCLI/PNAPIClient.swift:121` it begins part-way through the construct above it, so those exact lines 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) Planet/Labs/Quick Post/QuickPostViewModel.swift:266— Planet/Labs/Quick Post/QuickPostViewModel.swift:266-273 | Planet/Views/My/MyPlanetEditView.swift:1393-1400 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) Planet/Writer/WriterDragAndDrop.swift:232— Planet/Writer/WriterDragAndDrop.swift:232-239 | Planet/Writer/WriterTextView.swift:144-151 — 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 (11 lines × 2) Planet/Entities/MyPlanetModel.swift:2029— Planet/Entities/MyPlanetModel.swift:2029-2039 | Planet/Views/Following/FollowingPlanetAvatarView.swift:31-41 — before extracting anything, compare `Planet/Entities/MyPlanetModel.swift` and `Planet/Views/Following/FollowingPlanetAvatarView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyPlanetModel.swift:2029` 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) Planet/Helper/KeychainHelper.swift:125— Planet/Helper/KeychainHelper.swift:125-135 | Planet/Helper/KeychainHelper.swift:162-172 — both copies are in the same file, so extract the 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Planet/Helper/KeychainHelper.swift:161` calls `exportKeyToKeychain` and `Planet/Helper/KeychainHelper.swift:124` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:84— Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:84-94 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:107-117 — both copies are in the same file, so extract the 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) Planet/Labs/Wallet/WalletConnectV1QRCodeView.swift:75— Planet/Labs/Wallet/WalletConnectV1QRCodeView.swift:75-85 | Planet/Labs/Wallet/WalletConnectV2QRCodeView.swift:74-84 — before extracting anything, compare `Planet/Labs/Wallet/WalletConnectV1QRCodeView.swift` and `Planet/Labs/Wallet/WalletConnectV2QRCodeView.swift` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (11 lines × 2) Planet/Labs/Wallet/WalletManager.swift:113— Planet/Labs/Wallet/WalletManager.swift:113-123 | Planet/Labs/Wallet/WalletManager.swift:125-135 — both copies are in the same file, so extract the 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) Planet/Search/PlanetStore+Spotlight.swift:240— Planet/Search/PlanetStore+Spotlight.swift:240-250 | Planet/Search/PlanetStore+Spotlight.swift:255-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Search/PlanetStore+Spotlight.swift:240` 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) Planet/Settings/PlanetSettingsAIView.swift:54— Planet/Settings/PlanetSettingsAIView.swift:54-64 | Planet/Settings/PlanetSettingsAIView.swift:66-76 — both copies are in the same file, so extract the 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) Planet/Views/Articles/ArticleAIChatView.swift:618— Planet/Views/Articles/ArticleAIChatView.swift:618-628 | Planet/Views/Articles/ArticleAIChatView.swift:659-669 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Articles/ArticleAIChatView.swift:618` it begins part-way through the construct above it, so those exact lines 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) Planet/Views/Create & Follow Planet/CreatePlanetView.swift:45— Planet/Views/Create & Follow Planet/CreatePlanetView.swift:45-55 | Planet/Views/My/MyPlanetEditView.swift:963-973 — 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 `Planet/Views/Create & Follow Planet/CreatePlanetView.swift:45` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) Planet/Views/Onboarding/NewOnboardingView.swift:221— Planet/Views/Onboarding/NewOnboardingView.swift:221-231 | Planet/Views/Onboarding/NewOnboardingView.swift:239-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Planet/Views/Onboarding/NewOnboardingView.swift:232` calls `pointerStyle` and `Planet/Views/Onboarding/NewOnboardingView.swift:250` 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.
TooManyMethods: ArticleAIChatView Planet/Views/Articles/ArticleAIChatView.swift:262— TooManyMethods — 180 methods. The bar is 30 methods; this is 150 over it, 6.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MyPlanetModel Planet/Entities/MyPlanetModel.swift:17— TooManyMethods — 129 methods. The bar is 30 methods; this is 99 over it, 4.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MyArticleModel Planet/Entities/MyArticleModel.swift:5— TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.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: PlanetStore Planet/Entities/PlanetStore.swift:127— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PNDiskStore PlanetCLI/PNDiskStore.swift:15— TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FollowingPlanetModel Planet/Entities/FollowingPlanetModel.swift:16— TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PNCommandRunner PlanetCLI/PNCommandRunner.swift:66— TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PlanetAPIController REDACTED:11— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: VideoInfoRow Planet/Writer/VideoInfoRow.swift:22— 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.
Change coupling: PFDashboardContentView.swift ↔ PFDashboardWindowController.swift Planet/Labs/Published Folders/Dashboard/PFDashboardContentView.swift— `Planet/Labs/Published Folders/Dashboard/PFDashboardContentView.swift` and `Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift` change together 80% of the time (8 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). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `134a3601` Separate IPFS daemon process.; `41edc5a2` Add auto-refresh logic to dashboard window titles.; `d85c9d29` Fixed some crashes in dashboard navigation when daemon was not online. — run `git show` on any of them.
Change coupling: MyArticleModel+Save.swift ↔ MyArticleModel+SavePublic.swift Planet/Entities/MyArticleModel+Save.swift— `Planet/Entities/MyArticleModel+Save.swift` and `Planet/Entities/MyArticleModel+SavePublic.swift` change together 73% of the time (11 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `7d92bb46` Fix article.md not saved reliably by making saveMarkdown synchronous; `bbba0436` Improve rebuild publishing and rendering performance; `fab55465` Restore full CPU utilization during rebuild — run `git show` on any of them.
Change coupling: PFDashboardView.swift ↔ PFDashboardWindowController.swift Planet/Labs/Published Folders/Dashboard/PFDashboardView.swift— `Planet/Labs/Published Folders/Dashboard/PFDashboardView.swift` and `Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift` change together 73% of the time (8 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). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `e8899268` Minor updates to last commit.; `e4ec88c7` Improved preview logic for published folders dashboard.; `41edc5a2` Add auto-refresh logic to dashboard window titles. — run `git show` on any of them.
Change coupling: BackupMyPlanetModel.swift ↔ MyPlanetEditView.swift Planet/Entities/BackupMyPlanetModel.swift— `Planet/Entities/BackupMyPlanetModel.swift` and `Planet/Views/My/MyPlanetEditView.swift` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `96833457` Add Cloudflare Pages publishing support; `09b036b9` Add SSH rsync as optional publishing destination (#453); `1191259f` Add Publishing settings tab with Publish as IPNS toggle — run `git show` on any of them.
Change coupling: FollowingArticleItemView.swift ↔ MyArticleItemView.swift Planet/Views/Following/FollowingArticleItemView.swift— `Planet/Views/Following/FollowingArticleItemView.swift` and `Planet/Views/My/MyArticleItemView.swift` change together 62% of the time (18 of the 29 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 18 shared commits counted here, the most recent 3 are `4181d16a` Fix star action localization; `84f80f25` Add "Find Related Articles" using NLEmbedding vector similarity; `d0b239f8` Optimize article list performance for unread view with many items — run `git show` on any of them.
Change coupling: DraftModel.swift ↔ WriterViewModel.swift Planet/Entities/DraftModel.swift— `Planet/Entities/DraftModel.swift` and `Planet/Writer/WriterViewModel.swift` change together 58% of the time (7 of the 12 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `6cc94261` Add Revert to Original flow and compression status report for Writer …; `14e6f3ed` When attaching images, convert .heic to .jpg; `d3b2854e` Handle discard choice for draft — run `git show` on any of them.
Change coupling: MyArticleModel+SavePublic.swift ↔ MyPlanetModel.swift Planet/Entities/MyArticleModel+SavePublic.swift— `Planet/Entities/MyArticleModel+SavePublic.swift` and `Planet/Entities/MyPlanetModel.swift` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in the same directory, and in this ecosystem sibling files there normally share one namespace/package — so a direct reference between them needs no import and this pass cannot see whether one exists. Read the pair before acting: if one file only DECLARES what the other consumes (a constants/types file beside its user), the co-change is definitional and the question is whether the split earns its keep; if they duplicate structure, extract the common part into a shared function or type they both call; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `bbba0436` Improve rebuild publishing and rendering performance; `fab55465` Restore full CPU utilization during rebuild; `ceb2a69f` Use atomic writes for all persistent data and published content — run `git show` on any of them.
Change coupling: IPFSDaemon.swift ↔ PFDashboardContentView.swift Planet/IPFS/IPFSDaemon.swift— `Planet/IPFS/IPFSDaemon.swift` and `Planet/Labs/Published Folders/Dashboard/PFDashboardContentView.swift` 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these 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 `134a3601` Separate IPFS daemon process.; `eb5aa635` Folder navigation works as expected now.; `86604112` Add basic web view navigation, need a better way to handle edge cases… — run `git show` on any of them.
Duplicated block (13 lines × 2) Planet/Entities/MyArticleModel+Save.swift:521— Planet/Entities/MyArticleModel+Save.swift:521-533 | Planet/Entities/MyArticleModel+Save.swift:536-548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) Planet/Entities/MyPlanetModel.swift:2008— Planet/Entities/MyPlanetModel.swift:2008-2020 | Planet/Views/Following/FollowingPlanetAvatarView.swift:10-22 — before extracting anything, compare `Planet/Entities/MyPlanetModel.swift` and `Planet/Views/Following/FollowingPlanetAvatarView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyPlanetModel.swift:2008` it begins part-way through the construct above it, so those exact lines 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) Planet/Entities/PlanetStore.swift:972— Planet/Entities/PlanetStore.swift:972-984 | Planet/Entities/PlanetStore.swift:995-1007 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/PlanetStore.swift:972` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Planet/Entities/PlanetStore.swift:994` calls `myPlanet` and `Planet/Entities/PlanetStore.swift:971` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) Planet/TemplateBrowser/Template.swift:555— Planet/TemplateBrowser/Template.swift:555-567 | Planet/TemplateBrowser/Template.swift:598-612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/TemplateBrowser/Template.swift:555` it does not close everything it opens, so those exact lines 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) Planet/Views/Articles/ArticleView.swift:925— Planet/Views/Articles/ArticleView.swift:925-937 | Planet/Views/Articles/ArticleView.swift:944-956 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Articles/ArticleView.swift:925` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) tools/generate-sparkle-notes/planet.py:92— tools/generate-sparkle-notes/planet.py:92-104 | tools/generate-sparkle-notes/planet.py:116-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `tools/generate-sparkle-notes/planet.py:92` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Planet/Helper/KeyboardShortcutHelper.swift:267— Planet/Helper/KeyboardShortcutHelper.swift:267-278 | Planet/Helper/KeyboardShortcutHelper.swift:286-297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Helper/KeyboardShortcutHelper.swift:267` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Planet/IPFS/IPFSDaemon.swift:260— Planet/IPFS/IPFSDaemon.swift:260-271 | Planet/IPFS/IPFSDaemon.swift:276-287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/IPFS/IPFSDaemon.swift:260` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) Planet/TemplateBrowser/ColorFilter.swift:85— Planet/TemplateBrowser/ColorFilter.swift:85-96 | Planet/TemplateBrowser/ColorFilter.swift:99-110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) Planet/Views/Sidebar/MyPlanetSidebarItem.swift:470— Planet/Views/Sidebar/MyPlanetSidebarItem.swift:470-481 | Planet/Views/Sidebar/MyPlanetSidebarItem.swift:490-501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Sidebar/MyPlanetSidebarItem.swift:470` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) Planet/Views/My/MyArticleSettingsView.swift:352— Planet/Views/My/MyArticleSettingsView.swift:352-363 | Planet/Writer/WriterTitleView.swift:182-193 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) Planet/Entities/ArticleModel.swift:166— Planet/Entities/ArticleModel.swift:166-177 | Planet/Entities/DraftModel.swift:104-115 — 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.
Floating branch dependency: codemirror-swiftui — Dependency `codemirror-swiftui` is resolved in Planet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch `master` rather than a released version — the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit.
Floating branch dependency: ensdatakit — Dependency `ensdatakit` is resolved in Planet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch `main` rather than a released version — the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit.
Floating branch dependency: planetsitetemplates — Dependency `planetsitetemplates` is resolved in Planet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch `main` rather than a released version — the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit.
Floating branch dependency: stencil — Dependency `stencil` is resolved in Planet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch `master` rather than a released version — the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit.
Floating branch dependency: walletconnectswift — Dependency `walletconnectswift` is resolved in Planet.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch `master` rather than a released version — the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (4 members, 50+ identical tokens) Planet/Integrations/CloudflarePages.swift:215— Planet/Integrations/CloudflarePages.swift:215-240 | Planet/Integrations/CloudflarePages.swift:243-275 | Planet/Integrations/CloudflarePages.swift:278-297 | Planet/Integrations/CloudflarePages.swift:369-419 — 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) Planet/Quick Share/PlanetQuickShareViewModel.swift:258— Planet/Quick Share/PlanetQuickShareViewModel.swift:258-295 | Planet/Views/Articles/ArticleAIChatView.swift:5602-5640 | Planet/Views/Articles/ArticleListView.swift:225-262 | Planet/Writer/WriterDragAndDrop.swift:129-166 — 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) Planet/Views/Components/IndicatorViews.swift:12— Planet/Views/Components/IndicatorViews.swift:12-29 | Planet/Views/Components/IndicatorViews.swift:34-51 | Planet/Views/Components/IndicatorViews.swift:56-73 | Planet/Views/Components/IndicatorViews.swift:78-95 — 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) Planet/Views/Create & Follow Planet/CreatePlanetView.swift:14— Planet/Views/Create & Follow Planet/CreatePlanetView.swift:14-134 | Planet/Views/My/MyPlanetDonationSettingsView.swift:33-188 | Planet/Views/My/MyPlanetEditView.swift:849-1174 | PlanetLite/Croptop/AggregationSettings.swift:32-158 — 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) Planet/Views/My/MyPlanetCustomCodeView.swift:55— Planet/Views/My/MyPlanetCustomCodeView.swift:55-228 | Planet/Views/My/MyPlanetDonationSettingsView.swift:33-188 | Planet/Views/My/MyPlanetEditView.swift:849-1174 | Planet/Views/My/MyPlanetPodcastSettingsView.swift:36-171 — 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.
Duplicated block (18 lines × 2) Planet/Entities/FollowingPlanetModel.swift:922— Planet/Entities/FollowingPlanetModel.swift:922-939 | Planet/Entities/FollowingPlanetModel.swift:991-1008 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/FollowingPlanetModel.swift:922` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) Planet/Helper/DragPasteboardMedia.swift:341— Planet/Helper/DragPasteboardMedia.swift:341-358 | Planet/Helper/DragPasteboardMedia.swift:362-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 `Planet/Helper/DragPasteboardMedia.swift:341` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 2) Planet/Views/Articles/ArticleWebViewModel.swift:313— Planet/Views/Articles/ArticleWebViewModel.swift:313-330 | Planet/Views/Articles/ArticleWebViewModel.swift:366-383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Articles/ArticleWebViewModel.swift:313` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 2) Planet/Views/My/MyPlanetCustomCodeView.swift:182— Planet/Views/My/MyPlanetCustomCodeView.swift:182-199 | Planet/Views/My/MyPlanetDonationSettingsView.swift:141-158 — 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 `Planet/Views/My/MyPlanetCustomCodeView.swift:182` it begins part-way through the construct above it, so those 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, `Planet/Views/My/MyPlanetDonationSettingsView.swift:159` calls `verifyUserInput` and `Planet/Views/My/MyPlanetCustomCodeView.swift:200` 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 (18 lines × 2) Planet/Views/My/MyPlanetDonationSettingsView.swift:84— Planet/Views/My/MyPlanetDonationSettingsView.swift:84-101 | Planet/Views/My/MyPlanetDonationSettingsView.swift:109-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/My/MyPlanetDonationSettingsView.swift:84` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Planet/Entities/MyPlanetModel.swift:2441— Planet/Entities/MyPlanetModel.swift:2441-2457 | Planet/Entities/MyPlanetModel.swift:2537-2553 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyPlanetModel.swift:2441` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Planet/Helper/DragPasteboardMedia.swift:447— Planet/Helper/DragPasteboardMedia.swift:447-463 | Planet/Labs/Quick Post/QuickPostViewModel.swift:224-240 — 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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (17 lines × 2) Planet/TemplateBrowser/Template.swift:492— Planet/TemplateBrowser/Template.swift:492-508 | Planet/TemplateBrowser/Template.swift:526-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.
Duplicated block (17 lines × 2) Planet/Views/My/MyArticleGridView.swift:310— Planet/Views/My/MyArticleGridView.swift:310-326 | Planet/Views/My/MyArticleItemView.swift:408-424 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/My/MyArticleGridView.swift:310` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) Planet/Views/My/MyPlanetCustomCodeView.swift:89— Planet/Views/My/MyPlanetCustomCodeView.swift:89-105 | Planet/Views/My/MyPlanetCustomCodeView.swift:136-152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/My/MyPlanetCustomCodeView.swift:89` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Planet/Entities/FollowingPlanetModel.swift:790— Planet/Entities/FollowingPlanetModel.swift:790-804 | Planet/Entities/FollowingPlanetModel.swift:1107-1121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) Planet/Search/RelatedArticlesView.swift:131— Planet/Search/RelatedArticlesView.swift:131-145 | Planet/Search/SearchView.swift:347-361 — before extracting anything, compare `Planet/Search/RelatedArticlesView.swift` and `Planet/Search/SearchView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 134 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 `Planet/Search/RelatedArticlesView.swift:131` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Planet/Settings/PlanetSettingsAIView.swift:117— Planet/Settings/PlanetSettingsAIView.swift:117-131 | Planet/Settings/PlanetSettingsAIView.swift:138-152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Settings/PlanetSettingsAIView.swift:117` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) Planet/Views/My/MyPlanetCustomCodeView.swift:82— Planet/Views/My/MyPlanetCustomCodeView.swift:82-96 | Planet/Views/My/MyPlanetCustomCodeView.swift:167-181 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/My/MyPlanetCustomCodeView.swift:82` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) tools/generate-sparkle-notes/app.py:1171— tools/generate-sparkle-notes/app.py:1171-1185 | tools/generate-sparkle-notes/app.py:1199-1213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `tools/generate-sparkle-notes/app.py:1215` calls `notes_exist` and `tools/generate-sparkle-notes/app.py:1187` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) Planet/Entities/FollowingPlanetModel.swift:806— Planet/Entities/FollowingPlanetModel.swift:806-819 | Planet/Entities/FollowingPlanetModel.swift:1145-1158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Planet/Entities/FollowingPlanetModel.swift:1160` calls `info` and `Planet/Entities/FollowingPlanetModel.swift:821` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) Planet/Views/My/AvatarPickerView.swift:139— Planet/Views/My/AvatarPickerView.swift:139-152 | Planet/Views/My/AvatarPickerView.swift:240-253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/My/AvatarPickerView.swift:139` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Planet/Views/My/AvatarPickerView.swift:154` calls `debugPrint` and `Planet/Views/My/AvatarPickerView.swift:254` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) Planet/Views/Sidebar/PlanetSidebarView.swift:126— Planet/Views/Sidebar/PlanetSidebarView.swift:126-139 | PlanetLite/AppSidebarView.swift:37-50 — before extracting anything, compare `Planet/Views/Sidebar/PlanetSidebarView.swift` and `PlanetLite/AppSidebarView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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 `Planet/Views/Sidebar/PlanetSidebarView.swift:126` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) Planet/Writer/VideoAttachmentInfo.swift:191— Planet/Writer/VideoAttachmentInfo.swift:191-204 | PlanetCLI/PNAPIClient.swift:369-382 — 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 `Planet/Writer/VideoAttachmentInfo.swift:191` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 3) Planet/Entities/FollowingArticleModel.swift:194— Planet/Entities/FollowingArticleModel.swift:194-199 | Planet/Entities/FollowingArticleModel.swift:212-217 | Planet/Entities/FollowingArticleModel.swift:248-253 — 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 `Planet/Entities/FollowingArticleModel.swift:194` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Planet/Entities/FollowingArticleModel.swift:218` calls `dropLast` and `Planet/Entities/FollowingArticleModel.swift:200` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) Planet/Entities/FollowingPlanetModel.swift:367— Planet/Entities/FollowingPlanetModel.swift:367-372 | Planet/PlanetAppDelegate.swift:53-58 | Planet/Views/Create & Follow Planet/FollowPlanetView.swift:129-134 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/FollowingPlanetModel.swift:367` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) Planet/Entities/MyPlanetModel.swift:2022— Planet/Entities/MyPlanetModel.swift:2022-2027 | Planet/Views/Following/FollowingPlanetAvatarView.swift:24-29 | Planet/Views/Sidebar/AccountBadgeView.swift:40-45 — before extracting anything, compare `Planet/Entities/MyPlanetModel.swift` and `Planet/Views/Following/FollowingPlanetAvatarView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyPlanetModel.swift:2022` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) Planet/Search/SearchEmbedding.swift:365— Planet/Search/SearchEmbedding.swift:365-370 | Planet/Search/SearchEmbedding.swift:509-514 | Planet/Search/SearchIndex.swift:290-295 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (16 lines × 2) Planet/Entities/MyPlanetModel.swift:1445— Planet/Entities/MyPlanetModel.swift:1445-1460 | Planet/Entities/MyPlanetModel.swift:1839-1854 — both copies are in the same file, so extract the 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 (16 lines × 2) Planet/Labs/Wallet/WalletConnectV1.swift:187— Planet/Labs/Wallet/WalletConnectV1.swift:187-202 | Planet/Labs/Wallet/WalletConnectV1.swift:243-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Labs/Wallet/WalletConnectV1.swift:187` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) Planet/Search/PlanetStore+Search.swift:285— Planet/Search/PlanetStore+Search.swift:285-300 | Planet/Search/PlanetStore+Search.swift:311-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Search/PlanetStore+Search.swift:285` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Planet/Search/PlanetStore+Search.swift:284` calls `upsertSpotlightItem` and `Planet/Search/PlanetStore+Search.swift:308` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15–16 lines × 2) Planet/Views/Following/FollowingArticleItemView.swift:85— Planet/Views/Following/FollowingArticleItemView.swift:85-99 | Planet/Views/My/MyArticleItemView.swift:131-146 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15–16 lines × 2) Planet/Views/Following/FollowingArticleItemView.swift:108— Planet/Views/Following/FollowingArticleItemView.swift:108-122 | Planet/Views/My/MyArticleGridView.swift:160-175 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (15–16 lines × 2) Planet/Views/My/MyPlanetCustomCodeView.swift:208— Planet/Views/My/MyPlanetCustomCodeView.swift:208-223 | Planet/Views/My/MyPlanetEditView.swift:1142-1156 — 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 `Planet/Views/My/MyPlanetCustomCodeView.swift:208` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11–12 lines × 2) REDACTED:357— REDACTED:357-368 | REDACTED:478-488 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:357` it does not close everything it opens, so those 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 (11–12 lines × 2) Planet/Entities/FollowingPlanetModel.swift:1070— Planet/Entities/FollowingPlanetModel.swift:1070-1081 | Planet/Entities/FollowingPlanetModel.swift:1309-1319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/FollowingPlanetModel.swift:1070` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) Planet/Views/Articles/ArticleAIChatView.swift:3588— Planet/Views/Articles/ArticleAIChatView.swift:3588-3599 | Planet/Views/Articles/ArticleAIChatView.swift:3637-3647 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Outbound HTTP without resilience tools/claude-code-skill/save_session.py:30— `urllib.request.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. 3 of the 3 files that make outbound calls are unbounded; the first 3 are listed.
Outbound HTTP without resilience tools/generate-sparkle-notes/planet.py:11— `requests.Session(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience tools/save-session/scripts/save_session.py:66— `urllib.request.urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
AC3 · Page structure· Page without a main landmark · ×2
Page without a main landmark REDACTED:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark Planet/Templates/NoSelection.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (6 members, 50+ identical tokens) Planet/IPFS/IPFSDaemon.swift:394— Planet/IPFS/IPFSDaemon.swift:394-430 | Planet/IPFS/IPFSDaemon.swift:444-478 | Planet/IPFS/IPFSDaemon.swift:480-514 | Planet/IPFS/IPFSDaemon.swift:548-580 | Planet/IPFS/IPFSDaemon.swift:582-614 | Planet/IPFS/IPFSDaemon.swift:616-648 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) Planet/TemplateBrowser/TemplateBrowserSidebar.swift:81— Planet/TemplateBrowser/TemplateBrowserSidebar.swift:81-88 | Planet/TemplateBrowser/TemplateBrowserSidebar.swift:96-103 | Planet/TemplateBrowser/TemplateBrowserSidebar.swift:109-116 | Planet/TemplateBrowser/TemplateBrowserSidebar.swift:123-131 | PlanetLite/AppSidebarItemView.swift:50-65 | PlanetLite/AppSidebarItemView.swift:71-85 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Duplicated block (21–24 lines × 2) Planet/Entities/MyPlanetModel.swift:2528— Planet/Entities/MyPlanetModel.swift:2528-2548 | Planet/Entities/MyPlanetModel.swift:2589-2612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyPlanetModel.swift:2528` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–24 lines × 2) Planet/Search/SearchEmbedding.swift:388— Planet/Search/SearchEmbedding.swift:388-411 | Planet/Search/SearchEmbedding.swift:528-548 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Search/SearchEmbedding.swift:388` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) Planet/Views/My/MyArticleSettingsView.swift:156— Planet/Views/My/MyArticleSettingsView.swift:156-178 | Planet/Views/My/MyPlanetEditView.swift:1085-1107 — 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 `Planet/Views/My/MyArticleSettingsView.swift:156` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (23 lines × 2) Planet/Views/Onboarding/NewOnboardingView.swift:38— Planet/Views/Onboarding/NewOnboardingView.swift:38-60 | Planet/Views/Onboarding/NewOnboardingView.swift:62-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 3) Planet/Helper/FeedUtils.swift:427— Planet/Helper/FeedUtils.swift:427-444 | Planet/Helper/FeedUtils.swift:479-496 | Planet/Helper/FeedUtils.swift:520-537 — 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 `Planet/Helper/FeedUtils.swift:427` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 3) Planet/Views/Components/IndicatorViews.swift:12— Planet/Views/Components/IndicatorViews.swift:12-29 | Planet/Views/Components/IndicatorViews.swift:34-51 | Planet/Views/Components/IndicatorViews.swift:56-73 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) Planet/Entities/FollowingPlanetModel.swift:1719— Planet/Entities/FollowingPlanetModel.swift:1719-1731 | Planet/Entities/FollowingPlanetModel.swift:1740-1752 | Planet/Entities/FollowingPlanetModel.swift:1761-1773 — 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 `Planet/Entities/FollowingPlanetModel.swift:1719` it begins part-way through the construct above it, so those 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, `Planet/Entities/FollowingPlanetModel.swift:1718` calls `renderingMode` and `Planet/Entities/FollowingPlanetModel.swift:1739` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 3) Planet/Views/My/MyPlanetCustomCodeView.swift:88— Planet/Views/My/MyPlanetCustomCodeView.swift:88-100 | Planet/Views/My/MyPlanetCustomCodeView.swift:135-147 | Planet/Views/My/MyPlanetCustomCodeView.swift:173-185 — 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 `Planet/Views/My/MyPlanetCustomCodeView.swift:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 3) Planet/Entities/FollowingPlanetModel.swift:138— Planet/Entities/FollowingPlanetModel.swift:138-148 | Planet/IPFS/IPFSDaemon.swift:1044-1055 | Planet/IPFS/IPFSDaemon.swift:1059-1070 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/FollowingPlanetModel.swift:138` it begins part-way through the construct above it, so those 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, `Planet/Entities/FollowingPlanetModel.swift:137` calls `hasPrefix` and `Planet/IPFS/IPFSDaemon.swift:1043` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–12 lines × 3) Planet/Entities/MyPlanetModel.swift:2008— Planet/Entities/MyPlanetModel.swift:2008-2019 | Planet/Views/Following/FollowingPlanetAvatarView.swift:10-21 | Planet/Views/Sidebar/AccountBadgeView.swift:25-35 — before extracting anything, compare `Planet/Entities/MyPlanetModel.swift` and `Planet/Views/Following/FollowingPlanetAvatarView.swift` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyPlanetModel.swift:2008` it begins part-way through the construct above it, so those 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, `Planet/Views/Sidebar/AccountBadgeView.swift:35` calls `shadow`, `opacity`, `padding` and `Planet/Entities/MyPlanetModel.swift:2019` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–12 lines × 2) Planet/Search/SearchEmbedding.swift:370— Planet/Search/SearchEmbedding.swift:370-381 | Planet/Search/SearchEmbedding.swift:514-523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–12 lines × 2) Planet/Views/Articles/ChatInputField.swift:149— Planet/Views/Articles/ChatInputField.swift:149-160 | Planet/Writer/WriterTextView.swift:314-323 — 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 `Planet/Views/Articles/ChatInputField.swift:149` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) Planet/Search/RelatedArticlesView.swift:201— Planet/Search/RelatedArticlesView.swift:201-211 | Planet/Search/SearchView.swift:117-128 | Planet/Views/Articles/ArticleAIChatView.swift:5423-5433 — before extracting anything, compare `Planet/Search/RelatedArticlesView.swift` and `Planet/Search/SearchView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 134 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 `Planet/Search/RelatedArticlesView.swift:201` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 3) Planet/TemplateBrowser/Template.swift:440— Planet/TemplateBrowser/Template.swift:440-450 | Planet/TemplateBrowser/Template.swift:485-495 | Planet/TemplateBrowser/Template.swift:519-529 — 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 `Planet/TemplateBrowser/Template.swift:440` it does not close everything it opens, so those exact lines 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 × 4) Planet/Key Manager/PlanetKeyManagerWindowController.swift:212— Planet/Key Manager/PlanetKeyManagerWindowController.swift:212-221 | Planet/Key Manager/PlanetKeyManagerWindowController.swift:223-232 | Planet/Key Manager/PlanetKeyManagerWindowController.swift:234-243 | Planet/Key Manager/PlanetKeyManagerWindowController.swift:245-254 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 4) Planet/Views/Components/IndicatorViews.swift:17— Planet/Views/Components/IndicatorViews.swift:17-26 | Planet/Views/Components/IndicatorViews.swift:39-48 | Planet/Views/Components/IndicatorViews.swift:61-70 | Planet/Views/Components/IndicatorViews.swift:82-91 — 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 `Planet/Views/Components/IndicatorViews.swift:17` it begins part-way through the construct above it, so those 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, `Planet/Views/Components/IndicatorViews.swift:93` calls `Spacer` and `Planet/Views/Components/IndicatorViews.swift:28` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 3) REDACTED:330— REDACTED:330-339 | REDACTED:358-367 | REDACTED:479-488 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:330` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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) Planet/Views/Create & Follow Planet/CreatePlanetView.swift:46— Planet/Views/Create & Follow Planet/CreatePlanetView.swift:46-55 | Planet/Views/My/MyPlanetEditView.swift:964-973 | PlanetLite/Croptop/AggregationSettings.swift:51-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Create & Follow Planet/CreatePlanetView.swift:46` it begins part-way through the construct above it, so those exact lines 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 × 3) Planet/Quick Share/PlanetQuickShareDropDelegate.swift:102— Planet/Quick Share/PlanetQuickShareDropDelegate.swift:102-109 | Planet/Quick Share/PlanetQuickShareDropDelegate.swift:123-130 | Planet/Quick Share/PlanetQuickShareDropDelegate.swift:294-302 — 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 `Planet/Quick Share/PlanetQuickShareDropDelegate.swift:102` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 3) Planet/IPFS/IPFSDaemon.swift:121— Planet/IPFS/IPFSDaemon.swift:121-129 | Planet/IPFS/IPFSDaemon.swift:137-145 | Planet/IPFS/IPFSDaemon.swift:151-158 — 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 `Planet/IPFS/IPFSDaemon.swift:121` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `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. 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 × 6) Planet/Entities/MyPlanetModel.swift:3583— Planet/Entities/MyPlanetModel.swift:3583-3590 | Planet/Entities/MyPlanetModel.swift:3624-3631 | Planet/Entities/MyPlanetModel.swift:3643-3650 | Planet/Entities/MyPlanetModel.swift:3741-3748 | Planet/Entities/MyPlanetModel.swift:3760-3767 | Planet/Entities/MyPlanetModel.swift:3836-3843 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyPlanetModel.swift:3583` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `kind` to `kind` in one and `kind) Task.detached(priority: .background` 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 (8 lines × 6) Planet/Log/CloudflarePagesLogger.swift:46— Planet/Log/CloudflarePagesLogger.swift:46-53 | Planet/Log/IPFSLogger.swift:50-57 | Planet/Log/PlanetLogger.swift:54-63 | Planet/Log/PlanetLogger.swift:113-120 | Planet/Log/PlanetLogger.swift:164-171 | Planet/Log/SSHRsyncLogger.swift:46-53 — before extracting anything, compare `Planet/Log/CloudflarePagesLogger.swift` and `Planet/Log/IPFSLogger.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 (7 lines × 3) Planet/Quick Share/PlanetQuickShareViewModel.swift:241— Planet/Quick Share/PlanetQuickShareViewModel.swift:241-247 | Planet/Views/Articles/ArticleListView.swift:65-71 | Planet/Writer/WriterDragAndDrop.swift:112-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (7 lines × 3) Planet/Labs/Quick Post/QuickPostView.swift:397— Planet/Labs/Quick Post/QuickPostView.swift:397-404 | Planet/Writer/WriterTextView.swift:207-213 | Planet/Writer/WriterTitleView.swift:314-320 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (5 lines × 4) Planet/Integrations/CloudflarePages.swift:224— Planet/Integrations/CloudflarePages.swift:224-228 | Planet/Integrations/CloudflarePages.swift:256-260 | Planet/Integrations/CloudflarePages.swift:291-295 | Planet/Integrations/CloudflarePages.swift:396-400 — 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 `Planet/Integrations/CloudflarePages.swift:224` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) Planet/Entities/FollowingPlanetModel.swift:61— Planet/Entities/FollowingPlanetModel.swift:61-65 | Planet/Entities/MyPlanetModel.swift:154-158 | Planet/Entities/MyPlanetModel.swift:281-285 | Planet/Labs/Wallet/EthereumTransaction.swift:83-87 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) Planet/Quick Share/PlanetQuickShareViewModel.swift:250— Planet/Quick Share/PlanetQuickShareViewModel.swift:250-254 | Planet/Views/Articles/ArticleListView.swift:74-78 | Planet/Writer/WriterDragAndDrop.swift:121-125 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) Planet/Search/SearchEmbedding.swift:375— Planet/Search/SearchEmbedding.swift:375-381 | Planet/Search/SearchEmbedding.swift:519-523 | Planet/Search/SearchIndex.swift:300-306 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Search/SearchEmbedding.swift:375` it begins part-way through the construct above it, so those 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.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×1
Animation without a prefers-reduced-motion guard Planet/Templates/TemplatePlaceholder.html:4— This stylesheet animates but never checks prefers-reduced-motion, so motion-sensitive users can't opt out. Wrap motion in @media (prefers-reduced-motion: no-preference).
Low contrast colour pair in CSS (1.0:1) Planet/Templates/WriterBasic.html:11— `hr` sets color: #2b2b2d on background-color: #2b2b2d — 1.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no accessibility linting at author time and no automated accessibility check in tests or CI. Add your UI toolkit's own accessibility assertion to the test suite (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in the pipeline. What was searched, so you can tell an absence from a miss: the 5 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
Stateful handler: PlanetAPIController REDACTED:11— `PlanetAPIController` serves requests (Vapor route handlers run concurrently — SwiftNIO serves one event loop per core and async handlers run on the cooperative thread pool — and every request shares the one `PlanetAPIController` instance the router holds) but writes shared state outside any lock (PlanetStore.shared; e.g. `PlanetStore.shared` in `routeCreatePlanet` at line 628). Unsynchronised concurrent writes are a data race in Swift: an update is lost, and a concurrent Array or Dictionary write corrupts its storage.
ArticleAIChatView.parseCompletionStepFromStreamingBytes (cyclomatic 172) Planet/Views/Articles/ArticleAIChatView.swift:3554— ArticleAIChatView.parseCompletionStepFromStreamingBytes has cyclomatic complexity 172 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MyPlanetModel.== (cyclomatic 77) Planet/Entities/MyPlanetModel.swift:906— MyPlanetModel.== has cyclomatic complexity 77 (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.
MyPlanetModel.importBackup (cyclomatic 66) Planet/Entities/MyPlanetModel.swift:1470— MyPlanetModel.importBackup has cyclomatic complexity 66 (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.
ArticleWebViewModel.checkArticleLink (cyclomatic 46) Planet/Views/Articles/ArticleWebViewModel.swift:54— ArticleWebViewModel.checkArticleLink has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ArticleAIChatView.summarizeToolArguments (cyclomatic 45) Planet/Views/Articles/ArticleAIChatView.swift:3225— ArticleAIChatView.summarizeToolArguments has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FollowingPlanetModel.update (cyclomatic 44) Planet/Entities/FollowingPlanetModel.swift:1018— FollowingPlanetModel.update has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MyPlanetModel.performPublish (cyclomatic 43) Planet/Entities/MyPlanetModel.swift:2784— MyPlanetModel.performPublish 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.
MyPlanetModel.savePublic (cyclomatic 38) Planet/Entities/MyPlanetModel.swift:2185— MyPlanetModel.savePublic has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FollowingArticleModel.browserURL (cyclomatic 36) Planet/Entities/FollowingArticleModel.swift:188— FollowingArticleModel.browserURL has cyclomatic complexity 36 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ArticleAIChatView.escapeRawControlCharactersInsideJSONString (cyclomatic 32) Planet/Views/Articles/ArticleAIChatView.swift:5950— ArticleAIChatView.escapeRawControlCharactersInsideJSONString has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ArticleListView.swift.filteredArticles (cyclomatic 32) Planet/Views/Articles/ArticleListView.swift:377— ArticleListView.swift.filteredArticles has cyclomatic complexity 32 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
SearchEmbedding.findRelated (cyclomatic 31) Planet/Search/SearchEmbedding.swift:416— SearchEmbedding.findRelated 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.
MyArticleItemView.body (cyclomatic 31) Planet/Views/My/MyArticleItemView.swift:7— MyArticleItemView.body has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SearchEmbedding.search (cyclomatic 29) Planet/Search/SearchEmbedding.swift:274— SearchEmbedding.search has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ArticleAIChatView.body (cyclomatic 29) Planet/Views/Articles/ArticleAIChatView.swift:383— ArticleAIChatView.body has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MyPlanetModel.fetchArticleAttachments (cyclomatic 28) Planet/Entities/MyPlanetModel.swift:771— MyPlanetModel.fetchArticleAttachments 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.
ArticleAIChatView.summarizeToolResult (cyclomatic 28) Planet/Views/Articles/ArticleAIChatView.swift:3361— ArticleAIChatView.summarizeToolResult 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.
ArticleView.body (cyclomatic 27) Planet/Views/Articles/ArticleView.swift:258— ArticleView.body 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.
IPFSDaemon.setupIPFS (cyclomatic 26) Planet/IPFS/IPFSDaemon.swift:30— IPFSDaemon.setupIPFS has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PlanetStore.refreshSelectedArticles (cyclomatic 25) Planet/Entities/PlanetStore.swift:763— PlanetStore.refreshSelectedArticles has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MarkdownListAutocomplete.evaluateBeforeNewline (cyclomatic 25) Planet/Helper/MarkdownListAutocomplete.swift:98— MarkdownListAutocomplete.evaluateBeforeNewline has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ArticleAIChatView.normalizeInlineLatex (cyclomatic 25) Planet/Views/Articles/ArticleAIChatView.swift:1921— ArticleAIChatView.normalizeInlineLatex has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MyPlanetSidebarItem.body (cyclomatic 25) Planet/Views/Sidebar/MyPlanetSidebarItem.swift:10— MyPlanetSidebarItem.body has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MyArticleModel.getHeroImage (cyclomatic 24) Planet/Entities/MyArticleModel.swift:345— MyArticleModel.getHeroImage 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.
SearchIndex.makeSnippet (cyclomatic 24) Planet/Search/SearchIndex.swift:439— SearchIndex.makeSnippet 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.
ArticleAIChatView.requestReply (cyclomatic 24) Planet/Views/Articles/ArticleAIChatView.swift:2839— ArticleAIChatView.requestReply 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.
ArticleWebViewModel.processPossibleInternalLink (cyclomatic 24) Planet/Views/Articles/ArticleWebViewModel.swift:268— ArticleWebViewModel.processPossibleInternalLink 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.
PFDashboardWindowController.toolbar (cyclomatic 24) Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:201— PFDashboardWindowController.toolbar 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.
MyArticleGridView.body (cyclomatic 23) Planet/Views/My/MyArticleGridView.swift:16— MyArticleGridView.body has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MarkdownListAutocomplete.evaluate (cyclomatic 22) Planet/Helper/MarkdownListAutocomplete.swift:25— MarkdownListAutocomplete.evaluate has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WalletManager.setupV2 (cyclomatic 22) Planet/Labs/Wallet/WalletManager.swift:191— WalletManager.setupV2 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.
DraftModel.saveToArticle (cyclomatic 21) Planet/Entities/DraftModel.swift:433— DraftModel.saveToArticle 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.
FollowingArticleModel.renderLocalPreview (cyclomatic 21) Planet/Entities/FollowingArticleModel.swift:41— FollowingArticleModel.renderLocalPreview 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.
MyArticleModel.prewarm (cyclomatic 21) Planet/Entities/MyArticleModel.swift:518— MyArticleModel.prewarm has cyclomatic complexity 21 (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.
MyPlanetModel.shouldDownloadManagedAttachment (cyclomatic 21) Planet/Entities/MyPlanetModel.swift:479— MyPlanetModel.shouldDownloadManagedAttachment has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MyPlanetModel.updateExistingAggregatedArticle (cyclomatic 21) Planet/Entities/MyPlanetModel.swift:659— MyPlanetModel.updateExistingAggregatedArticle has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
IPFSDaemon.gc (cyclomatic 21) Planet/IPFS/IPFSDaemon.swift:757— IPFSDaemon.gc 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.
ArticleAIChatView.chatMessageList (cyclomatic 21) Planet/Views/Articles/ArticleAIChatView.swift:891— ArticleAIChatView.chatMessageList 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.
MyPlanetEditView.body (cyclomatic 21) Planet/Views/My/MyPlanetEditView.swift:849— MyPlanetEditView.body has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PlanetStore.restoreSavedMyArticleSelection (cyclomatic 20) Planet/Entities/PlanetStore.swift:939— PlanetStore.restoreSavedMyArticleSelection 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.
ArticleAIChatView.parseCompletionStep (cyclomatic 20) Planet/Views/Articles/ArticleAIChatView.swift:4192— ArticleAIChatView.parseCompletionStep 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.
ArticleListView.body (cyclomatic 20) Planet/Views/Articles/ArticleListView.swift:525— ArticleListView.body 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.
FollowingArticleItemView.body (cyclomatic 20) Planet/Views/Following/FollowingArticleItemView.swift:9— FollowingArticleItemView.body has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MyPlanetTemplateSettingsView.body (cyclomatic 20) Planet/Views/My/MyPlanetTemplateSettingsView.swift:28— MyPlanetTemplateSettingsView.body 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.
WebAppUpdater.updateWebApp (cyclomatic 19) Planet/API/WebAppUpdater.swift:24— WebAppUpdater.updateWebApp 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.
ArticleModel.starView (cyclomatic 19) Planet/Entities/ArticleModel.swift:199— ArticleModel.starView 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.
MyArticleModel.processNFTMetadata (cyclomatic 19) Planet/Entities/MyArticleModel.swift:142— MyArticleModel.processNFTMetadata 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.
FeedUtils.findFeed (cyclomatic 19) Planet/Helper/FeedUtils.swift:74— FeedUtils.findFeed 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.
ArticleAIChatView.convertLatexCommand (cyclomatic 19) Planet/Views/Articles/ArticleAIChatView.swift:2164— ArticleAIChatView.convertLatexCommand 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.
ArticleAIRepoGrep.search (cyclomatic 19) Planet/Views/Articles/ArticleAIOnDeviceTools.swift:95— ArticleAIRepoGrep.search 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.
MyArticleSettingsView.body (cyclomatic 19) Planet/Views/My/MyArticleSettingsView.swift:51— MyArticleSettingsView.body 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.
PNCommandRunner.parseGlobalOptions (cyclomatic 18) PlanetCLI/PNCommandRunner.swift:111— PNCommandRunner.parseGlobalOptions 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.
FollowingPlanetModel.browserURL (cyclomatic 18) Planet/Entities/FollowingPlanetModel.swift:103— FollowingPlanetModel.browserURL 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.
PlanetStore.init (cyclomatic 18) Planet/Entities/PlanetStore.swift:328— PlanetStore.init has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PlanetQuickShareViewModel.prepareFiles (cyclomatic 18) Planet/Quick Share/PlanetQuickShareViewModel.swift:61— PlanetQuickShareViewModel.prepareFiles has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AvatarPickerView.body (cyclomatic 18) Planet/Views/My/AvatarPickerView.swift:65— AvatarPickerView.body 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.
MyPlanetEditView.filebaseView (cyclomatic 18) Planet/Views/My/MyPlanetEditView.swift:664— MyPlanetEditView.filebaseView 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.
AppContentDropDelegate.performDrop (cyclomatic 17) PlanetLite/AppContentDropDelegate.swift:25— AppContentDropDelegate.performDrop 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.
AppSidebarItemView.body (cyclomatic 17) PlanetLite/AppSidebarItemView.swift:145— AppSidebarItemView.body 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.
MyArticleModel.browserURL (cyclomatic 17) Planet/Entities/MyArticleModel.swift:166— MyArticleModel.browserURL 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.
MyPlanetModel.fetchPlanetSite (cyclomatic 17) Planet/Entities/MyPlanetModel.swift:968— MyPlanetModel.fetchPlanetSite 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.
DragPasteboardMedia.supportedAttachmentType (cyclomatic 17) Planet/Helper/DragPasteboardMedia.swift:117— DragPasteboardMedia.supportedAttachmentType 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.
FeedUtils.parseFeed (cyclomatic 17) Planet/Helper/FeedUtils.swift:446— FeedUtils.parseFeed 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.
PlanetQuickShareView.attachmentSection (cyclomatic 17) Planet/Quick Share/PlanetQuickShareView.swift:162— PlanetQuickShareView.attachmentSection 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.
SearchIndex.sanitizeFTSQuery (cyclomatic 17) Planet/Search/SearchIndex.swift:360— SearchIndex.sanitizeFTSQuery 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.
PlanetSettingsAIView.body (cyclomatic 17) Planet/Settings/PlanetSettingsAIView.swift:88— PlanetSettingsAIView.body 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.
Filebase.pin (cyclomatic 16) Planet/Integrations/Filebase.swift:15— Filebase.pin 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.
TemplateStore.load (cyclomatic 16) Planet/TemplateBrowser/TemplateStore.swift:42— TemplateStore.load 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.
IconGalleryView.body (cyclomatic 16) Planet/Labs/Icon Gallery/IconGalleryView.swift:16— IconGalleryView.body 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.
TBWindowController.toolbar (cyclomatic 16) Planet/TemplateBrowser/Window Controller/TBWindowController.swift:164— TBWindowController.toolbar 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.
ArticleAIChatView.convertLatexExpression (cyclomatic 16) Planet/Views/Articles/ArticleAIChatView.swift:2064— ArticleAIChatView.convertLatexExpression 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.
ArticleAIChatView.unescapeJSONStringLikeValue (cyclomatic 16) Planet/Views/Articles/ArticleAIChatView.swift:5877— ArticleAIChatView.unescapeJSONStringLikeValue 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.
ArticleAIChatView.runShellCommand (cyclomatic 16) Planet/Views/Articles/ArticleAIChatView.swift:6754— ArticleAIChatView.runShellCommand 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.
FixmeComment Planet/Entities/FollowingArticleModel.swift:243— // FIXME: This issue still exists as of 2024-Feb-21 — 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.
ArticleAIChatView.parseCompletionStepFromStreamingBytes (cognitive 303) Planet/Views/Articles/ArticleAIChatView.swift:3554— ArticleAIChatView.parseCompletionStepFromStreamingBytes has cognitive complexity 303 (threshold 15). Drivers by points: if/else 107 (224 pts), boolean chains 52, loops 7 (15 pts), ternaries 3 (7 pts), error handling 3 (5 pts) (nesting depth added 131). 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.
MyPlanetModel.savePublic (cognitive 140) Planet/Entities/MyPlanetModel.swift:2185— MyPlanetModel.savePublic has cognitive complexity 140 (threshold 15). Drivers by points: if/else 27 (95 pts), loops 7 (31 pts), error handling 5 (9 pts), boolean chains 5 (nesting depth added 96). 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.
FollowingPlanetModel.update (cognitive 103) Planet/Entities/FollowingPlanetModel.swift:1018— FollowingPlanetModel.update has cognitive complexity 103 (threshold 15). Drivers by points: if/else 40 (90 pts), error handling 4 (8 pts), boolean chains 4, match/switch 1 (nesting depth added 54). 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.
ArticleWebViewModel.checkArticleLink (cognitive 97) Planet/Views/Articles/ArticleWebViewModel.swift:54— ArticleWebViewModel.checkArticleLink has cognitive complexity 97 (threshold 15). Drivers by points: if/else 24 (60 pts), loops 10 (26 pts), boolean chains 11 (nesting depth added 52). 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.
MyPlanetModel.importBackup (cognitive 78) Planet/Entities/MyPlanetModel.swift:1470— MyPlanetModel.importBackup has cognitive complexity 78 (threshold 15). Drivers by points: if/else 59 (69 pts), error handling 4 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 11). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ArticleAIChatView.summarizeToolArguments (cognitive 77) Planet/Views/Articles/ArticleAIChatView.swift:3225— ArticleAIChatView.summarizeToolArguments has cognitive complexity 77 (threshold 15). Drivers by points: if/else 38 (67 pts), ternaries 3 (7 pts), boolean chains 2, match/switch 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MyPlanetModel.== (cognitive 76) Planet/Entities/MyPlanetModel.swift:906— MyPlanetModel.== has cognitive complexity 76 (threshold 15). Drivers by points: boolean chains 74, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MyPlanetModel.performPublish (cognitive 71) Planet/Entities/MyPlanetModel.swift:2784— MyPlanetModel.performPublish has cognitive complexity 71 (threshold 15). Drivers by points: if/else 25 (49 pts), boolean chains 11, error handling 4 (8 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleAIChatView.escapeRawControlCharactersInsideJSONString (cognitive 66) Planet/Views/Articles/ArticleAIChatView.swift:5950— ArticleAIChatView.escapeRawControlCharactersInsideJSONString has cognitive complexity 66 (threshold 15). Drivers by points: if/else 19 (53 pts), boolean chains 6, match/switch 2 (6 pts), loops 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.
MyPlanetModel.fetchArticleAttachments (cognitive 57) Planet/Entities/MyPlanetModel.swift:771— MyPlanetModel.fetchArticleAttachments has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (37 pts), loops 5 (9 pts), boolean chains 6, error handling 2 (5 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WalletManager.setupV2 (cognitive 56) Planet/Labs/Wallet/WalletManager.swift:191— WalletManager.setupV2 has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (36 pts), error handling 4 (14 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleAIChatView.requestReply (cognitive 52) Planet/Views/Articles/ArticleAIChatView.swift:2839— ArticleAIChatView.requestReply has cognitive complexity 52 (threshold 15). Drivers by points: if/else 17 (42 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts), error handling 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MyPlanetModel.fetchPlanetSite (cognitive 51) Planet/Entities/MyPlanetModel.swift:968— MyPlanetModel.fetchPlanetSite has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (40 pts), loops 2 (6 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SearchEmbedding.findRelated (cognitive 48) Planet/Search/SearchEmbedding.swift:416— SearchEmbedding.findRelated has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 14, loops 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleAIChatView.normalizeInlineLatex (cognitive 48) Planet/Views/Articles/ArticleAIChatView.swift:1921— ArticleAIChatView.normalizeInlineLatex has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 8, loops 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MyArticleModel.getHeroImage (cognitive 45) Planet/Entities/MyArticleModel.swift:345— MyArticleModel.getHeroImage has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 10, loops 1 (2 pts) (nesting depth added 20). 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.
IPFSDaemon.gc (cognitive 44) Planet/IPFS/IPFSDaemon.swift:757— IPFSDaemon.gc has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 5 (9 pts), error handling 3 (8 pts), boolean chains 3 (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.
SearchEmbedding.search (cognitive 43) Planet/Search/SearchEmbedding.swift:274— SearchEmbedding.search has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 12, loops 1 (2 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppContentItemView.itemPreviewImageView (cognitive 42) PlanetLite/AppContentItemView.swift:73— AppContentItemView.itemPreviewImageView has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (35 pts), error handling 1 (5 pts), boolean chains 2 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ArticleWebViewModel.processPossibleInternalLink (cognitive 42) Planet/Views/Articles/ArticleWebViewModel.swift:268— ArticleWebViewModel.processPossibleInternalLink has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (34 pts), boolean chains 8 (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.
MyArticleItemView.body (cognitive 42) Planet/Views/My/MyArticleItemView.swift:7— MyArticleItemView.body has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (27 pts), error handling 5 (8 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ArticleAIRepoGrep.search (cognitive 41) Planet/Views/Articles/ArticleAIOnDeviceTools.swift:95— ArticleAIRepoGrep.search has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (33 pts), ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (2 pts), boolean chains 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.
MyPlanetTemplateSettingsView.body (cognitive 39) Planet/Views/My/MyPlanetTemplateSettingsView.swift:28— MyPlanetTemplateSettingsView.body has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 4 (7 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 20). 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.
TemplateStore.load (cognitive 38) Planet/TemplateBrowser/TemplateStore.swift:42— TemplateStore.load has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 3, boolean chains 2, error handling 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleView.body (cognitive 38) Planet/Views/Articles/ArticleView.swift:258— ArticleView.body has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (19 pts), ternaries 3 (9 pts), boolean chains 8, error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FollowingArticleModel.renderLocalPreview (cognitive 37) Planet/Entities/FollowingArticleModel.swift:41— FollowingArticleModel.renderLocalPreview has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 9, loops 2 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FollowingArticleModel.browserURL (cognitive 37) Planet/Entities/FollowingArticleModel.swift:188— FollowingArticleModel.browserURL has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 4 (9 pts), boolean chains 8 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppContentDropDelegate.performDrop (cognitive 35) PlanetLite/AppContentDropDelegate.swift:25— AppContentDropDelegate.performDrop has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (22 pts), error handling 2 (6 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WebAppUpdater.updateWebApp (cognitive 35) Planet/API/WebAppUpdater.swift:24— WebAppUpdater.updateWebApp has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 8, error handling 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MyPlanetModel.fetchHTTPSite (cognitive 35) Planet/Entities/MyPlanetModel.swift:1115— MyPlanetModel.fetchHTTPSite has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (30 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 21). 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.
IPFSDaemon.setupIPFS (cognitive 35) Planet/IPFS/IPFSDaemon.swift:30— IPFSDaemon.setupIPFS has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 12, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MyArticleGridView.body (cognitive 34) Planet/Views/My/MyArticleGridView.swift:16— MyArticleGridView.body has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (20 pts), error handling 5 (9 pts), boolean chains 5 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DraftModel.saveToArticle (cognitive 33) Planet/Entities/DraftModel.swift:433— DraftModel.saveToArticle has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 4, error handling 1, loops 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlanetStore.refreshSelectedArticles (cognitive 33) Planet/Entities/PlanetStore.swift:763— PlanetStore.refreshSelectedArticles has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 3, ternaries 1 (2 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DotBitKit.resolve (cognitive 33) Planet/Helper/DotBitKit.swift:29— DotBitKit.resolve has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 1 (4 pts), boolean chains 2, error handling 1 (2 pts) (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.
ArticleAIChatView.summarizeToolResult (cognitive 33) Planet/Views/Articles/ArticleAIChatView.swift:3361— ArticleAIChatView.summarizeToolResult has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 4, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleAIChatView.parseCompletionStep (cognitive 33) Planet/Views/Articles/ArticleAIChatView.swift:4192— ArticleAIChatView.parseCompletionStep has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 3 (8 pts), boolean chains 7, loops 2 (5 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.
ArticleListView.body (cognitive 33) Planet/Views/Articles/ArticleListView.swift:525— ArticleListView.body has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 5, ternaries 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.
SearchIndex.makeSnippet (cognitive 32) Planet/Search/SearchIndex.swift:439— SearchIndex.makeSnippet has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 7, loops 3 (6 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.
ArticleAIChatView.body (cognitive 32) Planet/Views/Articles/ArticleAIChatView.swift:383— ArticleAIChatView.body has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 6, match/switch 3, ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MyArticleSettingsView.body (cognitive 32) Planet/Views/My/MyArticleSettingsView.swift:51— MyArticleSettingsView.body has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (23 pts), ternaries 3 (6 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MyPlanetEditView.filebaseView (cognitive 32) Planet/Views/My/MyPlanetEditView.swift:664— MyPlanetEditView.filebaseView has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 6, match/switch 1 (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.
MyPlanetSidebarItem.body (cognitive 32) Planet/Views/Sidebar/MyPlanetSidebarItem.swift:10— MyPlanetSidebarItem.body has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 5, error handling 4, ternaries 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PFDashboardWindowController.toolbar (cognitive 32) Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:201— PFDashboardWindowController.toolbar has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 4, match/switch 1 (nesting depth added 15). 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.
ArticleModel.starView (cognitive 30) Planet/Entities/ArticleModel.swift:199— ArticleModel.starView has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 9 (26 pts), if/else 2, match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DragPasteboardMedia.importedFiles (cognitive 30) Planet/Helper/DragPasteboardMedia.swift:147— DragPasteboardMedia.importedFiles has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 3 (8 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IconManager.preparePreviewAnimationImages (cognitive 30) Planet/Labs/Icon Gallery/IconManager.swift:245— IconManager.preparePreviewAnimationImages has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ArticleAIChatView.chatMessageList (cognitive 30) Planet/Views/Articles/ArticleAIChatView.swift:891— ArticleAIChatView.chatMessageList has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 12 (21 pts), if/else 6 (7 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.
FollowingArticleModel.webviewURL (cognitive 28) Planet/Entities/FollowingArticleModel.swift:126— FollowingArticleModel.webviewURL has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (25 pts), boolean chains 2, 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.
MyArticleModel.prewarm (cognitive 28) Planet/Entities/MyArticleModel.swift:518— MyArticleModel.prewarm has cognitive complexity 28 (threshold 15). Drivers by points: error handling 8 (15 pts), if/else 9, boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MyPlanetModel.publishIPNSKeepAlive (cognitive 27) Planet/Entities/MyPlanetModel.swift:3026— MyPlanetModel.publishIPNSKeepAlive has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 2, error handling 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FeedUtils.findFeed (cognitive 27) Planet/Helper/FeedUtils.swift:74— FeedUtils.findFeed has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 6 (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.
FollowingArticleItemView.body (cognitive 27) Planet/Views/Following/FollowingArticleItemView.swift:9— FollowingArticleItemView.body has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MyPlanetEditView.pinnableView (cognitive 27) Planet/Views/My/MyPlanetEditView.swift:581— MyPlanetEditView.pinnableView has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MyArticleModel.importArticles (cognitive 26) Planet/Entities/MyArticleModel.swift:137— MyArticleModel.importArticles has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (6 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.
MyArticleModel.processNFTMetadata (cognitive 26) Planet/Entities/MyArticleModel.swift:142— MyArticleModel.processNFTMetadata has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 9, ternaries 2 (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.
PlanetStore.restoreSavedMyArticleSelection (cognitive 26) Planet/Entities/PlanetStore.swift:939— PlanetStore.restoreSavedMyArticleSelection has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 3, boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkdownListAutocomplete.evaluateBeforeNewline (cognitive 26) Planet/Helper/MarkdownListAutocomplete.swift:98— MarkdownListAutocomplete.evaluateBeforeNewline has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 12, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Filebase.pin (cognitive 26) Planet/Integrations/Filebase.swift:15— Filebase.pin has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 1 (3 pts), boolean chains 2, error handling 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.
ArticleAIChatView.convertLatexCommand (cognitive 26) Planet/Views/Articles/ArticleAIChatView.swift:2164— ArticleAIChatView.convertLatexCommand has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (7 pts), boolean chains 5, ternaries 1 (2 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleAIChatView.runShellCommand (cognitive 26) Planet/Views/Articles/ArticleAIChatView.swift:6754— ArticleAIChatView.runShellCommand has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AttributedConsoleView.updateNSView (cognitive 25) Planet/API/PlanetAPIConsoleView.swift:45— AttributedConsoleView.updateNSView has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 1 (5 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleModel.mediaLabels (cognitive 25) Planet/Entities/ArticleModel.swift:81— ArticleModel.mediaLabels has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 5 (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.
MyPlanetModel.renderRSS (cognitive 25) Planet/Entities/MyPlanetModel.swift:2099— MyPlanetModel.renderRSS has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AvatarPickerView.body (cognitive 25) Planet/Views/My/AvatarPickerView.swift:65— AvatarPickerView.body has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 3 (6 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DraftModel.addAttachment (cognitive 24) Planet/Entities/DraftModel.swift:286— DraftModel.addAttachment has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MyArticleModel.removeDSStore (cognitive 24) Planet/Entities/MyArticleModel.swift:657— MyArticleModel.removeDSStore has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 3 (10 pts), loops 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.
PlanetQuickShareDropDelegate.processDropInfo (cognitive 24) Planet/Quick Share/PlanetQuickShareDropDelegate.swift:38— PlanetQuickShareDropDelegate.processDropInfo has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 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.
PlanetQuickShareViewModel.prepareFiles (cognitive 24) Planet/Quick Share/PlanetQuickShareViewModel.swift:61— PlanetQuickShareViewModel.prepareFiles has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 6, match/switch 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PlanetSettingsAIView.body (cognitive 24) Planet/Settings/PlanetSettingsAIView.swift:88— PlanetSettingsAIView.body has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 4, error handling 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
IconGalleryView.body (cognitive 24) Planet/Labs/Icon Gallery/IconGalleryView.swift:16— IconGalleryView.body has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleListView.swift.filteredArticles (cognitive 24) Planet/Views/Articles/ArticleListView.swift:377— ArticleListView.swift.filteredArticles has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 9, match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PlanetStore.init (cognitive 23) Planet/Entities/PlanetStore.swift:328— PlanetStore.init has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 1, error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MarkdownListAutocomplete.evaluate (cognitive 23) Planet/Helper/MarkdownListAutocomplete.swift:25— MarkdownListAutocomplete.evaluate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 10 (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.
URLUtils.repoPath (cognitive 23) Planet/Helper/URLUtils.swift:50— URLUtils.repoPath has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
PlanetQuickShareView.attachmentSection (cognitive 23) Planet/Quick Share/PlanetQuickShareView.swift:162— PlanetQuickShareView.attachmentSection has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 8 (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.
PlanetQuickShareViewModel.processPasteItems (cognitive 23) Planet/Quick Share/PlanetQuickShareViewModel.swift:119— PlanetQuickShareViewModel.processPasteItems has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 2 (5 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.
SearchIndex.sanitizeFTSQuery (cognitive 23) Planet/Search/SearchIndex.swift:360— SearchIndex.sanitizeFTSQuery has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, loops 3 (4 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.
ArticleAIChatView.convertLatexExpression (cognitive 23) Planet/Views/Articles/ArticleAIChatView.swift:2064— ArticleAIChatView.convertLatexExpression has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (6 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleAIChatView.sendOnDeviceMessage (cognitive 23) Planet/Views/Articles/ArticleAIChatView.swift:2714— ArticleAIChatView.sendOnDeviceMessage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OnDeviceToolContext.reloadStoreAndRestoreSelection (cognitive 23) Planet/Views/Articles/ArticleAIOnDeviceTools.swift:563— OnDeviceToolContext.reloadStoreAndRestoreSelection has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MyPlanetModel.shouldDownloadManagedAttachment (cognitive 22) Planet/Entities/MyPlanetModel.swift:479— MyPlanetModel.shouldDownloadManagedAttachment has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (10 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
FeedUtils.parseFeed (cognitive 22) Planet/Helper/FeedUtils.swift:446— FeedUtils.parseFeed has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6, ternaries 1 (2 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DockIconPreviewView.body (cognitive 22) Planet/Labs/Icon Gallery/IconManager.swift:32— DockIconPreviewView.body has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 1 (3 pts), boolean chains 1, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IconManager.playAnimation (cognitive 22) Planet/Labs/Icon Gallery/IconManager.swift:445— IconManager.playAnimation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 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.
ArticleView.toolbarPlanetView (cognitive 22) Planet/Views/Articles/ArticleView.swift:958— ArticleView.toolbarPlanetView has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, error handling 1 (2 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MyPlanetEditView.body (cognitive 22) Planet/Views/My/MyPlanetEditView.swift:849— MyPlanetEditView.body has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, error handling 3 (4 pts), loops 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FollowingPlanetModel.load (cognitive 21) Planet/Entities/FollowingPlanetModel.swift:296— FollowingPlanetModel.load has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MyArticleModel.processAttachmentCIDIfNeeded (cognitive 21) Planet/Entities/MyArticleModel.swift:80— MyArticleModel.processAttachmentCIDIfNeeded has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DragPasteboardMedia.supportedAttachmentType (cognitive 21) Planet/Helper/DragPasteboardMedia.swift:117— DragPasteboardMedia.supportedAttachmentType has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, ternaries 2 (4 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KeyboardShortcutHelper.publishedFoldersMenus (cognitive 21) Planet/Helper/KeyboardShortcutHelper.swift:534— KeyboardShortcutHelper.publishedFoldersMenus has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2 (nesting depth added 10). 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.
IPFSOpenView.open (cognitive 21) Planet/IPFS/Open Views/IPFSOpenView.swift:69— IPFSOpenView.open has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3 (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.
ArticleAIChatView.normalizeLatexMarkup (cognitive 21) Planet/Views/Articles/ArticleAIChatView.swift:1883— ArticleAIChatView.normalizeLatexMarkup has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 5, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleAIChatView.decodeJSONObject (cognitive 21) Planet/Views/Articles/ArticleAIChatView.swift:5788— ArticleAIChatView.decodeJSONObject has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
app.search_notes (cognitive 21) tools/generate-sparkle-notes/app.py:332— app.search_notes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 3 (8 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.
PlanetAppDelegate.application (cognitive 20) Planet/PlanetAppDelegate.swift:29— PlanetAppDelegate.application has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9, error handling 4 (8 pts), match/switch 1 (3 pts) (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PlanetAppDelegate.handleAPIControlURL (cognitive 20) Planet/PlanetAppDelegate.swift:101— PlanetAppDelegate.handleAPIControlURL has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, 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.
PNCommandRunner.parseGlobalOptions (cognitive 20) PlanetCLI/PNCommandRunner.swift:111— PNCommandRunner.parseGlobalOptions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4, match/switch 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.
MyPlanetModel.updateExistingAggregatedArticle (cognitive 20) Planet/Entities/MyPlanetModel.swift:659— MyPlanetModel.updateExistingAggregatedArticle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PlanetStore.reloadAfterExternalMyDataChange (cognitive 20) Planet/Entities/PlanetStore.swift:454— PlanetStore.reloadAfterExternalMyDataChange has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ArticleView.toolbarAttachmentsView (cognitive 20) Planet/Views/Articles/ArticleView.swift:784— ArticleView.toolbarAttachmentsView has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 1 (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.
Coordinator.webView (cognitive 20) Planet/Views/Articles/ArticleWebView.swift:268— Coordinator.webView has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlanetAPIControlView.controlView (cognitive 19) REDACTED:136— PlanetAPIControlView.controlView has cognitive complexity 19 (threshold 15). Drivers by points: error handling 6 (13 pts), if/else 5 (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.
TBWindowController.toolbar (cognitive 19) Planet/TemplateBrowser/Window Controller/TBWindowController.swift:164— TBWindowController.toolbar has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, 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.
ArticleView.syncSelectedArticlePresentation (cognitive 19) Planet/Views/Articles/ArticleView.swift:647— ArticleView.syncSelectedArticlePresentation has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FollowPlanetView.processInput (cognitive 19) Planet/Views/Create & Follow Planet/FollowPlanetView.swift:83— FollowPlanetView.processInput has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 1 (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.
Coordinator.webView (cognitive 19) Planet/Labs/Published Folders/Dashboard/PFDashboardContentView.swift:100— Coordinator.webView has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
save_session.find_existing_article (cognitive 19) tools/save-session/scripts/save_session.py:176— save_session.find_existing_article has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppContentView.body (cognitive 18) PlanetLite/AppContentView.swift:27— AppContentView.body has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), match/switch 2 (3 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AppSidebarItemView.body (cognitive 18) PlanetLite/AppSidebarItemView.swift:145— AppSidebarItemView.body has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, error handling 2, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
dWebServices.publish (cognitive 18) Planet/Integrations/dWebServices.swift:15— dWebServices.publish has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleAIChatView.unescapeJSONStringLikeValue (cognitive 18) Planet/Views/Articles/ArticleAIChatView.swift:5877— ArticleAIChatView.unescapeJSONStringLikeValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlanetStore+Search.swift.searchSnapshots (cognitive 18) Planet/Search/PlanetStore+Search.swift:186— PlanetStore+Search.swift.searchSnapshots has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (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.
MyPlanetModel.ensureArticleNumbers (cognitive 17) Planet/Entities/MyPlanetModel.swift:742— MyPlanetModel.ensureArticleNumbers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 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.
SearchEmbedding.rebuildEmbeddings (cognitive 17) Planet/Search/SearchEmbedding.swift:183— SearchEmbedding.rebuildEmbeddings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VideoInfoRow.startCompression (cognitive 17) Planet/Writer/VideoInfoRow.swift:205— VideoInfoRow.startCompression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WalletAccountView.loadENS (cognitive 17) Planet/Labs/Wallet/WalletAccountView.swift:249— WalletAccountView.loadENS has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (17 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.
ArticleSpeechPlayerViewModel.detectLanguage (cognitive 17) Planet/Views/Articles/ArticleSpeechPlayer.swift:45— ArticleSpeechPlayerViewModel.detectLanguage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, 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.
MyArticleSettingsView.verifyUserInput (cognitive 17) Planet/Views/My/MyArticleSettingsView.swift:408— MyArticleSettingsView.verifyUserInput has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 1 (4 pts), boolean chains 1 (nesting depth added 10). 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.
PlanetSidebarView.body (cognitive 17) Planet/Views/Sidebar/PlanetSidebarView.swift:25— PlanetSidebarView.body has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 3 (5 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PlanetDownloadsItemView.body (cognitive 16) Planet/Downloads/PlanetDownloadsItemView.swift:19— PlanetDownloadsItemView.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MyArticleModel.browserURL (cognitive 16) Planet/Entities/MyArticleModel.swift:166— MyArticleModel.browserURL has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (4 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.
MyArticleModel.toggleToDoItem (cognitive 16) Planet/Entities/MyArticleModel.swift:703— MyArticleModel.toggleToDoItem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MyPlanetModel.aggregate (cognitive 16) Planet/Entities/MyPlanetModel.swift:193— MyPlanetModel.aggregate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 2 (4 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlanetStore.checkPinnable (cognitive 16) Planet/Entities/PlanetStore.swift:43— PlanetStore.checkPinnable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), error handling 1 (5 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FeedUtils.findLinkFromFeed (cognitive 16) Planet/Helper/FeedUtils.swift:368— FeedUtils.findLinkFromFeed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlanetKeyManagerWindowController.validateToolbarItem (cognitive 16) Planet/Key Manager/PlanetKeyManagerWindowController.swift:172— PlanetKeyManagerWindowController.validateToolbarItem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, match/switch 1 (nesting depth added 5). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
IPFSIdentitySheetView.content (cognitive 16) Planet/IPFS/Open Views/IPFSOpenView.swift:176— IPFSIdentitySheetView.content has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlanetPublishedServiceStore.updatePendingPublishings (cognitive 16) Planet/Labs/Published Folders/PlanetPublishedServiceStore.swift:191— PlanetPublishedServiceStore.updatePendingPublishings has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleAIChatView.isLikelyLatexMathSpan (cognitive 16) Planet/Views/Articles/ArticleAIChatView.swift:2000— ArticleAIChatView.isLikelyLatexMathSpan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArticleAIChatView.formatTokenUsage (cognitive 16) Planet/Views/Articles/ArticleAIChatView.swift:4262— ArticleAIChatView.formatTokenUsage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 6, boolean chains 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
WriteArticleTool.call (cognitive 16) Planet/Views/Articles/ArticleAIOnDeviceTools.swift:655— WriteArticleTool.call has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
MyPlanetEditView.verifyUserInput (cognitive 16) Planet/Views/My/MyPlanetEditView.swift:1402— MyPlanetEditView.verifyUserInput has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Near-duplicate member pair (91 shared lines) Planet/Entities/MyPlanetModel.swift:3560— Planet/Entities/MyPlanetModel.swift:3560-3697 | Planet/Entities/MyPlanetModel.swift:3718-3818 — These two members are variants of one another: 91 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (30 shared lines) Planet/Entities/MyPlanetModel.swift:2005— Planet/Entities/MyPlanetModel.swift:2005-2050 | Planet/Views/Following/FollowingPlanetAvatarView.swift:7-43 — These two members are variants of one another: 30 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) Planet/Views/Articles/ArticleAIChatView.swift:5359— Planet/Views/Articles/ArticleAIChatView.swift:5359-5395 | Planet/Views/Articles/ArticleAIOnDeviceTools.swift:563-605 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (14 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (14 members, 50+ identical tokens) Planet/API/Window/PlanetAPIConsoleViewController.swift:26— Planet/API/Window/PlanetAPIConsoleViewController.swift:26-36 | Planet/Downloads/PlanetDownloadsViewController.swift:22-31 | Planet/IPFS/Open Views/Window/IPFSOpenViewController.swift:26-36 | Planet/IPFS/Status Views/Window/IPFSStatusViewController.swift:26-36 | Planet/Key Manager/PlanetKeyManagerViewController.swift:23-32 | Planet/Labs/Published Folders/Dashboard/PFDashboardInspectorViewController.swift:22-31 | Planet/Labs/Published Folders/Dashboard/PFDashboardSidebarViewController.swift:22-31 | Planet/Labs/Published Folders/Dashboard/PFDashboardViewController.swift:22-31 | Planet/TemplateBrowser/Window Controller/TBContentViewController.swift:22-31 | Planet/TemplateBrowser/Window Controller/TBInspectorViewController.swift:22-31 | Planet/TemplateBrowser/Window Controller/TBSidebarViewController.swift:22-31 | Planet/Views/Articles/ArticleAIChatWindowManager.swift:285-298 | Planet/Views/Articles/PlanetAIChatWindowController.swift:517-530 | Planet/Views/Articles/PlanetAIChatWindowController.swift:552-566 — These 14 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 14 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 14 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) Planet/Log/CloudflarePagesLogger.swift:19— Planet/Log/CloudflarePagesLogger.swift:19-37 | Planet/Log/IPFSLogger.swift:19-41 | Planet/Log/PlanetLogger.swift:19-41 | Planet/Log/PlanetLogger.swift:82-104 | Planet/Log/PlanetLogger.swift:133-155 | Planet/Log/SSHRsyncLogger.swift:19-37 | Planet/Views/Articles/ArticleAIChatView.swift:226-242 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) Planet/Key Manager/PlanetKeyManagerWindowController.swift:209— Planet/Key Manager/PlanetKeyManagerWindowController.swift:209-258 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:201-366 | Planet/TemplateBrowser/Window Controller/TBWindowController.swift:164-256 | Planet/Views/Articles/ArticleAIChatWindowManager.swift:203-244 | Planet/Views/Articles/PlanetAIChatWindowController.swift:337-407 — 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.
Duplicated block (63 lines × 2) Planet/Quick Share/PlanetQuickShareView.swift:52— Planet/Quick Share/PlanetQuickShareView.swift:52-114 | Planet/Views/My/MyArticleItemView.swift:330-392 — 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
Duplicated block (57–60 lines × 2) Planet/Search/SearchEmbedding.swift:308— Planet/Search/SearchEmbedding.swift:308-367 | Planet/Search/SearchEmbedding.swift:455-511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Search/SearchEmbedding.swift:308` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `limit` to `Int = 50` in one and `Int = 10` 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 (55 lines × 2) Planet/Labs/Wallet/WalletConnectV1QRCodeView.swift:19— Planet/Labs/Wallet/WalletConnectV1QRCodeView.swift:19-73 | Planet/Labs/Wallet/WalletConnectV2QRCodeView.swift:18-72 — before extracting anything, compare `Planet/Labs/Wallet/WalletConnectV1QRCodeView.swift` and `Planet/Labs/Wallet/WalletConnectV2QRCodeView.swift` as WHOLE FILES: 82% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (38–42 lines × 2) Planet/Search/RelatedArticlesView.swift:199— Planet/Search/RelatedArticlesView.swift:199-236 | Planet/Search/SearchView.swift:115-156 — before extracting anything, compare `Planet/Search/RelatedArticlesView.swift` and `Planet/Search/SearchView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 134 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 (41 lines × 2) Planet/Search/RelatedArticlesView.swift:157— Planet/Search/RelatedArticlesView.swift:157-197 | Planet/Search/SearchView.swift:302-342 — before extracting anything, compare `Planet/Search/RelatedArticlesView.swift` and `Planet/Search/SearchView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 134 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 (40 lines × 2) Planet/Entities/MyPlanetModel.swift:3656— Planet/Entities/MyPlanetModel.swift:3656-3695 | Planet/Entities/MyPlanetModel.swift:3774-3813 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyPlanetModel.swift:3656` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (38 lines × 2) Planet/Entities/FollowingPlanetModel.swift:1642— Planet/Entities/FollowingPlanetModel.swift:1642-1679 | Planet/Entities/MyPlanetModel.swift:1966-2003 — 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 (35–37 lines × 2) Planet/Entities/FollowingPlanetModel.swift:1215— Planet/Entities/FollowingPlanetModel.swift:1215-1249 | Planet/Entities/FollowingPlanetModel.swift:1311-1347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/FollowingPlanetModel.swift:1215` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (35 lines × 2) Planet/Views/Articles/ArticleAIChatWindowManager.swift:203— Planet/Views/Articles/ArticleAIChatWindowManager.swift:203-237 | Planet/Views/Articles/PlanetAIChatWindowController.swift:337-371 — before extracting anything, compare `Planet/Views/Articles/ArticleAIChatWindowManager.swift` and `Planet/Views/Articles/PlanetAIChatWindowController.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 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 `Planet/Views/Articles/ArticleAIChatWindowManager.swift:203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33 lines × 4) Planet/Quick Share/PlanetQuickShareViewModel.swift:260— Planet/Quick Share/PlanetQuickShareViewModel.swift:260-292 | Planet/Views/Articles/ArticleAIChatView.swift:5604-5636 | Planet/Views/Articles/ArticleListView.swift:227-259 | Planet/Writer/WriterDragAndDrop.swift:131-163 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Quick Share/PlanetQuickShareViewModel.swift:260` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28–33 lines × 2) Planet/Entities/MyPlanetModel.swift:3572— Planet/Entities/MyPlanetModel.swift:3572-3604 | Planet/Entities/MyPlanetModel.swift:3730-3757 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyPlanetModel.swift:3572` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (32 lines × 2) Planet/Helper/MarkdownListAutocomplete.swift:56— Planet/Helper/MarkdownListAutocomplete.swift:56-87 | Planet/Helper/MarkdownListAutocomplete.swift:134-165 — both copies are in the same file, so extract the 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 (27–30 lines × 2) Planet/API/PlanetAPIConsoleView.swift:17— Planet/API/PlanetAPIConsoleView.swift:17-43 | Planet/Log/AppLogView.swift:352-381 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (28–29 lines × 2) Planet/Search/PlanetStore+Search.swift:88— Planet/Search/PlanetStore+Search.swift:88-116 | Planet/Search/SearchIndex.swift:512-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 `Planet/Search/PlanetStore+Search.swift:88` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (29 lines × 2) Planet/Views/Articles/ArticleAIChatView.swift:5363— Planet/Views/Articles/ArticleAIChatView.swift:5363-5391 | Planet/Views/Articles/ArticleAIOnDeviceTools.swift:565-593 — 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 `Planet/Views/Articles/ArticleAIChatView.swift:5363` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26–28 lines × 4) Planet/IPFS/IPFSDaemon.swift:451— Planet/IPFS/IPFSDaemon.swift:451-478 | Planet/IPFS/IPFSDaemon.swift:555-580 | Planet/IPFS/IPFSDaemon.swift:589-614 | Planet/IPFS/IPFSDaemon.swift:623-648 — 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 `Planet/IPFS/IPFSDaemon.swift:451` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27 lines × 2) Planet/Entities/MyPlanetModel.swift:2118— Planet/Entities/MyPlanetModel.swift:2118-2144 | Planet/Entities/MyPlanetModel.swift:2298-2324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24–26 lines × 2) Planet/Views/My/MyPlanetDonationSettingsView.swift:113— Planet/Views/My/MyPlanetDonationSettingsView.swift:113-138 | PlanetLite/Croptop/AggregationSettings.swift:52-75 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/My/MyPlanetDonationSettingsView.swift:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 3) Planet/Entities/FollowingPlanetModel.swift:1039— Planet/Entities/FollowingPlanetModel.swift:1039-1063 | Planet/Entities/FollowingPlanetModel.swift:1176-1200 | Planet/Entities/FollowingPlanetModel.swift:1282-1306 — 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 `Planet/Entities/FollowingPlanetModel.swift:1039` it does not close everything it opens, so those 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, `Planet/Entities/FollowingPlanetModel.swift:1175` calls `fetchData` and `Planet/Entities/FollowingPlanetModel.swift:1038` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16–23 lines × 2) Planet/Labs/Wallet/WalletAccountView.swift:291— Planet/Labs/Wallet/WalletAccountView.swift:291-306 | Planet/Views/Sidebar/AccountBadgeView.swift:208-230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Labs/Wallet/WalletAccountView.swift:291` 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 (22 lines × 2) Planet/Helper/FeedUtils.swift:476— Planet/Helper/FeedUtils.swift:476-497 | Planet/Helper/FeedUtils.swift:517-538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Helper/FeedUtils.swift:476` 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 (21 lines × 2) Planet/IPFS/IPFSDaemon.swift:657— Planet/IPFS/IPFSDaemon.swift:657-677 | Planet/IPFS/IPFSDaemon.swift:686-706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/IPFS/IPFSDaemon.swift:657` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–21 lines × 2) Planet/Views/Articles/ArticleAIChatView.swift:3232— Planet/Views/Articles/ArticleAIChatView.swift:3232-3250 | Planet/Views/Articles/ArticleAIChatView.swift:3259-3279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Articles/ArticleAIChatView.swift:3232` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 6) Planet/IPFS/IPFSDaemon.swift:407— Planet/IPFS/IPFSDaemon.swift:407-426 | Planet/IPFS/IPFSDaemon.swift:457-476 | Planet/IPFS/IPFSDaemon.swift:494-513 | Planet/IPFS/IPFSDaemon.swift:559-578 | Planet/IPFS/IPFSDaemon.swift:593-612 | Planet/IPFS/IPFSDaemon.swift:627-646 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/IPFS/IPFSDaemon.swift:407` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) Planet/Views/Articles/ArticleWebViewModel.swift:135— Planet/Views/Articles/ArticleWebViewModel.swift:135-154 | Planet/Views/Articles/ArticleWebViewModel.swift:157-176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Articles/ArticleWebViewModel.swift:135` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) Planet/Views/Sidebar/PlanetSidebarView.swift:169— Planet/Views/Sidebar/PlanetSidebarView.swift:169-187 | PlanetLite/AppSidebarView.swift:64-82 — before extracting anything, compare `Planet/Views/Sidebar/PlanetSidebarView.swift` and `PlanetLite/AppSidebarView.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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 `Planet/Views/Sidebar/PlanetSidebarView.swift:169` it begins part-way through the construct above it, so those exact lines 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–17 lines × 5) Planet/Entities/MyArticleModel.swift:564— Planet/Entities/MyArticleModel.swift:564-572 | Planet/Entities/MyArticleModel.swift:577-585 | Planet/Entities/MyArticleModel.swift:592-606 | Planet/Entities/MyArticleModel.swift:610-626 | Planet/Entities/MyArticleModel.swift:629-639 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyArticleModel.swift:592` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–17 lines × 2) Planet/Quick Share/PlanetQuickShareView.swift:192— Planet/Quick Share/PlanetQuickShareView.swift:192-205 | Planet/Quick Share/PlanetQuickShareView.swift:211-227 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Quick Share/PlanetQuickShareView.swift:192` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 3) Planet/Views/My/MyPlanetCustomCodeView.swift:213— Planet/Views/My/MyPlanetCustomCodeView.swift:213-228 | Planet/Views/My/MyPlanetDonationSettingsView.swift:173-188 | Planet/Views/My/MyPlanetPodcastSettingsView.swift:156-171 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/My/MyPlanetCustomCodeView.swift:213` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–15 lines × 2) Planet/Labs/Quick Post/QuickPostView.swift:516— Planet/Labs/Quick Post/QuickPostView.swift:516-528 | Planet/Writer/WriterTitleView.swift:408-422 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14–15 lines × 2) Planet/Search/RelatedArticlesView.swift:114— Planet/Search/RelatedArticlesView.swift:114-127 | Planet/Search/SearchView.swift:286-300 — before extracting anything, compare `Planet/Search/RelatedArticlesView.swift` and `Planet/Search/SearchView.swift` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 134 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 (14 lines × 5) Planet/Entities/MyPlanetModel.swift:3582— Planet/Entities/MyPlanetModel.swift:3582-3595 | Planet/Entities/MyPlanetModel.swift:3623-3636 | Planet/Entities/MyPlanetModel.swift:3642-3655 | Planet/Entities/MyPlanetModel.swift:3740-3753 | Planet/Entities/MyPlanetModel.swift:3759-3772 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyPlanetModel.swift:3582` it begins part-way through the construct above it, so those 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, `Planet/Entities/MyPlanetModel.swift:3773` calls `saveOpsInBackground` and `Planet/Entities/MyPlanetModel.swift:3656` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–14 lines × 2) Planet/Views/Articles/ArticleAIChatView.swift:5674— Planet/Views/Articles/ArticleAIChatView.swift:5674-5687 | Planet/Views/Articles/ArticleAIOnDeviceTools.swift:547-559 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12–13 lines × 3) PlanetLite/AppContentDropDelegate.swift:47— PlanetLite/AppContentDropDelegate.swift:47-58 | PlanetLite/AppContentDropDelegate.swift:71-83 | PlanetLite/AppDelegate.swift:77-89 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `PlanetLite/AppContentDropDelegate.swift:47` it begins part-way through the construct above it, so those exact lines 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–13 lines × 2) Planet/Search/PlanetStore+Search.swift:120— Planet/Search/PlanetStore+Search.swift:120-132 | Planet/Search/SearchIndex.swift:543-552 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Search/PlanetStore+Search.swift:120` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 first that the copies are not typed on the same thing: the declarations holding them bind `maxLength` to `Int = searchPreviewLength` in one and `Int` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 6) Planet/Log/CloudflarePagesLogger.swift:26— Planet/Log/CloudflarePagesLogger.swift:26-37 | Planet/Log/IPFSLogger.swift:30-41 | Planet/Log/PlanetLogger.swift:30-41 | Planet/Log/PlanetLogger.swift:93-104 | Planet/Log/PlanetLogger.swift:144-155 | Planet/Log/SSHRsyncLogger.swift:26-37 — before extracting anything, compare `Planet/Log/CloudflarePagesLogger.swift` and `Planet/Log/IPFSLogger.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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 `Planet/Log/CloudflarePagesLogger.swift:26` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Planet/Log/PlanetLogger.swift:43` calls `log` and `Planet/Log/CloudflarePagesLogger.swift:39` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–12 lines × 2) Planet/Entities/FollowingPlanetModel.swift:831— Planet/Entities/FollowingPlanetModel.swift:831-839 | Planet/Entities/FollowingPlanetModel.swift:910-921 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/FollowingPlanetModel.swift:831` it does not close everything it opens, so those exact lines 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 × 7) Planet/Log/CloudflarePagesLogger.swift:23— Planet/Log/CloudflarePagesLogger.swift:23-33 | Planet/Log/IPFSLogger.swift:27-37 | Planet/Log/PlanetLogger.swift:27-37 | Planet/Log/PlanetLogger.swift:90-100 | Planet/Log/PlanetLogger.swift:141-151 | Planet/Log/SSHRsyncLogger.swift:23-33 | Planet/Views/Articles/ArticleAIChatView.swift:230-240 — before extracting anything, compare `Planet/Log/CloudflarePagesLogger.swift` and `Planet/Log/IPFSLogger.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `Planet/Log/CloudflarePagesLogger.swift:35` calls `trimIfNeeded` and `Planet/Views/Articles/ArticleAIChatView.swift:241` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 4) Planet/Views/My/MyPlanetEditView.swift:487— Planet/Views/My/MyPlanetEditView.swift:487-497 | Planet/Views/My/MyPlanetEditView.swift:503-513 | Planet/Views/My/MyPlanetEditView.swift:534-544 | Planet/Views/My/MyPlanetEditView.swift:550-560 — 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 `Planet/Views/My/MyPlanetEditView.swift:487` it does not close everything it opens, so those exact lines 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–11 lines × 2) Planet/API/WebAppUpdater.swift:72— Planet/API/WebAppUpdater.swift:72-82 | Planet/Labs/Icon Gallery/IconManager.swift:231-236 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (3–11 lines × 3) Planet/Integrations/CloudflarePages.swift:221— Planet/Integrations/CloudflarePages.swift:221-223 | Planet/Integrations/CloudflarePages.swift:244-254 | Planet/Integrations/CloudflarePages.swift:279-289 — 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 `Planet/Integrations/CloudflarePages.swift:221` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–10 lines × 2) Planet/Search/SearchIndex.swift:347— Planet/Search/SearchIndex.swift:347-354 | Planet/Search/SearchIndex.swift:422-431 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Search/SearchIndex.swift:347` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–10 lines × 2) Planet/Views/Components/ArtworkView.swift:43— Planet/Views/Components/ArtworkView.swift:43-51 | Planet/Views/Components/ArtworkView.swift:63-72 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Components/ArtworkView.swift:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 5) Planet/Entities/MyPlanetModel.swift:2374— Planet/Entities/MyPlanetModel.swift:2374-2382 | Planet/Entities/MyPlanetModel.swift:2414-2422 | Planet/Entities/MyPlanetModel.swift:2480-2488 | Planet/Entities/MyPlanetModel.swift:2505-2513 | Planet/Entities/MyPlanetModel.swift:2572-2580 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Entities/MyPlanetModel.swift:2374` it does not close everything it opens, so those 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, `Planet/Entities/MyPlanetModel.swift:2478` calls `withThrowingTaskGroup` and `Planet/Entities/MyPlanetModel.swift:2571` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 3) Planet/Key Manager/PlanetKeyManagerWindowController.swift:250— Planet/Key Manager/PlanetKeyManagerWindowController.swift:250-258 | Planet/Views/Articles/ArticleAIChatWindowManager.swift:236-244 | Planet/Views/Articles/PlanetAIChatWindowController.swift:399-407 — before extracting anything, compare `Planet/Views/Articles/ArticleAIChatWindowManager.swift` and `Planet/Views/Articles/PlanetAIChatWindowController.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 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 `Planet/Key Manager/PlanetKeyManagerWindowController.swift:250` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Planet/Key Manager/PlanetKeyManagerWindowController.swift:248` calls `L10n` and `Planet/Views/Articles/ArticleAIChatWindowManager.swift:234` 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 (6–9 lines × 4) Planet/Views/Onboarding/OnboardingView.swift:35— Planet/Views/Onboarding/OnboardingView.swift:35-44 | Planet/Views/Onboarding/OnboardingView.swift:46-54 | Planet/Views/Onboarding/OnboardingView.swift:56-65 | Planet/Views/Onboarding/OnboardingView.swift:66-71 — 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 `Planet/Views/Onboarding/OnboardingView.swift:35` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Planet/Views/Onboarding/OnboardingView.swift:35` calls `foregroundColor` and `Planet/Views/Onboarding/OnboardingView.swift:66` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 2) PlanetCLI/PNCommandRunner.swift:929— PlanetCLI/PNCommandRunner.swift:929-936 | PlanetCLI/PNCommandRunner.swift:941-949 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 3) Planet/Labs/Published Folders/Dashboard/PFDashboardContainerViewController.swift:37— Planet/Labs/Published Folders/Dashboard/PFDashboardContainerViewController.swift:37-44 | Planet/TemplateBrowser/Window Controller/TBContainerViewController.swift:38-44 | Planet/Views/Articles/PlanetAIChatWindowController.swift:480-486 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Labs/Published Folders/Dashboard/PFDashboardContainerViewController.swift:37` it does not close everything it opens, so those 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, `Planet/Labs/Published Folders/Dashboard/PFDashboardContainerViewController.swift:45` calls `constraint` and `Planet/Views/Articles/PlanetAIChatWindowController.swift:487` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7–8 lines × 2) Planet/Writer/WriterWindow.swift:170— Planet/Writer/WriterWindow.swift:170-176 | Planet/Writer/WriterWindow.swift:179-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Writer/WriterWindow.swift:179` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 12) Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:204— Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:204-210 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:221-227 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:237-243 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:247-253 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:257-263 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:267-273 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:343-349 | Planet/TemplateBrowser/Window Controller/TBWindowController.swift:167-173 | Planet/TemplateBrowser/Window Controller/TBWindowController.swift:184-190 | Planet/TemplateBrowser/Window Controller/TBWindowController.swift:206-212 | Planet/TemplateBrowser/Window Controller/TBWindowController.swift:219-225 | Planet/TemplateBrowser/Window Controller/TBWindowController.swift:229-235 — there are 12 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 12 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `Planet/TemplateBrowser/Window Controller/TBWindowController.swift:205` calls `hasVSCode` and `Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:220` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 8) Planet/Views/Articles/ArticleAIChatWindowManager.swift:212— Planet/Views/Articles/ArticleAIChatWindowManager.swift:212-218 | Planet/Views/Articles/ArticleAIChatWindowManager.swift:222-228 | Planet/Views/Articles/ArticleAIChatWindowManager.swift:232-238 | Planet/Views/Articles/PlanetAIChatWindowController.swift:346-352 | Planet/Views/Articles/PlanetAIChatWindowController.swift:356-362 | Planet/Views/Articles/PlanetAIChatWindowController.swift:366-372 | Planet/Views/Articles/PlanetAIChatWindowController.swift:376-382 | Planet/Views/Articles/PlanetAIChatWindowController.swift:395-401 — before extracting anything, compare `Planet/Views/Articles/ArticleAIChatWindowManager.swift` and `Planet/Views/Articles/PlanetAIChatWindowController.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 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 (7 lines × 6) Planet/TemplateBrowser/TemplateBrowserSidebar.swift:82— Planet/TemplateBrowser/TemplateBrowserSidebar.swift:82-88 | Planet/TemplateBrowser/TemplateBrowserSidebar.swift:97-103 | Planet/TemplateBrowser/TemplateBrowserSidebar.swift:110-116 | Planet/TemplateBrowser/TemplateBrowserSidebar.swift:124-131 | PlanetLite/AppSidebarItemView.swift:51-65 | PlanetLite/AppSidebarItemView.swift:72-85 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 20) Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:207— Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:207-212 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:224-229 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:240-245 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:250-255 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:260-265 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:270-275 | Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:346-351 | Planet/TemplateBrowser/Window Controller/TBWindowController.swift:170-175 | Planet/TemplateBrowser/Window Controller/TBWindowController.swift:187-192 | Planet/TemplateBrowser/Window Controller/TBWindowController.swift:209-214 | Planet/TemplateBrowser/Window Controller/TBWindowController.swift:222-227 | Planet/TemplateBrowser/Window Controller/TBWindowController.swift:232-237 | Planet/Views/Articles/ArticleAIChatWindowManager.swift:215-220 | Planet/Views/Articles/ArticleAIChatWindowManager.swift:225-230 | Planet/Views/Articles/ArticleAIChatWindowManager.swift:235-240 | Planet/Views/Articles/PlanetAIChatWindowController.swift:349-354 | Planet/Views/Articles/PlanetAIChatWindowController.swift:359-364 | Planet/Views/Articles/PlanetAIChatWindowController.swift:369-374 | Planet/Views/Articles/PlanetAIChatWindowController.swift:379-384 | Planet/Views/Articles/PlanetAIChatWindowController.swift:398-403 — before extracting anything, compare `Planet/Views/Articles/ArticleAIChatWindowManager.swift` and `Planet/Views/Articles/PlanetAIChatWindowController.swift` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 75 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (5 lines × 14) Planet/API/Window/PlanetAPIConsoleViewController.swift:30— Planet/API/Window/PlanetAPIConsoleViewController.swift:30-34 | Planet/Downloads/PlanetDownloadsViewController.swift:25-29 | Planet/IPFS/Open Views/Window/IPFSOpenViewController.swift:30-34 | Planet/IPFS/Status Views/Window/IPFSStatusViewController.swift:30-34 | Planet/Key Manager/PlanetKeyManagerViewController.swift:26-30 | Planet/Labs/Published Folders/Dashboard/PFDashboardInspectorViewController.swift:25-29 | Planet/Labs/Published Folders/Dashboard/PFDashboardSidebarViewController.swift:25-29 | Planet/Labs/Published Folders/Dashboard/PFDashboardViewController.swift:25-29 | Planet/TemplateBrowser/Window Controller/TBContentViewController.swift:25-29 | Planet/TemplateBrowser/Window Controller/TBInspectorViewController.swift:25-29 | Planet/TemplateBrowser/Window Controller/TBSidebarViewController.swift:25-29 | Planet/Views/Articles/ArticleAIChatWindowManager.swift:291-296 | Planet/Views/Articles/PlanetAIChatWindowController.swift:523-528 | Planet/Views/Articles/PlanetAIChatWindowController.swift:559-564 — before extracting anything, compare `Planet/API/Window/PlanetAPIConsoleViewController.swift` and `Planet/IPFS/Open Views/Window/IPFSOpenViewController.swift` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `Planet/Views/Articles/ArticleAIChatWindowManager.swift:291` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 9) Planet/API/Window/PlanetAPIConsoleViewController.swift:20— Planet/API/Window/PlanetAPIConsoleViewController.swift:20-24 | Planet/IPFS/Open Views/Window/IPFSOpenViewController.swift:20-24 | Planet/IPFS/Status Views/Window/IPFSStatusViewController.swift:20-24 | Planet/Labs/Published Folders/Dashboard/PFDashboardInspectorViewController.swift:33-37 | Planet/Labs/Published Folders/Dashboard/PFDashboardSidebarViewController.swift:33-37 | Planet/Labs/Published Folders/Dashboard/PFDashboardViewController.swift:33-37 | Planet/TemplateBrowser/Window Controller/TBContentViewController.swift:33-37 | Planet/TemplateBrowser/Window Controller/TBInspectorViewController.swift:33-37 | Planet/TemplateBrowser/Window Controller/TBSidebarViewController.swift:33-37 — before extracting anything, compare `Planet/API/Window/PlanetAPIConsoleViewController.swift` and `Planet/IPFS/Open Views/Window/IPFSOpenViewController.swift` as WHOLE FILES: 84% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 5) Planet/TemplateBrowser/TemplateBrowserSidebar.swift:133— Planet/TemplateBrowser/TemplateBrowserSidebar.swift:133-139 | Planet/TemplateBrowser/Window Controller/TBWindowController.swift:74-80 | Planet/Views/Articles/ArticleView.swift:639-645 | Planet/Views/Sidebar/MyPlanetSidebarItem.swift:363-369 | PlanetLite/AppSidebarItemView.swift:37-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 64 significant file(s) lose their only recent owner: Planet/Views/Articles/ArticleAIChatView.swift, Planet/Entities/MyPlanetModel.swift, Planet/Entities/FollowingPlanetModel.swift, Planet/Entities/MyPlanetModel+Aggregate.swift, PlanetCLI/PNCommandRunner.swift, Planet/Entities/PlanetStore.swift, Planet/Views/Articles/ArticleView.swift, PlanetCLI/PNDiskStore.swift (+56 more). Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (66 single-owned of 172 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 172 of the 268 production source files in this repository met that bar). They are anonymized user #2 (2 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
No ADRs found — 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/`.
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 28 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: Planet/Views/Articles/ArticleWebViewModel.swift, Planet/TemplateBrowser/Window Controller/TBWindowController.swift, Planet/IPFS/Status Views/IPFSTrafficChartView.swift, Planet/Helper/HttpRequest.swift, Planet/Labs/Published Folders/Dashboard/PFDashboardInspectorView.swift, Planet/Labs/Published Folders/Dashboard/PFDashboardContentView.swift, Planet/Writer/AttachmentThumbnailView.swift, PlanetLite/CroptopApp.swift (and 20 more) (29 orphaned of 172 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 172 of the 268 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No src/ separation — Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
README/code drift — README claims a sandboxed macOS app built with SwiftUI 3 but the evidence shows no such project — searched for: `SwiftUI 3`. Each was matched case- and separator-insensitively against file and directory NAMES anywhere in the tree, and against the CONTENTS of manifest files (package.json, *.csproj, *.props, *.slnx, *.yml, Dockerfile); the README's own prose never counts, so a claim is never refuted by merely being made. Nothing outside that search was read — a footprint living only in a submodule, in a file type not listed here, or under a name none of those terms matches is not seen, and this row is then wrong.
P1 · CI/CD gates· CI test execution not evidenced · ×1
CI test execution not evidenced — A CI pipeline exists but no test-runner invocation (your stack's test command, or a test job) was found — changes may merge without the suite running.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 26837 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
Outdated: async-http-client — `async-http-client` is resolved at 1.26.1, but 1.36.2 is the newest release tagged on https://github.com/swift-server/async-http-client.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update async-http-client` reaches this one with no change to Package.swift.
Outdated: async-kit — `async-kit` is resolved at 1.20.0, but 1.22.0 is the newest release tagged on https://github.com/vapor/async-kit.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update async-kit` reaches this one with no change to Package.swift.
Outdated: bigint — `bigint` is resolved at 5.5.2, but 5.7.0 is the newest release tagged on https://github.com/attaswift/BigInt.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update bigint` reaches this one with no change to Package.swift.
Outdated: console-kit — `console-kit` is resolved at 4.15.2, but 4.16.1 is the newest release tagged on https://github.com/vapor/console-kit.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update console-kit` reaches this one with no change to Package.swift.
Outdated: cryptoswift — `cryptoswift` is resolved at 1.5.1, but 1.10.0 is the newest release tagged on https://github.com/krzyzanowskim/CryptoSwift.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update cryptoswift` reaches this one with no change to Package.swift.
Outdated: grdb.swift — `grdb.swift` is resolved at 7.10.0, but 7.11.1 is the newest release tagged on https://github.com/groue/GRDB.swift within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update grdb.swift` reaches this one with no change to Package.swift.
Outdated: routing-kit — `routing-kit` is resolved at 4.9.2, but 4.9.3 is the newest release tagged on https://github.com/vapor/routing-kit.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update routing-kit` reaches this one with no change to Package.swift.
Outdated: sparkle — `sparkle` is resolved at 2.9.2, but 2.10.0 is the newest release tagged on https://github.com/sparkle-project/Sparkle within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update sparkle` reaches this one with no change to Package.swift.
Outdated: swift-asn1 — `swift-asn1` is resolved at 1.3.2, but 1.7.3 is the newest release tagged on https://github.com/apple/swift-asn1.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-asn1` reaches this one with no change to Package.swift.
Outdated: swift-async-algorithms — `swift-async-algorithms` is resolved at 1.0.4, but 1.1.7 is the newest release tagged on https://github.com/apple/swift-async-algorithms.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-async-algorithms` reaches this one with no change to Package.swift.
Outdated: swift-atomics — `swift-atomics` is resolved at 1.2.0, but 1.3.1 is the newest release tagged on https://github.com/apple/swift-atomics.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-atomics` reaches this one with no change to Package.swift.
Outdated: swift-certificates — `swift-certificates` is resolved at 1.10.0, but 1.21.0 is the newest release tagged on https://github.com/apple/swift-certificates.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-certificates` reaches this one with no change to Package.swift.
Outdated: swift-collections — `swift-collections` is resolved at 1.2.0, but 1.7.1 is the newest release tagged on https://github.com/apple/swift-collections.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-collections` reaches this one with no change to Package.swift.
Outdated: swift-crypto — `swift-crypto` is resolved at 3.12.3, but 3.15.1 is the newest release tagged on https://github.com/apple/swift-crypto.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-crypto` reaches this one with no change to Package.swift.
Outdated: swift-distributed-tracing — `swift-distributed-tracing` is resolved at 1.2.0, but 1.5.0 is the newest release tagged on https://github.com/apple/swift-distributed-tracing.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-distributed-tracing` reaches this one with no change to Package.swift.
Outdated: swift-http-structured-headers — `swift-http-structured-headers` is resolved at 1.3.0, but 1.7.0 is the newest release tagged on https://github.com/apple/swift-http-structured-headers.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-http-structured-headers` reaches this one with no change to Package.swift.
Outdated: swift-http-types — `swift-http-types` is resolved at 1.4.0, but 1.8.0 is the newest release tagged on https://github.com/apple/swift-http-types.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-http-types` reaches this one with no change to Package.swift.
Outdated: swift-log — `swift-log` is resolved at 1.6.3, but 1.15.1 is the newest release tagged on https://github.com/apple/swift-log.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-log` reaches this one with no change to Package.swift.
Outdated: swift-metrics — `swift-metrics` is resolved at 2.7.0, but 2.11.0 is the newest release tagged on https://github.com/apple/swift-metrics.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-metrics` reaches this one with no change to Package.swift.
Outdated: swift-nio — `swift-nio` is resolved at 2.83.0, but 2.103.0 is the newest release tagged on https://github.com/apple/swift-nio.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-nio` reaches this one with no change to Package.swift.
Outdated: swift-nio-extras — `swift-nio-extras` is resolved at 1.27.1, but 1.35.1 is the newest release tagged on https://github.com/apple/swift-nio-extras.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-nio-extras` reaches this one with no change to Package.swift.
Outdated: swift-nio-http2 — `swift-nio-http2` is resolved at 1.36.0, but 1.46.0 is the newest release tagged on https://github.com/apple/swift-nio-http2.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-nio-http2` reaches this one with no change to Package.swift.
Outdated: swift-nio-ssl — `swift-nio-ssl` is resolved at 2.31.0, but 2.37.5 is the newest release tagged on https://github.com/apple/swift-nio-ssl.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-nio-ssl` reaches this one with no change to Package.swift.
Outdated: swift-nio-transport-services — `swift-nio-transport-services` is resolved at 1.24.0, but 1.28.0 is the newest release tagged on https://github.com/apple/swift-nio-transport-services.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-nio-transport-services` reaches this one with no change to Package.swift.
Outdated: swift-numerics — `swift-numerics` is resolved at 1.0.3, but 1.1.1 is the newest release tagged on https://github.com/apple/swift-numerics.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update swift-numerics` reaches this one with no change to Package.swift.
+ 8 more in this group — see findings.md.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 25 file(s) — `Planet/API/PlanetAPILogMiddleware.swift`, `Planet/Entities/FollowingPlanetModel.swift`, `Planet/Entities/MyPlanetModel.swift`, `Planet/Entities/PlanetStore+Timer.swift`, `Planet/Entities/PlanetStore.swift`, … (+20 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a0f6f7-7973-718c-9b65-0dfed1ef0629 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 71 · Warnings: 599 · Recommendations: 14 · Info: 33 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 01-10-2026 @ 10:16 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.