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

Planetable/Planet

Measured 29 October 2026, 10:28 UTC, at code version 5294e71

Regression: 1 dimension fell since the last survey Code coverage: not measuredTest reliability: not measured

A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.

Code coverage is not measured: Xcode and a simulator are needed to run it.

Test reliability is not measured: The suite is built by Xcode and needs an Apple platform to run.

CAI score 48out of 100 Adequate
CriticalWeakAdequateStrongExemplary
No change since the last survey

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

A medium codebase: 64,782 lines of product code in 4 projects, tests not counted · Estimated rebuild effort: about 0.4 person-years · Weakest lens: Production Readiness, 35

Findings by how serious they are

75 critical 632 serious 101 minor

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

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
29 October 2026, 10:28 UTC

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

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

63of 63 dimensions measured by tools.
754of 808 findings point to an exact file and line, so you can open each one in the code. The other 54 concern the repository as a whole, such as missing documentation.
63dimensions across 7 lenses, read from 64,782 lines of product code in 4 projects.
Chapters

Executive summary

Planetable/Planet falls short of our standard for a preview release, in part because we found no automated security scanning of the code, its secrets or its dependencies. It scores 48 out of 100 and is rated Adequate, and 67 of its 75 critical findings are security problems.

Production Readiness, at 35, is the weakest lens and counts most in the score. The best first steps are pinning the dependencies taken from a moving source and fixing the password or key in the code, each worth about 9 points. Raising Production Readiness to 62 would lift the score to about 58.

Forty-six secrets can leak from the build pipeline. Fourteen pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with, and five weaknesses in the code could be used by an attacker. Limiting each secret to its own step, pinning each tool to an exact version and fixing the weaknesses the scanner points to would close these risks. Updating the vulnerable packages would fix the package with a known security hole. The three pages that don't say their language need their language set.

The product code is 64,782 lines, about €60,000 to rebuild.

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

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

If Production Readiness rose from 35 to 62, the lowest score rated Strong, the score would rise from 48 to about 58.

Code composition: what the lines of code are
Product code 99%Tests 1%
New since the last survey: 8 findings

These 8 critical or serious findings weren't in the previous survey, on 15 October 2026.

Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 1 finding

This critical or serious finding was in the previous survey, on 15 October 2026, and is gone from this one.

  • Supply-chain Provenance & Signing REDACTED
Rebuild cost: about €60,000 · Estimate
Cost to rebuild€20,000 to €100,000, for 332 to 1,052 hours of work, about 0.4 person-years for one engineer
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 48. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 64,782 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 5 Floating branch dependency finding(s) in Dependency Hygiene.
Raises the score by about 9 points · Low effort · Dependency Hygiene
2
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.
Raises the score by about 9 points · Low effort · Secret Scanning
3
Resolve the 1 Skipped test finding(s) in Test Quality — start with PNDiskStoreTests.swift.
Raises the score by about 4 points · Low effort · Test Quality

Diagnosis: what the measurements show together

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

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

At a glance — Code Health · 79% · Adequate · gated by D2 ·

At a glance — Architecture · 76% · Adequate · gated by D26 ·

At a glance — Maturity · 58% · Adequate · gated by M2 ·

At a glance — Readiness · 35% · Weak · gated by P3, P7 ·

At a glance — Security · 69% · Adequate · gated by D29, D36 ·

At a glance — Accessibility · 51% · Adequate ·

At a glance — Performance · 85% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection67High / Critical
A03:2025 — Software Supply Chain Failures12High / Critical
A07:2025 — Authentication Failures1High / Critical

Roadmap

Begin by resolving the five floating dependency findings and the single leaked secret in REDACTED to immediately reduce risk. Next, integrate a SAST step into the CI pipeline to ensure security regressions fail the build before landing. Finally, address the skipped test in PNDiskStoreTests.swift and enforce timeouts and retry logic on all outbound HTTP calls to improve system resilience.

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

Do thisHelpsEffortDimension
Resolve the 5 Floating branch dependency finding(s) in Dependency Hygiene.+9.5 ptsLowDependency Hygiene
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.+9.3 ptsLowSecret Scanning
Resolve the 1 Skipped test finding(s) in Test Quality — start with PNDiskStoreTests.swift.+4.2 ptsLowTest Quality
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.+6.3 ptsMediumSecurity & performance tooling
Resolve the 1 No ADRs found finding(s) in ADR Quality.+2.5 ptsLowADR Quality
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.+2.7 ptsMediumOutbound HTTP resilience
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.+2.6 ptsMediumVisual & motion safety
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.+2.6 ptsMediumA11y enforcement

File quality

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

FileScoreBandWorst signal
REDACTED0.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.5SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.1MixedDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.3MixedStatic Analysis (SAST): High: REDACTED
Planet/IPFS/IPFSDaemon.swift4.8MixedCyclomatic Complexity: IPFSDaemon.setupIPFS (cyclomatic 26)
REDACTED5.0MixedSecret Scanning: Leaked secret: REDACTED
Planet/Views/Articles/ArticleAIChatView.swift5.5MixedCyclomatic Complexity: ArticleAIChatView.parseCompletionStepFromStreamingBytes::flushPendingEvent (cyclomatic 88)
Planet/Entities/PlanetStore.swift5.5MixedCyclomatic Complexity: PlanetStore.refreshSelectedArticles (cyclomatic 25)
Planet/Entities/MyArticleModel+Save.swift5.6MixedCyclomatic Complexity: MyArticleModel.getHeroImage (cyclomatic 24)
Planet/Entities/DraftModel.swift5.6MixedCyclomatic Complexity: DraftModel.saveToArticle (cyclomatic 21)
Planet/Views/Following/FollowingArticleItemView.swift5.6MixedCyclomatic Complexity: FollowingArticleItemView.body (cyclomatic 20)
Planet/Views/Articles/ArticleAIOnDeviceTools.swift5.6MixedCyclomatic Complexity: ArticleAIRepoGrep.search (cyclomatic 19)
Planet/Helper/KeyboardShortcutHelper.swift5.6MixedCognitive Complexity: KeyboardShortcutHelper.publishedFoldersMenus (cognitive 21)
Planet/Views/Articles/ArticleAIChatWindowManager.swift5.7MixedCode Duplication: Duplicated block (35 lines × 2)
Planet/PlanetAppDelegate.swift5.9MixedCognitive Complexity: PlanetAppDelegate.application (cognitive 20)
PlanetCLI/PNDiskStore.swift5.9MixedGod Classes: TooManyMethods: PNDiskStore
Planet/Writer/WriterTextView.swift5.9MixedCode Duplication: Duplicated block (6 lines × 2)

How the grades work

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

Critical — 75

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

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

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

Could not be resolved — 19

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. 63 of 63 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. 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 — 63 dimensions across the health lenses
D1D2D3D4D5D6D9D10D12D13D14D15D16D17D20D26D28D29D30D34D35D36D43D44AC2AC3AC6AC7AX10AX2AX3AX4AX8AX9M1M2M3P1P2P3P4P5P6P7PF3X1X12X13X14X15X17X19X21X22X23X24X25X26X27X28X3X30X4

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

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

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurement—◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a18734-0d81-7572-92f6-1018c11e98e7.

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

Run transparency — what happened this run

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

  • 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.
  • D21 Naming 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. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • 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 an ADMISSION 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 a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict.
  • D24 Comment Value — 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's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — 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. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • D32 Data Compliance (PII/GDPR) — not measured this run — 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`, … (+24 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.
  • 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.
  • AXR1 Runtime accessibility — 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. Render strategy: boot via ToolchainServer (tools/generate-sparkle-notes). the service exited before it opened a port — `/tmp/wd-venv/bin/python -m flask --app 'app:app' run --host 127.0.0.1 --port 5000`: 952b4fe6c57/tools/generate-sparkle-notes/app.py", line 95, in gh result = subprocess.run( ^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 548, in run with Popen(*…; runtime evidence skipped (launch chosen because tools/generate-sparkle-notes/app.py defines the Flask application 'app' at module level).
  • 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. 'GRDB' is imported (Planet/Search/SearchDatabase.swift:7), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • C5 Data-Subject Rights — not measured this run — 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. 'GRDB' is imported (Planet/Search/SearchDatabase.swift:7), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
  • 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 reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby 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.
  • 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 reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby 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.
  • 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.
  • 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 reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin 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.
  • 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 reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP 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.
  • 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 reads C# syntax, and JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python and Rust source only, and no C# was loaded, and no named async function in this repository's JavaScript/TypeScript, nor any Go, PHP or Dart function or Kotlin suspend function, makes a request that can be cancelled (fetch, axios, ky, ofetch; net/http, net.Dial; amphp; Dio; Ktor, OkHttp), so there is nothing to judge, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • 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, Rust, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, Rust, Dart, Ruby, Scala or Kotlin 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.
  • 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 reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript 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.

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.
  • 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.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • 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.
  • 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.

Dimensions

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

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

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

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

74 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ArticleAIChatView.parseCompletionStepFromStreamingBytes::flushPendingEvent at 88. 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.

ArticleAIChatView.parseCompletionStepFromStreamingBytes::flushPendingEvent (cyclomatic 88)Planet/Views/Articles/ArticleAIChatView.swift:3780
MyPlanetModel.== (cyclomatic 77)Planet/Entities/MyPlanetModel.swift:906
MyPlanetModel.importBackup (cyclomatic 66)Planet/Entities/MyPlanetModel.swift:1470
ArticleWebViewModel.checkArticleLink (cyclomatic 46)Planet/Views/Articles/ArticleWebViewModel.swift:54
ArticleAIChatView.summarizeToolArguments (cyclomatic 45)Planet/Views/Articles/ArticleAIChatView.swift:3225

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

What to do

  1. Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with ArticleAIChatView.parseCompletionStepFromStreamingBytes::flushPendingEvent (cyclomatic 88), MyPlanetModel.== (cyclomatic 77), MyPlanetModel.importBackup (cyclomatic 66). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 3 together lifts Cyclomatic Complexity from 6.1 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. 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.

D2 · Cognitive Complexity3.0 / 10Weak✓ Tool-verified

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

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

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

135 method(s) exceeded the cognitive complexity threshold of 15; the worst was ArticleAIChatView.parseCompletionStepFromStreamingBytes::flushPendingEvent at 185.

ArticleAIChatView.parseCompletionStepFromStreamingBytes::flushPendingEvent (cognitive 185)Planet/Views/Articles/ArticleAIChatView.swift:3780
MyPlanetModel.savePublic (cognitive 140)Planet/Entities/MyPlanetModel.swift:2185
FollowingPlanetModel.update (cognitive 103)Planet/Entities/FollowingPlanetModel.swift:1018
ArticleWebViewModel.checkArticleLink (cognitive 97)Planet/Views/Articles/ArticleWebViewModel.swift:54
MyPlanetModel.importBackup (cognitive 78)Planet/Entities/MyPlanetModel.swift:1470

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

What to do

  1. Bring the 2 bodies over 120 down to 120 or less in Cognitive Complexity — start with ArticleAIChatView.parseCompletionStepFromStreamingBytes::flushPendingEvent (cognitive 185), MyPlanetModel.savePublic (cognitive 140). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cognitive Complexity from 3.0 to about 3.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
  2. 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.

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.

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

81 god class(es) detected.

MethodTooLong: ArticleAIChatView.parseCompletionStepFromStreamingBytes · ×40Planet/Views/Articles/ArticleAIChatView.swift:3554
FileTooLong: Articles/ArticleAIChatView.swift · ×17Planet/Views/Articles/ArticleAIChatView.swift
ClassTooLong: ArticleAIChatView · ×15Planet/Views/Articles/ArticleAIChatView.swift:262
TooManyMethods: ArticleAIChatView · ×9Planet/Views/Articles/ArticleAIChatView.swift:262

What to do

  1. Resolve the 40 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 (40 warning-level).
  2. 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).
  3. 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).
  4. 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.

D4 · Code Duplication8.4 / 10Strong✓ Tool-verified

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.

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

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.

Duplicated block (9 lines × 2) · ×14Planet/Entities/FollowingArticleModel.swift:195
Duplicated block (6 lines × 2) · ×13Planet/IPFS/IPFSDaemon.swift:1087
Duplicated block (5 lines × 2) · ×13Planet/API/PlanetAPILogMiddleware.swift:41
Duplicated block (10 lines × 2) · ×12Planet/Downloads/PlanetDownloadsWebView.swift:77
Duplicated block (7 lines × 2) · ×12Planet/Entities/MyPlanetModel.swift:400

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

What to do

  1. 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).
  2. 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).
  3. 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).
  4. 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.

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.

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

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, declare types in source no model reads, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)7.2 / 10Strong✓ Tool-verified

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

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

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

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

22 of 96 classes have LCOM4 above 3.

Low cohesion: String (LCOM4 15) · ×22PlanetCLI/PNError.swift:32

What to do

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

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.

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

11 test methods: 11 unit, 0 integration, 0 BDD, 0 e2e.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

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.

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

1 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 11 tests.

Skipped test: testDiskAttachmentsMatchAppPipelinePlanetCLITests/PNDiskStoreTests.swift:194

What to do

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

D12 · Dependency Hygiene7.1 6.4 / 10Adequate✓ Tool-verified

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.

Maturity: Documented → Verified → Prevented · effective 6.4 / 10 · rule-coverage 91% · ceiling Verified

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.

Floating branch dependency: codemirror-swiftui · ×5
Outdated: async-http-client · ×33

What to do

  1. Resolve the 5 Floating branch dependency finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (5 warning-level).
  2. 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.

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

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

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

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

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce Secret Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

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

0 of 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.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots10.0 / 10Exemplary✓ Tool-verified

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

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

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

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

D16 · Bus Factor6.3 / 10Adequate✓ Tool-verified

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.

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

61 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

  1. Resolve the 1 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
  2. 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.

D17 · Explicit Debt9.9 / 10Stronggated by 39 serious findings✓ Tool-verified

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

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

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

39 deducted task-comment markers across 64782 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.

TodoComment · ×38PlanetLite/AppContentDropDelegate.swift:10
FixmeCommentPlanet/Entities/FollowingArticleModel.swift:243

What to do

  1. Resolve the 38 TodoComment finding(s) in Explicit Debt — start with ArticleWebViewModel.swift (4), WalletManager.swift (3), FeedUtils.swift (3). — One of this dimension's main actionable groups (38 warning-level).
  2. Resolve the 1 FixmeComment finding(s) in Explicit Debt — start with FollowingArticleModel.swift. — One of this dimension's main actionable groups (1 warning-level).
  3. 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.

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.

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

No architecture decision records were found.

No ADRs found

What to do

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

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

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

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

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

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

1 of 2 build units (Python, Xcode) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

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

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

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

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

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

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 10 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`, … (+5 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

  1. 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).
  2. 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).
  3. 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.

D30 · Dependency Vulnerabilities9.0 / 10Adequategated by 1 critical finding✓ Tool-verified

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

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

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

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

REDACTED
REDACTED

What to do

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

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

D34 · Knowledge Freshness7.9 / 10Adequategated by 3 critical findings✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

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

39 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/PlanetPublishedServiceStore.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.

Orphaned knowledge · ×3Planet/Labs/Published Folders/PlanetPublishedServiceStore.swift:1
Orphaned file · ×36Planet/Views/Articles/ArticleWebViewModel.swift:1
Further orphaned files (smaller)

What to do

  1. Resolve the 3 Orphaned knowledge finding(s) in Knowledge Freshness — start with PlanetPublishedServiceStore.swift, IconManager.swift, PFDashboardWindowController.swift. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 36 Orphaned file finding(s) in Knowledge Freshness — start with ArticleWebViewModel.swift, TBWindowController.swift, PlanetKeyManagerWindowController.swift. — One of this dimension's main actionable groups (36 recommendation-level).
  3. 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.

D35 · Change Coupling9.5 / 10Stronggated by 8 serious findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: PFDashboardContentView.swift↔PFDashboardWindowController.swift 80%; MyArticleModel+Save.swift↔MyArticleModel+SavePublic.swift 73%; PFDashboardView.swift↔PFDashboardWindowController.swift 73%

Change coupling: PFDashboardContentView.swift ↔ PFDashboardWindowController.swift · ×8Planet/Labs/Published Folders/Dashboard/PFDashboardContentView.swift:1

What to do

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

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

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

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

Frontend & cross-cutting dimensions

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

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

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

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

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

AC3 · Page structure4.9 / 10Adequate✓ Tool-verified

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

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

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

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×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.
AC6 · Visual & motion safety4.0 / 10Weak✓ Tool-verified

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

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

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

  • `.loader` moves (`animation: spin 2s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — Planet/Templates/TemplatePlaceholder.html:32
  • `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.
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.
AX10 · Code composition9.7 / 10Exemplary✓ Tool-verified

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

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

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

AX2 · Stateful singletons4.8 / 10Adequate✓ Tool-verified

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.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

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

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

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.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

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

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

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
M2 · Architecture documentation3.0 / 10Weak✓ Tool-verified

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

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

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

What to do

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

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.
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.
P2 · Observability7.0 / 10Strong✓ Tool-verified

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

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

What to do

  • 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.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

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

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

  • No static application security testing detected. For this repository's stack, add 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.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

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

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.
P5 · DR & Backup4.0 / 10Weak✓ Tool-verified

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

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

What to do

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

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

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

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.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

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

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

  • `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) — tools/claude-code-skill/save_session.py:30, tools/claude-code-skill/save_session.py:37, tools/save-session/scripts/save_session.py:66
  • `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

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.
PF3 · Async & latency hygiene8.5 / 10Exemplary✓ Tool-verified

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

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

  • `sleep` is async and calls sleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs. — Planet/Helper/Extensions.swift:310

What to do

  • Swift: await instead of blocking — `try await Task.sleep(for:)` for Thread.sleep/sleep, a checked continuation instead of a DispatchSemaphore or DispatchGroup wait, the async Process and URLSession APIs; never park a thread waiting on a Task — the cooperative pool cannot guarantee it progress.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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

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

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

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

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

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

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

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

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

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

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

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

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

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

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

X3 · Exception handling6.6 / 10Adequate✓ Tool-verified

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

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

  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×15) — PlanetCLI/PNAPIClient.swift:33, Planet/PlanetAppDelegate.swift:374, Planet/Settings/PlanetSettingsAIView.swift:296, …
  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×6) — Planet/Labs/Published Folders/PlanetPublishedServiceStore.swift:475, Planet/Labs/Published Folders/Dashboard/PFDashboardContentView.swift:118, Planet/Labs/Icon Gallery/IconManager.swift:208, …

What to do

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

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

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

X4 · Structured logging10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

WCAG coverage — what static analysis assessed

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

DimensionWCAG 2.2 A/AA criteriaCoverage
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

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

Reference — by lens

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

LensScoreRatingImpact
Code Health79%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture76%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity58%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness35%Weak — gated by P3, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security69%Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility51%AdequateAcceptable, with room to improve.
Performance85%ExemplaryStrongest area.
Unscored — 3 check(s) recorded observations but carry no score

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

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

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

  • C3 Audit Trail — 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: this repository stores data through 'GRDB' (Planet/Search/SearchDatabase.swift:7) but declares no persisted model this check reads (SwiftData @Model, Core Data, Realm, GRDB and Fluent types, GRDB and SQLite.swift columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
  • C5 Data-Subject Rights — Not assessed: this repository stores data through 'GRDB' (Planet/Search/SearchDatabase.swift:7) but declares no persisted model this check reads (SwiftData @Model, Core Data NSManagedObject, Realm Object, GRDB record and Fluent Model properties, GRDB and SQLite.swift columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
Not included — 50 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
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the service exited before it opened a port — `/tmp/wd-venv/bin/python -m flask --app 'app:app' run --host 127.0.0.1 --port 5000`: 952b4fe6c57/tools/generate-sparkle-notes/app.py", line 95, in gh result = subprocess.run( ^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/subprocess.py", line 548, in run with Popen(*…; runtime evidence skipped (launch chosen because tools/generate-sparkle-notes/app.py defines the Flask application 'app' at module level) This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • 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.
  • D19 Documentation Quality — No runnable or published unit to look for an example in, and no multi-project root README to look for a map in; the other documentation kinds are withheld (see the gaps), so documentation quality is not applicable here.
  • D21 Naming Consistency — Naming consistency is measured on C# only; Python, Swift, html not measured.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .swift, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.swift), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 29 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.
  • 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 — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • M4 Documentation accuracy — Not applicable: the 3 current-state document(s) make no claim of a kind M4 checks. 4 claim(s) of kinds M4 does not check were not checked (path 1, environment variable 3); M4 checks only links and versions and artefact counts.
  • 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 code has 69,398 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.
  • 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.
  • X16 Unfloored truncation loop — 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
  • X18 Disposal-pattern 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
  • 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 asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • 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
  • 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.
  • 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
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 75 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 3 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC3 · Page structure · <html> without a lang · ×3
  • <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").
D34 · Knowledge Freshness · Orphaned knowledge · ×3
  • Orphaned knowledge Planet/Labs/Published Folders/PlanetPublishedServiceStore.swift:1 — 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.
  • Orphaned knowledge Planet/Labs/Icon Gallery/IconManager.swift:1 — 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.
  • Orphaned knowledge Planet/Labs/Published Folders/Dashboard/PFDashboardWindowController.swift:1 — 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.
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>.
D13 · Secret Scanning · Leaked secret · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High CVE · ×1
  • REDACTED
Serious — 632 finding(s)
D3 · God Classes · MethodTooLong · ×40
  • 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.fetchArticleAttachments Planet/Entities/MyPlanetModel+Aggregate.swift:771 — MethodTooLong — fetchArticleAttachments runs 134 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 34 over it, 1.34× 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.
  • + 15 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×38
  • TodoComment PlanetLite/AppContentDropDelegate.swift:10 — // TODO: Rename this to QuickShareDropDelegate and use it in ArticleList too — 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 PlanetLite/AppContentView.swift:49 — // TODO: Add an illustration 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 PlanetLite/AppContentView.swift:116 — // TODO: Audio support — 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 PlanetLite/AppSidebarItemView.swift:14 — // TODO: Some duplicated code here, needs to be refactored — 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/Writer/WriterWindow.swift:33 — // MARK: TODO: Add a offset if there's an opened writer window in the center. — 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/My/MyPlanetEditView.swift:1404 — // TODO: Better sanity check goes 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/Views/My/RebuildProgressView.swift:25 — // TODO: - use a better signal to update progress — 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/ArticleView.swift:819 — // MARK: TODO: should hide download button if any — 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/ArticleWebView.swift:346 — // MARK: TODO: detect running downloads before start new one. — 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/ArticleWebView.swift:393 — // MARK: TODO: handle failed download task. — 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.
  • TodoComment Planet/Views/Articles/ArticleWebViewModel.swift:134 — // TODO: Include an example URL 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/Views/Articles/ArticleWebViewModel.swift:156 — // TODO: Include an example URL 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/Views/Articles/ArticleWebViewModel.swift:178 — // TODO: Include an example URL 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/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/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/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/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/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/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/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/IPFS/Open Views/IPFSOpenView.swift:106 — // TODO: What if user simply pastes an http:// or https:// link?
  • + 13 more in this group — see findings.md.
D6 · Cohesion (LCOM4) · Low cohesion · ×22
  • 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.
D3 · God Classes · FileTooLong · ×17
  • 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: generate-sparkle-notes/app.py tools/generate-sparkle-notes/app.py — FileTooLong — 1130 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 630 over it, 2.26× 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: 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: 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.
D3 · God Classes · ClassTooLong · ×15
  • 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×15
  • Swallowed exception (caught, then discarded) PlanetCLI/PNAPIClient.swift:33 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/PlanetAppDelegate.swift:374 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/Settings/PlanetSettingsAIView.swift:296 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/Search/SearchEmbedding.swift:211 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/Labs/Icon Gallery/IconManager.swift:492 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/Labs/Icon Gallery/IconModel.swift:26 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/IPFS/IPFSState.swift:218 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/IPFS/IPFSState.swift:258 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/IPFS/IPFSState.swift:267 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/IPFS/IPFSState.swift:276 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/Helper/DotBitKit.swift:41 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/Entities/MyArticleModel+Save.swift:211 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/Entities/MyArticleModel+SavePublic.swift:53 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/Entities/MyPlanetModel.swift:425 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) Planet/Entities/PlanetStore.swift:445 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×14
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×13
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×13
  • 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×12
  • 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) REDACTED:129 — REDACTED:129-138 | REDACTED: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 `REDACTED: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.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×12
  • 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×11
  • 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×10
  • 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.
D3 · God Classes · TooManyMethods · ×9
  • 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, declared across 2 files: Entities/MyPlanetModel.swift (99), Entities/MyPlanetModel+Aggregate.swift (30). The bar is 30 methods; this is 99 over it, 4.30× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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, declared across 4 files: Entities/MyArticleModel+Save.swift (31), Entities/MyArticleModel+SavePublic.swift (14), Entities/MyArticleModel.swift (13), Entities/MyArticleModel+ImportExport.swift (5). The bar is 30 methods; this is 33 over it, 2.10× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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, declared across 5 files: Entities/PlanetStore.swift (33), Search/PlanetStore+Spotlight.swift (14), Search/PlanetStore+Search.swift (10), Entities/PlanetStore+Timer.swift (3), +1 more file(s). The bar is 30 methods; this is 31 over it, 2.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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.
D35 · Change Coupling · Change coupling · ×8
  • Change coupling: PFDashboardContentView.swift ↔ PFDashboardWindowController.swift Planet/Labs/Published Folders/Dashboard/PFDashboardContentView.swift:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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:1 — `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.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×6
  • 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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×6
  • 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.
X3 · Exception handling · Swallowed exception (empty catch) · ×6
  • Swallowed exception (empty catch) Planet/Labs/Published Folders/PlanetPublishedServiceStore.swift:475 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Planet/Labs/Published Folders/Dashboard/PFDashboardContentView.swift:118 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Planet/Labs/Icon Gallery/IconManager.swift:208 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Planet/Entities/FollowingPlanetModel.swift:1088 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Planet/Entities/FollowingPlanetModel.swift:1237 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) Planet/Entities/FollowingPlanetModel.swift:1334 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
D12 · Dependency Hygiene · Floating branch dependency · ×5
  • Floating branch dependency: codemirror-swiftui — Dependency `codemirror-swiftui` is resolved in REDACTED 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 REDACTED 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 REDACTED 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 REDACTED 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 REDACTED 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.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×5
  • 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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×5
  • 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×5
  • 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:1348 — tools/generate-sparkle-notes/app.py:1348-1362 | tools/generate-sparkle-notes/app.py:1376-1390 — both copies are in the same file, so extract the 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:1392` calls `notes_exist` and `tools/generate-sparkle-notes/app.py:1364` 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.
D36 · Supply-chain Provenance & Signing REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×4
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×4
  • 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×4
  • 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.
  • Outbound HTTP without resilience tools/claude-code-skill/save_session.py:37 — `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.
  • 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.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×3
  • 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) REDACTED:187 — REDACTED:187-202 | REDACTED: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 `REDACTED: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.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×3
  • 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×3
  • 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.
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>.
D30 · Dependency Vulnerabilities · Medium CVE · ×2
  • REDACTED
  • REDACTED
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.
D4 · Code Duplication · Duplicated block (21–24 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (18 lines × 3) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (11–12 lines × 3) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (10 lines × 4) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 3) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (8 lines × 6) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×2
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×2
  • 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:32 — `.loader` moves (`animation: spin 2s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (1.0 · ×1
  • 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.
AX2 · Stateful singletons · Stateful handler · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleAIChatView.parseCompletionStepFromStreamingBytes · ×1
  • ArticleAIChatView.parseCompletionStepFromStreamingBytes::flushPendingEvent (cyclomatic 88) Planet/Views/Articles/ArticleAIChatView.swift:3780 — ArticleAIChatView.parseCompletionStepFromStreamingBytes::flushPendingEvent has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ArticleAIChatView.parseCompletionStepFromStreamingBytes) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · MyPlanetModel.== (cyclomatic 77) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyPlanetModel.importBackup (cyclomatic 66) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleWebViewModel.checkArticleLink (cyclomatic 46) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleAIChatView.summarizeToolArguments (cyclomatic 45) · ×1
  • 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.
D1 · Cyclomatic Complexity · FollowingPlanetModel.update (cyclomatic 44) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyPlanetModel.performPublish (cyclomatic 43) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleAIChatView.parseCompletionStepFromStreamingBytes (cyclomatic 41) · ×1
  • ArticleAIChatView.parseCompletionStepFromStreamingBytes (cyclomatic 41) Planet/Views/Articles/ArticleAIChatView.swift:3554 — ArticleAIChatView.parseCompletionStepFromStreamingBytes has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ArticleAIChatView.parseCompletionStepFromStreamingBytes::flushPendingEvent) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · MyPlanetModel.savePublic (cyclomatic 38) · ×1
  • 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.
D1 · Cyclomatic Complexity · FollowingArticleModel.browserURL (cyclomatic 36) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleAIChatView.escapeRawControlCharactersInsideJSONString (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleListView.swift.filteredArticles (cyclomatic 32) · ×1
  • 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.
D1 · Cyclomatic Complexity · SearchEmbedding.findRelated (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyArticleItemView.body (cyclomatic 31) · ×1
  • 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.
D1 · Cyclomatic Complexity · SearchEmbedding.search (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleAIChatView.body (cyclomatic 29) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyPlanetModel.fetchArticleAttachments (cyclomatic 28) · ×1
  • MyPlanetModel.fetchArticleAttachments (cyclomatic 28) Planet/Entities/MyPlanetModel+Aggregate.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.
D1 · Cyclomatic Complexity · ArticleAIChatView.summarizeToolResult (cyclomatic 28) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleView.body (cyclomatic 27) · ×1
  • 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.
D1 · Cyclomatic Complexity · IPFSDaemon.setupIPFS (cyclomatic 26) · ×1
  • 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.
D1 · Cyclomatic Complexity · PlanetStore.refreshSelectedArticles (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · MarkdownListAutocomplete.evaluateBeforeNewline (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleAIChatView.normalizeInlineLatex (cyclomatic 25) · ×1
  • ArticleAIChatView.normalizeInlineLatex (cyclomatic 25) Planet/Views/Articles/ArticleAIChatView.swift:1921 — ArticleAIChatView.normalizeInlineLatex has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MyPlanetSidebarItem.body (cyclomatic 25) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyArticleModel.getHeroImage (cyclomatic 24) · ×1
  • MyArticleModel.getHeroImage (cyclomatic 24) Planet/Entities/MyArticleModel+Save.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.
D1 · Cyclomatic Complexity · SearchIndex.makeSnippet (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleAIChatView.requestReply (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleWebViewModel.processPossibleInternalLink (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · PFDashboardWindowController.toolbar (cyclomatic 24) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyArticleGridView.body (cyclomatic 23) · ×1
  • 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.
D1 · Cyclomatic Complexity · MarkdownListAutocomplete.evaluate (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · WalletManager.setupV2 (cyclomatic 22) · ×1
  • 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.
D1 · Cyclomatic Complexity · DraftModel.saveToArticle (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · FollowingArticleModel.renderLocalPreview (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyArticleModel.prewarm (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyPlanetModel.shouldDownloadManagedAttachment (cyclomatic 21) · ×1
  • MyPlanetModel.shouldDownloadManagedAttachment (cyclomatic 21) Planet/Entities/MyPlanetModel+Aggregate.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.
D1 · Cyclomatic Complexity · MyPlanetModel.updateExistingAggregatedArticle (cyclomatic 21) · ×1
  • MyPlanetModel.updateExistingAggregatedArticle (cyclomatic 21) Planet/Entities/MyPlanetModel+Aggregate.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.
D1 · Cyclomatic Complexity · IPFSDaemon.gc (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleAIChatView.chatMessageList (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyPlanetEditView.body (cyclomatic 21) · ×1
  • 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.
D1 · Cyclomatic Complexity · PlanetStore.restoreSavedMyArticleSelection (cyclomatic 20) · ×1
  • PlanetStore.restoreSavedMyArticleSelection (cyclomatic 20) Planet/Entities/PlanetStore.swift:939 — PlanetStore.restoreSavedMyArticleSelection has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArticleAIChatView.parseCompletionStep (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleListView.body (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · FollowingArticleItemView.body (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyPlanetTemplateSettingsView.body (cyclomatic 20) · ×1
  • 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.
D1 · Cyclomatic Complexity · WebAppUpdater.updateWebApp (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleModel.starView (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyArticleModel.processNFTMetadata (cyclomatic 19) · ×1
  • MyArticleModel.processNFTMetadata (cyclomatic 19) Planet/Entities/MyArticleModel+SavePublic.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.
D1 · Cyclomatic Complexity · FeedUtils.findFeed (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleAIChatView.convertLatexCommand (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleAIRepoGrep.search (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyArticleSettingsView.body (cyclomatic 19) · ×1
  • 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.
D1 · Cyclomatic Complexity · PNCommandRunner.parseGlobalOptions (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · FollowingPlanetModel.browserURL (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · PlanetStore.init (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · PlanetQuickShareViewModel.prepareFiles (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · AvatarPickerView.body (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyPlanetEditView.filebaseView (cyclomatic 18) · ×1
  • 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.
D1 · Cyclomatic Complexity · AppContentDropDelegate.performDrop (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · AppSidebarItemView.body (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyArticleModel.browserURL (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · MyPlanetModel.fetchPlanetSite (cyclomatic 17) · ×1
  • MyPlanetModel.fetchPlanetSite (cyclomatic 17) Planet/Entities/MyPlanetModel+Aggregate.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.
D1 · Cyclomatic Complexity · DragPasteboardMedia.supportedAttachmentType (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · FeedUtils.parseFeed (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · PlanetQuickShareView.attachmentSection (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · SearchIndex.sanitizeFTSQuery (cyclomatic 17) · ×1
  • SearchIndex.sanitizeFTSQuery (cyclomatic 17) Planet/Search/SearchIndex.swift:360 — SearchIndex.sanitizeFTSQuery has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PlanetSettingsAIView.body (cyclomatic 17) · ×1
  • 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.
D1 · Cyclomatic Complexity · Filebase.pin (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · TemplateStore.load (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · IconGalleryView.body (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · TBWindowController.toolbar (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleAIChatView.convertLatexExpression (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleAIChatView.unescapeJSONStringLikeValue (cyclomatic 16) · ×1
  • 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.
D1 · Cyclomatic Complexity · ArticleAIChatView.runShellCommand (cyclomatic 16) · ×1
  • 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.
D10 · Test Quality · Skipped test · ×1
  • Skipped test: testDiskAttachmentsMatchAppPipeline PlanetCLITests/PNDiskStoreTests.swift:194 — Skipped — throws XCTSkip
D17 · Explicit Debt · FixmeComment · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.parseCompletionStepFromStreamingBytes · ×1
  • ArticleAIChatView.parseCompletionStepFromStreamingBytes::flushPendingEvent (cognitive 185) Planet/Views/Articles/ArticleAIChatView.swift:3780 — ArticleAIChatView.parseCompletionStepFromStreamingBytes::flushPendingEvent has cognitive complexity 185 (threshold 15). Drivers by points: if/else 54 (141 pts), boolean chains 29, loops 3 (10 pts), ternaries 1 (5 pts) (nesting depth added 98). 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. This shape REPEATS in the file: one other method here (ArticleAIChatView.parseCompletionStepFromStreamingBytes) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · MyPlanetModel.savePublic (cognitive 140) · ×1
  • 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.
D2 · Cognitive Complexity · FollowingPlanetModel.update (cognitive 103) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleWebViewModel.checkArticleLink (cognitive 97) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetModel.importBackup (cognitive 78) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.summarizeToolArguments (cognitive 77) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetModel.== (cognitive 76) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetModel.performPublish (cognitive 71) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.escapeRawControlCharactersInsideJSONString (cognitive 66) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.parseCompletionStepFromStreamingBytes (cognitive 59) · ×1
  • ArticleAIChatView.parseCompletionStepFromStreamingBytes (cognitive 59) Planet/Views/Articles/ArticleAIChatView.swift:3554 — ArticleAIChatView.parseCompletionStepFromStreamingBytes has cognitive complexity 59 (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. This shape REPEATS in the file: one other method here (ArticleAIChatView.parseCompletionStepFromStreamingBytes::flushPendingEvent) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · MyPlanetModel.fetchArticleAttachments (cognitive 57) · ×1
  • MyPlanetModel.fetchArticleAttachments (cognitive 57) Planet/Entities/MyPlanetModel+Aggregate.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.
D2 · Cognitive Complexity · WalletManager.setupV2 (cognitive 56) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.requestReply (cognitive 52) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetModel.fetchPlanetSite (cognitive 51) · ×1
  • MyPlanetModel.fetchPlanetSite (cognitive 51) Planet/Entities/MyPlanetModel+Aggregate.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.
D2 · Cognitive Complexity · SearchEmbedding.findRelated (cognitive 48) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.normalizeInlineLatex (cognitive 48) · ×1
  • 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). Of this number, 44 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MyArticleModel.getHeroImage (cognitive 45) · ×1
  • MyArticleModel.getHeroImage (cognitive 45) Planet/Entities/MyArticleModel+Save.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.
D2 · Cognitive Complexity · IPFSDaemon.gc (cognitive 44) · ×1
  • 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.
D2 · Cognitive Complexity · SearchEmbedding.search (cognitive 43) · ×1
  • 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.
D2 · Cognitive Complexity · AppContentItemView.itemPreviewImageView (cognitive 42) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleWebViewModel.processPossibleInternalLink (cognitive 42) · ×1
  • 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.
D2 · Cognitive Complexity · MyArticleItemView.body (cognitive 42) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIRepoGrep.search (cognitive 41) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetTemplateSettingsView.body (cognitive 39) · ×1
  • 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.
D2 · Cognitive Complexity · TemplateStore.load (cognitive 38) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleView.body (cognitive 38) · ×1
  • 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.
D2 · Cognitive Complexity · FollowingArticleModel.renderLocalPreview (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · FollowingArticleModel.browserURL (cognitive 37) · ×1
  • 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.
D2 · Cognitive Complexity · AppContentDropDelegate.performDrop (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · WebAppUpdater.updateWebApp (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetModel.fetchHTTPSite (cognitive 35) · ×1
  • MyPlanetModel.fetchHTTPSite (cognitive 35) Planet/Entities/MyPlanetModel+Aggregate.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.
D2 · Cognitive Complexity · IPFSDaemon.setupIPFS (cognitive 35) · ×1
  • 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.
D2 · Cognitive Complexity · MyArticleGridView.body (cognitive 34) · ×1
  • 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.
D2 · Cognitive Complexity · DraftModel.saveToArticle (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · PlanetStore.refreshSelectedArticles (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · DotBitKit.resolve (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.summarizeToolResult (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.parseCompletionStep (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleListView.body (cognitive 33) · ×1
  • 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.
D2 · Cognitive Complexity · SearchIndex.makeSnippet (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.body (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · MyArticleSettingsView.body (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetEditView.filebaseView (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetSidebarItem.body (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · PFDashboardWindowController.toolbar (cognitive 32) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleModel.starView (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · DragPasteboardMedia.importedFiles (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · IconManager.preparePreviewAnimationImages (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.chatMessageList (cognitive 30) · ×1
  • 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.
D2 · Cognitive Complexity · FollowingArticleModel.webviewURL (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · MyArticleModel.prewarm (cognitive 28) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetModel.publishIPNSKeepAlive (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · FeedUtils.findFeed (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · FollowingArticleItemView.body (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetEditView.pinnableView (cognitive 27) · ×1
  • 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.
D2 · Cognitive Complexity · MyArticleModel.importArticles (cognitive 26) · ×1
  • MyArticleModel.importArticles (cognitive 26) Planet/Entities/MyArticleModel+ImportExport.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.
D2 · Cognitive Complexity · MyArticleModel.processNFTMetadata (cognitive 26) · ×1
  • MyArticleModel.processNFTMetadata (cognitive 26) Planet/Entities/MyArticleModel+SavePublic.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.
D2 · Cognitive Complexity · PlanetStore.restoreSavedMyArticleSelection (cognitive 26) · ×1
  • 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). Of this number, 22 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownListAutocomplete.evaluateBeforeNewline (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · Filebase.pin (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.convertLatexCommand (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.runShellCommand (cognitive 26) · ×1
  • 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.
D2 · Cognitive Complexity · AttributedConsoleView.updateNSView (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleModel.mediaLabels (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetModel.renderRSS (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · AvatarPickerView.body (cognitive 25) · ×1
  • 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.
D2 · Cognitive Complexity · DraftModel.addAttachment (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · MyArticleModel.removeDSStore (cognitive 24) · ×1
  • MyArticleModel.removeDSStore (cognitive 24) Planet/Entities/MyArticleModel+Save.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.
D2 · Cognitive Complexity · PlanetQuickShareDropDelegate.processDropInfo (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · PlanetQuickShareViewModel.prepareFiles (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · PlanetSettingsAIView.body (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · IconGalleryView.body (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleListView.swift.filteredArticles (cognitive 24) · ×1
  • 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.
D2 · Cognitive Complexity · PlanetStore.init (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · MarkdownListAutocomplete.evaluate (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · URLUtils.repoPath (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · PlanetQuickShareView.attachmentSection (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · PlanetQuickShareViewModel.processPasteItems (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · SearchIndex.sanitizeFTSQuery (cognitive 23) · ×1
  • 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). Of this number, 19 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArticleAIChatView.convertLatexExpression (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.sendOnDeviceMessage (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · OnDeviceToolContext.reloadStoreAndRestoreSelection (cognitive 23) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetModel.shouldDownloadManagedAttachment (cognitive 22) · ×1
  • MyPlanetModel.shouldDownloadManagedAttachment (cognitive 22) Planet/Entities/MyPlanetModel+Aggregate.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.
D2 · Cognitive Complexity · FeedUtils.parseFeed (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · DockIconPreviewView.body (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · IconManager.playAnimation (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleView.toolbarPlanetView (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetEditView.body (cognitive 22) · ×1
  • 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.
D2 · Cognitive Complexity · FollowingPlanetModel.load (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · MyArticleModel.processAttachmentCIDIfNeeded (cognitive 21) · ×1
  • MyArticleModel.processAttachmentCIDIfNeeded (cognitive 21) Planet/Entities/MyArticleModel+SavePublic.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.
D2 · Cognitive Complexity · DragPasteboardMedia.supportedAttachmentType (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · KeyboardShortcutHelper.publishedFoldersMenus (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · IPFSOpenView.open (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.normalizeLatexMarkup (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.decodeJSONObject (cognitive 21) · ×1
  • 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.
D2 · Cognitive Complexity · app.search_notes (cognitive 21) · ×1
  • app.search_notes (cognitive 21) tools/generate-sparkle-notes/app.py:454 — 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.
D2 · Cognitive Complexity · PlanetAppDelegate.application (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · PlanetAppDelegate.handleAPIControlURL (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · PNCommandRunner.parseGlobalOptions (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetModel.updateExistingAggregatedArticle (cognitive 20) · ×1
  • MyPlanetModel.updateExistingAggregatedArticle (cognitive 20) Planet/Entities/MyPlanetModel+Aggregate.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.
D2 · Cognitive Complexity · PlanetStore.reloadAfterExternalMyDataChange (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleView.toolbarAttachmentsView (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · Coordinator.webView (cognitive 20) · ×1
  • 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.
D2 · Cognitive Complexity · PlanetAPIControlView.controlView (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · TBWindowController.toolbar (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleView.syncSelectedArticlePresentation (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · FollowPlanetView.processInput (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · Coordinator.webView (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · save_session.find_existing_article (cognitive 19) · ×1
  • 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.
D2 · Cognitive Complexity · AppContentView.body (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · AppSidebarItemView.body (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · dWebServices.publish (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.unescapeJSONStringLikeValue (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · PlanetStore+Search.swift.searchSnapshots (cognitive 18) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetModel.ensureArticleNumbers (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · SearchEmbedding.rebuildEmbeddings (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · VideoInfoRow.startCompression (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · WalletAccountView.loadENS (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleSpeechPlayerViewModel.detectLanguage (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · MyArticleSettingsView.verifyUserInput (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · PlanetSidebarView.body (cognitive 17) · ×1
  • 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.
D2 · Cognitive Complexity · app.sync_gh (cognitive 17) · ×1
  • app.sync_gh (cognitive 17) tools/generate-sparkle-notes/app.py:1586 — app.sync_gh has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PlanetDownloadsItemView.body (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · MyArticleModel.browserURL (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · MyArticleModel.toggleToDoItem (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetModel.aggregate (cognitive 16) · ×1
  • MyPlanetModel.aggregate (cognitive 16) Planet/Entities/MyPlanetModel+Aggregate.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.
D2 · Cognitive Complexity · PlanetStore.checkPinnable (cognitive 16) · ×1
  • PlanetStore.checkPinnable (cognitive 16) Planet/Entities/PlanetStore+Timer.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.
D2 · Cognitive Complexity · FeedUtils.findLinkFromFeed (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · PlanetKeyManagerWindowController.validateToolbarItem (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · IPFSIdentitySheetView.content (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · PlanetPublishedServiceStore.updatePendingPublishings (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.isLikelyLatexMathSpan (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · ArticleAIChatView.formatTokenUsage (cognitive 16) · ×1
  • 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). Of this number, 11 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · WriteArticleTool.call (cognitive 16) · ×1
  • 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.
D2 · Cognitive Complexity · MyPlanetEditView.verifyUserInput (cognitive 16) · ×1
  • 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (91 shared lines) · ×1
  • 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.
D4 · Code Duplication · Near-duplicate member pair (30 shared lines) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (63 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (57–60 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (55 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (38–42 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (41 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (40 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (35–37 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (33 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (28–33 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (27–30 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (28–29 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (29 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (26–28 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (24–26 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (25 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (16–23 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (20 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9–17 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14–17 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (14 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (10–13 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (11 lines × 7) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6–11 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (3–11 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6–9 lines × 4) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 3) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 12) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 8) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (6 lines × 20) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 14) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (5 lines × 9) · ×1
  • 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.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×1
  • 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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×1
  • Sync-over-async blocking Planet/Helper/Extensions.swift:310 — `sleep` is async and calls sleep — a blocking call inside async code stalls the cooperative pool's thread — one per core — and every task scheduled on it for as long as it runs.
Minor — 68 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×36
  • Orphaned file Planet/Views/Articles/ArticleWebViewModel.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/TemplateBrowser/Window Controller/TBWindowController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/Key Manager/PlanetKeyManagerWindowController.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/IPFS/Status Views/IPFSTrafficChartView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/Helper/HttpRequest.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/IPFS/Status Views/IPFSStatusView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/Labs/Published Folders/Dashboard/PFDashboardInspectorView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/API/PlanetAPIConsoleView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file PlanetLite/AppContentItemView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file PlanetLite/AppSidebarView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/Labs/Icon Gallery/IconGalleryView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/Labs/Published Folders/Dashboard/PFDashboardContentView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file PlanetLite/CroptopApp.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/Writer/AttachmentThumbnailView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/Downloads/PlanetDownloadsItemView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/Views/Components/ArtworkView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file tools/generate-sparkle-notes/planet.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/Views/Components/IndicatorLabelView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file PlanetLite/AppDelegate.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/Downloads/PlanetDownloadModel.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/Labs/Published Folders/Dashboard/PFDashboardView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file PlanetLite/AppContentDropDelegate.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/Labs/Published Folders/PlanetPublishedFolders+Extension.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file Planet/Labs/Published Folders/Dashboard/PFDashboardSidebarItemView.swift:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 11 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×9
  • Silent fallback default in catch Planet/Entities/MyPlanetModel.swift:425 — `templateSettingsHash` turns every thrown error into `""` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Planet/Helper/FeedUtils.swift:265 — `iconScore` turns every thrown error into `0` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Planet/Helper/ThemeColorExtractor.swift:28 — `extractEntries` turns every thrown error into `[]` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Planet/Log/CloudflarePagesLogger.swift:42 — `readAll` turns every thrown error into `""` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Planet/Log/IPFSLogger.swift:46 — `readAll` turns every thrown error into `""` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Planet/Log/PlanetLogger.swift:50 — `readAll` turns every thrown error into `""` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Planet/Log/PlanetLogger.swift:109 — `readAll` turns every thrown error into `""` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Planet/Log/PlanetLogger.swift:160 — `readAll` turns every thrown error into `""` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
  • Silent fallback default in catch Planet/Log/SSHRsyncLogger.swift:42 — `readAll` turns every thrown error into `""` — a data error becomes a silent behavior change with no trail. Log the error or let it propagate (`throws`). If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment at the `catch`, `guard` or `??`, or in the doc comment, and the row stops firing.
X10 · Duplicated predicate · Duplicated predicate · ×7
  • Duplicated predicate Planet/Settings/PlanetSettingsAIView.swift:10 — `PLANET_ENABLE_APPLE_INTELLIGENCE && canImport(FoundationModels)` appears character-identically in 4 files — Planet/Settings/PlanetSettingsAIView.swift, Planet/Views/Articles/ArticleAIChatView.swift, Planet/Views/Articles/ArticleAIOnDeviceTools.swift, Planet/Views/Articles/ArticleView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Planet/TemplateBrowser/TemplateBrowserPreviewWebView.swift:107 — `components?.scheme == "http" || components?.scheme == "https"` appears character-identically in 2 files — Planet/TemplateBrowser/TemplateBrowserPreviewWebView.swift, Planet/Views/Articles/ArticleWebView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Planet/Quick Share/PlanetQuickShareDropDelegate.swift:87 — `providerCount > 0 || hasDirectImage || hasPromise` appears character-identically in 2 files — Planet/Quick Share/PlanetQuickShareDropDelegate.swift, Planet/Views/Articles/ArticleListView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Planet/PlanetAppDelegate.swift:248 — `settings.alertSetting == .disabled || settings.authorizationStatus == .notDetermined` appears character-identically in 2 files — Planet/PlanetAppDelegate.swift, PlanetLite/AppDelegate.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Planet/PlanetAppDelegate.swift:247 — `settings.authorizationStatus == .authorized || settings.authorizationStatus == .provisional || settings.authorizationStatus == .notDetermine…` appears character-identically in 2 files — Planet/PlanetAppDelegate.swift, PlanetLite/AppDelegate.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Planet/Views/Articles/ArticleView.swift:341 — `settingsAIIsReady || isOnDeviceAIAvailable` appears character-identically in 2 files — Planet/Views/Articles/ArticleView.swift, Planet/Views/Sidebar/PlanetSidebarView.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate Planet/Entities/AttachmentModel.swift:19 — `type.conforms(to: .movie) || type.conforms(to: .video)` appears character-identically in 2 files — Planet/Entities/AttachmentModel.swift, PlanetCLI/PNDiskStore.swift. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×2
  • Hand-rolled JSON/XML parsing via regex Planet/Views/Articles/ArticleAIChatView.swift:1569 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex Planet/Views/Articles/ArticleAIChatView.swift:1585 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Swift code already uses a real parser in the same package; use it here too.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 60 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 (+52 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 (61 single-owned of 172 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template 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 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: PlanetLite/AppContentItemView.swift.
D20 · ADR Quality · No ADRs found · ×1
  • 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/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (63174 LoC, 529 module-visible types across 44 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 36 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/Key Manager/PlanetKeyManagerWindowController.swift, Planet/IPFS/Status Views/IPFSTrafficChartView.swift, Planet/Helper/HttpRequest.swift, Planet/IPFS/Status Views/IPFSStatusView.swift, Planet/Labs/Published Folders/Dashboard/PFDashboardInspectorView.swift, PlanetLite/AppContentItemView.swift (and 28 more) (39 orphaned of 172 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template 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.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M3 · Folder & project structure · No src/ separation · ×1
  • 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'.
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.
P3 · Security & performance tooling · No SAST · ×1
  • 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.
P4 · Deployment & Rollback · No release approval gate · ×1
  • 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.
Minor — 33 finding(s)
D12 · Dependency Hygiene · Outdated · ×33
  • 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.2 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.1 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.1 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.5 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.7.3 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.16.2 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.13.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.104.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.2 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.

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

Run 01a18734-0d81-7572-92f6-1018c11e98e7 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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