Public report of glushchenko/fsnotes, published 26 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 reportMeasured 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, 26 October 2026, 11:01 UTC · Survey ID cd_a9e0306a9d044de7803184dbb3ac7370
glushchenko/fsnotes
Measured 26 October 2026, 10:59 UTC, at code version ca305e4
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.
Test distribution is not measured: No automated tests.
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
Up 1 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: 47,528 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 0.3 person-years · Weakest lens: Production Readiness, 28
Findings by how serious they are
13 critical421 serious24 minor
34 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
26 October 2026, 10:59 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 ▸
41of 41 dimensions measured by tools.
444of 458 findings point to an exact file and line, so you can open each one in the code. The other 14 concern the repository as a whole, such as missing documentation.
41dimensions across 7 lenses, read from 47,528 lines of product code in 3 projects.
glushchenko/fsnotes falls short of our standard for production because the project has no automated tests and six passwords or keys sit in the current code. It scores 49 out of 100 and is rated Weak, and six of its 13 critical findings are leaked passwords or keys.
Production Readiness, at 28, is the weakest lens and counts most in the score. The best first step is replacing the six exposed passwords or keys and switching the old ones off, worth about 17 points. Adding automated tests comes next, also worth about 17. Raising Production Readiness to 70 would lift the score to about 65.
Six passwords or keys are open to anyone who can read the repository. The project has no automated tests, so a change can break it without warning, and six sets of files in separate parts keep changing together, which points to hidden dependencies. Adding automated tests, replacing each exposed password or key and making the hidden dependencies explicit would close these risks.
The product code is 47,528 lines, about €44,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
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.
Rebuild cost: about €44,000 · Estimate
Cost to rebuild
€15,000 to €73,000, for 242 to 769 hours of work, about 0.3 person-years for one engineer
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 49. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Medium: 47,528 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: 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 6 Leaked secret finding(s) in Secret Scanning — start with REDACTED (3), REDACTED (2), REDACTED.
Raises the score by about 17 points · Low effort · Secret Scanning
2
Resolve the 1 No automated tests finding(s) in Code Coverage.
Raises the score by about 17 points · Low effort · Code Coverage
3
Resolve the 1 No tests found finding(s) in Test Distribution.
Raises the score by about 17 points · Low effort · Test Distribution
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 €44,000 to build again, about 0.3 person-years of work. Its weakest lens is Production Readiness, at 28 (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 6 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 17 points for low effort, because it clears the 6 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.7 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 6% to 13% on every change. The history of the code shows how much it changes: about 1,790 lines over the last 90 days, which is about 7,259 lines a year. At that pace, the extra work comes to an estimated 1 to 6.2 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 · 74% · Adequate · gated by D2 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A07:2025 — Authentication Failures
6
High / Critical
Roadmap
Immediately resolve the six leaked secrets in the specified view controllers to eliminate security risks. Next, establish automated testing and distribution for the uncovered code paths to ensure reliability. Finally, introduce architectural decision records to document key design choices and optimize allocation patterns on hot paths to improve performance.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 6 Leaked secret finding(s) in Secret Scanning — start with REDACTED (3), REDACTED (2), REDACTED.
Raise allocation-aware density on the hot paths — currently 12 use(s) across 58,786 production line(s) (~0.2/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
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.
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 — 13
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 — 421
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 — 24
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 34
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 41 of 41 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 — 41 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 444 of 458 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (55 contributor(s) across 2900 commit(s) sampled, automation and bot accounts excluded). One of them holds 92% of the history; the other 54 hold 0.1% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
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. For npm the surface is what a published package.json's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
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. `FSNotes iOS/Preferences/ProViewController.swift`, `FSNotes iOS/RevisionsViewController.swift`, `FSNotes iOS/View/NotesTableView.swift`, `FSNotes iOS/ViewController+More.swift`, `FSNotes iOS/ViewController.swift`, … (+7 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.
D44 Platform End-of-Life — 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in FSNotesCore/SwiftHighlighter/Languages/Groovy.swift, whose lifetimes are not modelled 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.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: 1 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
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 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 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.
X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala, Rust 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.
X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, 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.
X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, 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.
X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust and Dart source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Ruby, Python, Go, Rust or Dart 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.
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.
X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, 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.
X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, 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 JavaScript/TypeScript, Go, PHP, Dart, Kotlin, Ruby, Scala, Java, Python or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, TypeScript/JavaScript, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded, and this repository's 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.
X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin 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.
X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart and Ruby source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart or Ruby 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.
X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded, no Java, Rust, Erlang, F#, Python, Dart, Ruby, Scala or Kotlin was found, and this repository's Swift (Foundation mutable collections) 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.
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.
X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Scala, JavaScript/TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart and Ruby source only, and no C# was loaded and no Scala, JavaScript, TypeScript, Java, Kotlin, Python, PHP, Go, Rust, Dart or Ruby was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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 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.
D8 Code Coverage: Coverage is measured by building and running the test suite inside Watchdog's isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
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.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
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.
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.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
53 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was NotesTextProcessor.highlightMarkdown at 100. A further 4 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 LanguageType.description at 20 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: FSNotesCore/Business/LanguageType.swift (LanguageType.description at 20). 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.
+ 48 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with NotesTextProcessor.highlightMarkdown (cyclomatic 100), ViewController.processFileMenuItems (cyclomatic 85), ViewController.keyDown (cyclomatic 76). — 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.0 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 115 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 7 bodies over 60 down to 60 or less in Cognitive Complexity — start with ViewController.keyDown (cognitive 135), NotesTextProcessor.highlightMarkdown (cognitive 122), EditorViewController.validateMenuItem (cognitive 117). — 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 7 together lifts Cognitive Complexity from 3.8 to about 5.3/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.0 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 16 ClassTooLong finding(s) in God Classes — start with ViewController.swift (2), REDACTED (2), NotesTableView.swift (2). — One of this dimension's main actionable groups (16 warning-level).
Resolve the 16 FileTooLong finding(s) in God Classes — start with ViewController.swift (2), REDACTED (2), Note.swift. — One of this dimension's main actionable groups (16 warning-level).
Resolve the 15 TooManyMethods finding(s) in God Classes — start with REDACTED (2), ViewController.swift (2), EditTextView.swift (2). — One of this dimension's main actionable groups (15 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
105 duplicated block group(s) detected. A further 6 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 53 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 10 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with NotesTableView.swift (3), MPreviewView.swift, NotesTextProcessor.swift. — One of this dimension's main actionable groups (10 warning-level).
Resolve the 9 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with NotesTableView.swift (2), ViewController.swift (2), UITextView+.swift. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 8 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with EditTextView.swift (2), TextFormatter.swift (2), NotesTableView.swift. — One of this dimension's main actionable groups (8 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
3 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, and main-sequence distance (abstractness) is not computed for these modules yet.
✓ On the Gold path — maintain.
Detailed fixes: d5_recommendation.md.
Do you agree with this assessment?
D6 · Cohesion (LCOM4)4.1 / 10Weak✓ 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.
Resolve the 53 Low cohesion finding(s) in Cohesion (LCOM4) — start with EditTextView.swift (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (53 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D8 · Code Coverage0.0 / 10Critical✓ Tool-verified
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from coverlet runs or committed reports (Cobertura/OpenCover/lcov), computed per-file with structured exclusions for generated, trivial, and glue code. When the suite can't be built/run in-image AND no report is committed, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
No automated tests — no test code was found in this repository.
No automated tests
What to do
Resolve the 1 No automated tests finding(s) in Code Coverage. — One of this dimension's main actionable groups (1 issue-level).
Enforce Code Coverage in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution0.0 / 10Critical✓ 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.
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.
2 outdated direct SwiftPM dependencies, 2 pinning defect(s). 7 of 12 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: libcmark_gfm · ×2
Outdated: rncryptor · ×2
What to do
Resolve the 2 Floating branch dependency finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (2 warning-level).
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 6 Leaked secret finding(s) in Secret Scanning — start with REDACTED (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (6 issue-level).
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.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 12 SwiftPM package(s) use a banned license. SwiftPM has no package registry, so each package's licence is the one its repository declares: 12 of them read from the licence file the repository carries at the revision Package.resolved pins, and 0 — unpinned, or whose licence file could not be read or named — from api.deps.dev, which reports the licence the repository declares today. Graded: every package a committed Package.resolved pins, direct and transitive, and every declared dependency none pins.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
What it measures: 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.
4 deducted task-comment markers across 47528 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 2 TodoComment finding(s) in Explicit Debt — start with Status.swift, Sidebar.swift. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 HackComment finding(s) in Explicit Debt — start with EditTextView.swift, FileSystemEventManager.swift. — One of this dimension's main actionable groups (2 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
1 of 1 build units (Xcode) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
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.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
semgrep found no security issues. semgrep hit a parse error in 1 file(s) — `Resources/MPreview.bundle/js/tex-mml-chtml.js` — so no absence of findings in them is evidence of anything, and nothing in them was analysed. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.
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.
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.
1 of 164 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is FSNotes iOS/Helpers/SFTPUploader.swift. Counted over 164 of the 270 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 6 Boundary-crossing change coupling finding(s) in Change Coupling — start with ViewController.swift (2), Sidebar.swift (2), GitViewController.swift. — One of this dimension's main actionable groups (6 issue-level).
Resolve the 9 Change coupling finding(s) in Change Coupling — start with REDACTED, SidebarItem.swift, ProjectSettingsViewController.swift. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 3 Change-coupling hub finding(s) in Change Coupling — start with ViewController.swift (2), SidebarTableView.swift. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether 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.
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.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
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.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour — a data-only reference entity whose logic lives in a foreign service is anemic. Rich models enforce their own invariants.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether a reference entity protects its own invariants — a class whose identity is a computed content hash but whose hashed fields are publicly mutable bypasses that invariant. Encapsulated state keeps identity-bearing fields immutable.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain entity fused to a persistence ORM on its own declaration (active-record), or reaching a web-framework transport type in its own method, couples the domain to infrastructure. The clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
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.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the 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.
Start a test surface where your build system looks for one (tests/, test/, spec/, or your ecosystem's test source set) — the separation follows from putting the first tests in the right place.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Do you agree with this assessment?
P1 · CI/CD gates7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
A CI pipeline exists but no test-runner invocation (your stack's test command, or a test job) was found — changes may merge without the suite running.
What to do
Run the test suite in CI via an explicit runner step (`xcodebuild test` for the toolchain this pipeline already uses) and gate merges on it.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
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 384 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
What to do
Add a SAST step to CI running what this repository's stack ships: CodeQL's Swift pack (Swift/Xcode) — or `semgrep --config=auto`, which runs on any language — so a security regression fails the build instead of landing.
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 12 use(s) across 58,786 production line(s) (~0.2/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Swift: on hot paths, reserveCapacity before appending, use ContiguousArray for class-element arrays, work in place with withUnsafeBufferPointer/withUnsafeTemporaryAllocation, and make large values ~Copyable with borrowing/consuming parameters.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a 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.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×3) — FSNotesCore/ImagesProcessor.swift:88, FSNotesCore/Extensions/Project+Git.swift:247, FSNotesCore/Extensions/URL+.swift:121
`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. (×6) — FSNotesCore/Git/revision/FileHistoryIterator.swift:153, FSNotesCore/Git/revision/FileHistoryIterator.swift:258, FSNotesCore/Git/branch/Branch.swift:65, …
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 1 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.
P4 Deployment & Rollback — not evidenced — no deploy/rollback/approval signal in the repo; absence of evidence is not evidence of a manual release
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 78 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 — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
AC2 Forms & labels — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
AC3 Page structure — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
AC4 Keyboard semantics — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
AC5 ARIA correctness — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
AC6 Visual & motion safety — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
AC7 A11y enforcement — Frontend below the scale floor (21 DOM element(s) < 25) — too little surface to assess accessibility.
AX1 Captive dependencies — 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
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Swift request handler (a Vapor, Hummingbird, Kitura, Swifter or Perfect route handler, as a method or a registered closure) is declared, so no state is shared between request threads.
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
AX8 Test isolation — no test/production split to check
AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
C1 Data Protection — Not assessed: 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.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named property (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a SwiftData @Model, a Core Data, Realm, GRDB or Fluent type, a GRDB or SQLite.swift column, or in a SQL CREATE TABLE or ALTER TABLE — and no database or data-store client (CoreData, SwiftData, GRDB, RealmSwift, SQLite, Firebase, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D10 Test Quality — No tests were found in the analyzed repository to assess for quality.
D11 Test Reliability — No test suite was found to re-run, so reliability couldn't be assessed. Two searches produced that zero and both came back empty: the classifier that reads the loaded workspace recognised no suite it could run, and a walk of the source on disk — which covers the JS/TS `*.test.*` and `*.spec.*` conventions and probes for a Pester suite — found no test source in any other ecosystem either. Neither search reaches a suite that is missing from the loaded workspace and carries no name either walk recognises, so this is 'no suite found by those two searches', not a verdict that the repository has none.
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
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; 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+ projects each declaring an entity of their own. 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 .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) — 12 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D36 Supply-chain Provenance & Signing — The CI pipeline builds and tests but publishes no released artifact — no package publish, container push, GitHub release or deployment step. Supply-chain provenance, signing and SBOM attest RELEASED artifacts, so there is nothing to attest here. Add them to the release pipeline when this repo starts shipping artifacts (a published package, a container image, a deployed service or a tagged release).
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.
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
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
DM1 Aggregate boundaries — not scored for Swift: the sidecar flattens array/collection types (a child COLLECTION = legitimate membership vs a single embedded aggregate is indistinguishable), and aggregate-vs-value-object classification cannot be told apart in source (every struct-holding-struct reads alike) — reported as guidance rather than measured
DM2 Strongly-typed ids — no in-repo typed-id idiom — primitive-obsession recorded as advisory DM8, DM2 not gated
DM3 Integration-event coupling — not scored for Swift: a cross-SwiftPM-target domain leak cannot be told apart in source from a legitimate shared-kernel/contracts module, and most repositories ship a single module — reported as guidance rather than measured
DM7 Repository granularity — not scored for Swift: 'a repository per CHILD entity' needs the aggregate-root structure, which is not source-resolvable — reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, 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
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Swift source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — 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 tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, 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.
PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X12 Unreachable branch — 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
X13 Undrained process stream — 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
X15 Unvalidated length from an untrusted reader — 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
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
X17 Uncapped recursion over a caller-supplied document — 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
X19 Unrestored process-global state — 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.
X21 Side-effecting pattern guard — Not applicable: this check looks for a pattern guard or `case` label that increments, decrements or assigns while the switch is deciding whether it matches, and in this repository's languages none can. Swift has no `++` or `--`, and an assignment yields `()`, which cannot be an operand of `&&`, `||` or `?:` nor the Bool a `case … where` clause needs. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X23 Unguarded diagnostic materialisation — 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
X24 Document value interpolated into markup unescaped — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X25 Inert configuration knob — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X27 Collection changed while being enumerated — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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
X30 Support guard that admits what it rejects — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
Boundary-crossing change coupling: GitViewController.swift ↔ Project+Git.swift FSNotes iOS/Preferences/GitViewController.swift:1— `FSNotes iOS/Preferences/GitViewController.swift` (context FSNotes iOS) and `FSNotesCore/Extensions/Project+Git.swift` (context FSNotesCore) sit in DIFFERENT parts of the tree yet change together 69% of the time (22 of the 32 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 22 shared commits counted here, the most recent 3 are `16b021bb` #1849; `ef82804d` - Fixes and improvements (at that commit the files were still `FSNotes iOS/Settings/GitViewController.swift` and `FSNotesCore/Shared/Extensions/Project+Git.swift`); `a801a996` - Fixes and improvements - Improves commit process #1522 (at that commit the files were still `FSNotes iOS/Settings/GitViewController.swift` and `FSNotesCore/Shared/Extensions/Project+Git.swift`) — run `git show` on any of them.
Boundary-crossing change coupling: ViewController.swift ↔ Project+Git.swift FSNotes iOS/ViewController.swift:1— `FSNotes iOS/ViewController.swift` (context FSNotes iOS) and `FSNotesCore/Extensions/Project+Git.swift` (context FSNotesCore) sit in DIFFERENT parts of the tree yet change together 54% of the time (20 of the 37 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 20 shared commits counted here, the most recent 3 are `387cec31` - Fixes iOS deprecated code (at that commit the file was still `FSNotesCore/Shared/Extensions/Project+Git.swift`); `c47da23a` - Fixes and improvements (at that commit the file was still `FSNotesCore/Shared/Extensions/Project+Git.swift`); `ef82804d` - Fixes and improvements (at that commit the file was still `FSNotesCore/Shared/Extensions/Project+Git.swift`) — run `git show` on any of them.
Boundary-crossing change coupling: NotesTableView.swift ↔ NoteCellView+.swift FSNotes/View/NotesTableView.swift:1— `FSNotes/View/NotesTableView.swift` (context FSNotes) and `FSNotesCore/NoteCellView+.swift` (context FSNotesCore) sit in DIFFERENT parts of the tree yet 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `794b5751` - fixes and improvements; `b5c05a68` - fixes and improvements; `523a26bb` - fixes images preview - fixes first note selection — run `git show` on any of them.
Boundary-crossing change coupling: ViewController.swift ↔ Note+History.swift FSNotes iOS/ViewController.swift:1— `FSNotes iOS/ViewController.swift` (context FSNotes iOS) and `FSNotesCore/Note+History.swift` (context FSNotesCore) sit in DIFFERENT parts of the tree yet change together 52% of the time (11 of the 21 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `ffea8590` - refactoring (at that commit the file was still `FSNotesCore/Shared/Note+History.swift`); `c47da23a` - Fixes and improvements (at that commit the file was still `FSNotesCore/Shared/Note+History.swift`); `ef82804d` - Fixes and improvements (at that commit the file was still `FSNotesCore/Shared/Note+History.swift`) — run `git show` on any of them.
Boundary-crossing change coupling: Sidebar.swift ↔ Note.swift FSNotes/Helpers/Sidebar.swift:1— `FSNotes/Helpers/Sidebar.swift` (context FSNotes) and `FSNotesCore/Business/Note.swift` (context FSNotesCore) sit in DIFFERENT parts of the tree yet change together 50% of the time (22 of the 44 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 22 shared commits counted here, the most recent 3 are `bb6c0c30` - Consistecy refactoring (at that commit the files were still `FSNotes/Business/Sidebar.swift` and `FSNotes/Business/Note.swift`); `0a13ab0b` - Fixes order by creation date (at that commit the files were still `FSNotes/Business/Sidebar.swift` and `FSNotes/Business/Note.swift`); `267c72e1` - Ongoing refactoring (at that commit the files were still `FSNotes/Business/Sidebar.swift` and `FSNotes/Business/Note.swift`) — run `git show` on any of them.
Boundary-crossing change coupling: Sidebar.swift ↔ SidebarItemType.swift FSNotes/Helpers/Sidebar.swift:1— `FSNotes/Helpers/Sidebar.swift` (context FSNotes) and `FSNotesCore/Business/SidebarItemType.swift` (context FSNotesCore) sit in DIFFERENT parts of the tree yet change together 50% of the time (10 of the 20 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `bb6c0c30` - Consistecy refactoring (at that commit the files were still `FSNotes/Business/Sidebar.swift` and `FSNotes/Business/SidebarItemType.swift`); `267c72e1` - Ongoing refactoring (at that commit the files were still `FSNotes/Business/Sidebar.swift` and `FSNotes/Business/SidebarItemType.swift`); `597d14ce` Bug fixes and improvements (at that commit the files were still `FSNotes/Business/Sidebar.swift` and `FSNotes/Business/SidebarItemType.swift`) — run `git show` on any of them.
No automated tests — No automated tests — no test code was found in this repository. Untested code is the largest single risk to changing it safely. Start with the code you change most often: add a suite in a framework a runner can collect (XCTest or Swift Testing), and run it in CI so the gap cannot reopen.
Low cohesion: EditTextView (LCOM4 36) FSNotes/View/EditTextView.swift:12— EditTextView's methods fall into 36 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 36 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: String (LCOM4 27) REDACTED:284— String's methods fall into 27 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 27 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: EditorViewController (LCOM4 26) FSNotes iOS/EditorViewController.swift:17— EditorViewController's methods fall into 26 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 26 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: EditTextView (LCOM4 25) FSNotes iOS/View/EditTextView.swift:13— EditTextView's methods fall into 25 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 25 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: ViewController (LCOM4 20) FSNotes/ViewController.swift:16— ViewController's methods fall into 20 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 20 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: ViewController (LCOM4 18) FSNotes iOS/ViewController.swift:15— ViewController's methods fall into 18 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 18 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: AppDelegate (LCOM4 17) FSNotes/AppDelegate.swift:12— AppDelegate's methods fall into 17 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 17 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: EditorViewController (LCOM4 16) REDACTED:15— EditorViewController's methods fall into 16 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 16 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: PreferencesEditorViewController (LCOM4 16) FSNotes/Preferences/PreferencesEditorViewController.swift:11— PreferencesEditorViewController's methods fall into 16 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 16 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: SidebarOutlineView (LCOM4 14) FSNotes/View/SidebarOutlineView.swift:13— SidebarOutlineView'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: GitViewController (LCOM4 13) FSNotes iOS/Preferences/GitViewController.swift:12— GitViewController'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: SettingsViewController (LCOM4 13) FSNotes iOS/Preferences/SettingsViewController.swift:14— SettingsViewController'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: Storage (LCOM4 13) FSNotesCore/Business/Storage.swift:18— Storage'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: NotesTableView (LCOM4 12) FSNotes/View/NotesTableView.swift:12— NotesTableView's methods fall into 12 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 12 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: PreferencesGeneralViewController (LCOM4 11) FSNotes/Preferences/PreferencesGeneralViewController.swift:12— PreferencesGeneralViewController's methods fall into 11 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 11 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: PreferencesUserInterfaceViewController (LCOM4 11) FSNotes/Preferences/PreferencesUserInterfaceViewController.swift:11— PreferencesUserInterfaceViewController's methods fall into 11 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 11 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: SettingsEditorViewController (LCOM4 10) FSNotes iOS/Preferences/SettingsEditorViewController.swift:11— SettingsEditorViewController's methods fall into 10 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 10 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: PreferencesWebViewController (LCOM4 9) REDACTED:12— PreferencesWebViewController'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: ProjectSettingsViewController (LCOM4 8) FSNotes/ProjectSettingsViewController.swift:12— ProjectSettingsViewController'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: DefaultExtensionViewController (LCOM4 8) FSNotes iOS/Preferences/DefaultExtensionControllerView.swift:11— DefaultExtensionViewController'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: ProViewController (LCOM4 8) FSNotes iOS/Preferences/ProViewController.swift:11— ProViewController'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: SFTPViewController (LCOM4 8) FSNotes iOS/Preferences/SFTPViewController.swift:11— SFTPViewController'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: UIImage (LCOM4 8) FSNotes iOS/Extensions/UIImage+.swift:11— UIImage'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: RevisionsViewController (LCOM4 7) FSNotes iOS/RevisionsViewController.swift:12— RevisionsViewController'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: SceneDelegate (LCOM4 7) FSNotes iOS/SceneDelegate.swift:11— SceneDelegate'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.
ClassTooLong: Note FSNotesCore/Business/Note.swift:15— ClassTooLong — 1326 significant lines (blank, comment-only and punctuation-only lines excluded), 137 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: ViewController FSNotes/ViewController.swift:16— ClassTooLong — 1220 significant lines (blank, comment-only and punctuation-only lines excluded), 81 methods. The bar is 400 significant lines; this is 820 over it, 3.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: EditTextView FSNotes/View/EditTextView.swift:12— ClassTooLong — 1140 significant lines (blank, comment-only and punctuation-only lines excluded), 105 methods. The bar is 400 significant lines; this is 740 over it, 2.85× 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: SidebarOutlineView FSNotes/View/SidebarOutlineView.swift:13— ClassTooLong — 1140 significant lines (blank, comment-only and punctuation-only lines excluded), 85 methods. The bar is 400 significant lines; this is 740 over it, 2.85× 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: UserDefaultsManagement FSNotesCore/UserDefaultsManagement.swift:17— ClassTooLong — 1077 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 677 over it, 2.69× 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: EditorViewController FSNotes iOS/EditorViewController.swift:17— ClassTooLong — 980 significant lines (blank, comment-only and punctuation-only lines excluded), 130 methods. The bar is 400 significant lines; this is 580 over it, 2.45× 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: ViewController FSNotes iOS/ViewController.swift:15— ClassTooLong — 955 significant lines (blank, comment-only and punctuation-only lines excluded), 118 methods. The bar is 400 significant lines; this is 555 over it, 2.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: Storage FSNotesCore/Business/Storage.swift:18— ClassTooLong — 943 significant lines (blank, comment-only and punctuation-only lines excluded), 99 methods. The bar is 400 significant lines; this is 543 over it, 2.36× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: EditorViewController REDACTED:15— ClassTooLong — 937 significant lines (blank, comment-only and punctuation-only lines excluded), 61 methods. The bar is 400 significant lines; this is 537 over it, 2.34× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TextFormatter FSNotesCore/TextFormatter.swift:24— ClassTooLong — 864 significant lines (blank, comment-only and punctuation-only lines excluded), 45 methods. The bar is 400 significant lines; this is 464 over it, 2.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: NotesTextProcessor FSNotesCore/NotesTextProcessor.swift:15— ClassTooLong — 782 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 382 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: NotesTableView FSNotes iOS/View/NotesTableView.swift:15— ClassTooLong — 770 significant lines (blank, comment-only and punctuation-only lines excluded), 50 methods. The bar is 400 significant lines; this is 370 over it, 1.93× 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: Project FSNotesCore/Business/Project.swift:12— ClassTooLong — 563 significant lines (blank, comment-only and punctuation-only lines excluded), 88 methods. The bar is 400 significant lines; this is 163 over it, 1.41× 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: SidebarTableView FSNotes iOS/View/SidebarTableView.swift:14— ClassTooLong — 513 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 113 over it, 1.28× 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: MPreviewView FSNotesCore/MPreviewView.swift:21— ClassTooLong — 502 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 102 over it, 1.26× 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: NotesTableView FSNotes/View/NotesTableView.swift:12— ClassTooLong — 403 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 3 over it, 1.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
FileTooLong: Business/Note.swift FSNotesCore/Business/Note.swift— FileTooLong — 1330 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: Note (15-2276). The bar is 500 significant lines; this is 830 over it, 2.66× 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: FSNotes/ViewController.swift FSNotes/ViewController.swift— FileTooLong — 1226 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: ViewController (16-2100). The bar is 500 significant lines; this is 726 over it, 2.45× 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: View/SidebarOutlineView.swift FSNotes/View/SidebarOutlineView.swift— FileTooLong — 1143 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: SidebarOutlineView (13-2029). The bar is 500 significant lines; this is 643 over it, 2.29× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: View/EditTextView.swift FSNotes/View/EditTextView.swift— FileTooLong — 1142 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: EditTextView (12-1899). The bar is 500 significant lines; this is 642 over it, 2.28× 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: FSNotesCore/UserDefaultsManagement.swift FSNotesCore/UserDefaultsManagement.swift— FileTooLong — 1083 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: UserDefaultsManagement (17-1812). The bar is 500 significant lines; this is 583 over it, 2.17× 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: FSNotes iOS/EditorViewController.swift FSNotes iOS/EditorViewController.swift— FileTooLong — 987 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: EditorViewController (17-1642). The bar is 500 significant lines; this is 487 over it, 1.97× 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: FSNotes iOS/ViewController.swift FSNotes iOS/ViewController.swift— FileTooLong — 973 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: ViewController (15-1609). The bar is 500 significant lines; this is 473 over it, 1.95× 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: Business/Storage.swift FSNotesCore/Business/Storage.swift— FileTooLong — 951 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: Storage (18-1608). The bar is 500 significant lines; this is 451 over it, 1.90× 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 — 942 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: EditorViewController (15-1558). The bar is 500 significant lines; this is 442 over it, 1.88× 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: FSNotesCore/TextFormatter.swift FSNotesCore/TextFormatter.swift— FileTooLong — 877 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: TextFormatter (24-1374). The bar is 500 significant lines; this is 377 over it, 1.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: FSNotesCore/NotesTextProcessor.swift FSNotesCore/NotesTextProcessor.swift— FileTooLong — 812 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: NotesTextProcessor (15-1335). The bar is 500 significant lines; this is 312 over it, 1.62× 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: View/NotesTableView.swift FSNotes iOS/View/NotesTableView.swift— FileTooLong — 775 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: NotesTableView (15-1263). The bar is 500 significant lines; this is 275 over it, 1.55× 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: FSNotesCore/MPreviewView.swift FSNotesCore/MPreviewView.swift— FileTooLong — 613 significant lines (blank, comment-only and punctuation-only lines excluded), about 82% of them inside a single declaration: MPreviewView (21-806). The bar is 500 significant lines; this is 113 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: FSNotes iOS/ViewController+More.swift FSNotes iOS/ViewController+More.swift— FileTooLong — 607 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 107 over it, 1.21× 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: Business/Project.swift FSNotesCore/Business/Project.swift— FileTooLong — 565 significant lines (blank, comment-only and punctuation-only lines excluded), about 100% of them inside a single declaration: Project (12-967). The bar is 500 significant lines; this is 65 over it, 1.13× 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: View/SidebarTableView.swift FSNotes iOS/View/SidebarTableView.swift— FileTooLong — 516 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: SidebarTableView (14-866). The bar is 500 significant lines; this is 16 over it, 1.03× 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.
TooManyMethods: Note FSNotesCore/Business/Note.swift:15— TooManyMethods — 137 methods, declared across 3 files: Business/Note.swift (120), FSNotesCore/Note+History.swift (12), Business/Note+Preview.swift (5). The bar is 30 methods; this is 107 over it, 4.57× 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: EditorViewController FSNotes iOS/EditorViewController.swift:17— TooManyMethods — 130 methods, declared across 8 files: FSNotes iOS/EditorViewController.swift (84), FSNotes iOS/EditorViewController+Search.swift (17), FSNotes/ViewController+Git.swift (9), FSNotes/EditorViewController+ScrollPosition.swift (6), +4 more file(s). The bar is 30 methods; this is 100 over it, 4.33× 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: ViewController FSNotes iOS/ViewController.swift:15— TooManyMethods — 118 methods, declared across 4 files: FSNotes iOS/ViewController.swift (82), FSNotes iOS/ViewController+More.swift (27), FSNotes/ViewController+Menu.swift (5), FSNotesCore/ViewController+WebApi.swift (4). The bar is 30 methods; this is 88 over it, 3.93× 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: EditTextView FSNotes/View/EditTextView.swift:12— TooManyMethods — 105 methods. The bar is 30 methods; this is 75 over it, 3.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Storage FSNotesCore/Business/Storage.swift:18— TooManyMethods — 99 methods, declared across 2 files: Business/Storage.swift (97), Extensions/Storage+Git.swift (2). The bar is 30 methods; this is 69 over it, 3.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: Project FSNotesCore/Business/Project.swift:12— TooManyMethods — 88 methods, declared across 3 files: Business/Project.swift (55), Extensions/Project+Git.swift (31), Business/Project+Date.swift (2). The bar is 30 methods; this is 58 over it, 2.93× 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: SidebarOutlineView FSNotes/View/SidebarOutlineView.swift:13— TooManyMethods — 85 methods. The bar is 30 methods; this is 55 over it, 2.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ViewController FSNotes/ViewController.swift:16— TooManyMethods — 81 methods. The bar is 30 methods; this is 51 over it, 2.70× 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: EditorViewController REDACTED:15— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NotesTableView FSNotes/View/NotesTableView.swift:12— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× 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: NotesTableView FSNotes iOS/View/NotesTableView.swift:15— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× 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: EditTextView FSNotes iOS/View/EditTextView.swift:13— TooManyMethods — 47 methods, declared across 6 files: View/EditTextView+Complete.swift (18), View/EditTextView.swift (17), View/EditTextView+Clicked.swift (6), View/EditTextView+DragOperation.swift (3), +2 more file(s). The bar is 30 methods; this is 17 over it, 1.57× 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: TextFormatter FSNotesCore/TextFormatter.swift:24— TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SidebarTableView FSNotes iOS/View/SidebarTableView.swift:14— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AppDelegate FSNotes/AppDelegate.swift:12— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (5 lines × 2) FSNotes iOS/View/NotesTableView.swift:369— FSNotes iOS/View/NotesTableView.swift:369-373 | FSNotes iOS/View/NotesTableView.swift:529-534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) FSNotes iOS/View/NotesTableView.swift:469— FSNotes iOS/View/NotesTableView.swift:469-473 | FSNotes iOS/View/NotesTableView.swift:572-576 — both copies are in the same file, so extract the 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 `FSNotes iOS/View/NotesTableView.swift:469` 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) FSNotes iOS/View/NotesTableView.swift:690— FSNotes iOS/View/NotesTableView.swift:690-694 | FSNotes iOS/ViewController+More.swift:589-593 — 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 `FSNotes iOS/View/NotesTableView.swift:690` 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, `FSNotes iOS/View/NotesTableView.swift:695` calls `NSAttributedString`, `getFileName` and `FSNotes iOS/ViewController+More.swift:594` 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) FSNotesCore/MPreviewView.swift:184— FSNotesCore/MPreviewView.swift:184-188 | FSNotesCore/MPreviewView.swift:427-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) FSNotesCore/NotesTextProcessor.swift:232— FSNotesCore/NotesTextProcessor.swift:232-236 | FSNotesCore/NotesTextProcessor.swift:825-829 — both copies are in the same file, so extract the 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 `FSNotesCore/NotesTextProcessor.swift:232` 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) FSNotes iOS/Preferences/CodeFontViewController.swift:52— FSNotes iOS/Preferences/CodeFontViewController.swift:52-56 | FSNotes iOS/Preferences/FontViewController.swift:60-64 — 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) FSNotesCore/Git/commit/Commit.swift:59— FSNotesCore/Git/commit/Commit.swift:59-63 | FSNotesCore/Git/remote/Remote.swift:32-36 — 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) FSNotes iOS/Preferences/ProViewController.swift:137— FSNotes iOS/Preferences/ProViewController.swift:137-141 | FSNotes iOS/RevisionsViewController.swift:61-65 — 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 `FSNotes iOS/Preferences/ProViewController.swift:137` 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) REDACTED:447— REDACTED:447-451 | FSNotes/View/SidebarOutlineView.swift:725-729 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `FSNotes/View/SidebarOutlineView.swift:721` calls `getFullName` and `REDACTED:446` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 2) FSNotes/ViewController+Menu.swift:36— FSNotes/ViewController+Menu.swift:36-40 | FSNotes/ViewController+Menu.swift:220-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
MethodTooLong: NotesTextProcessor.highlightMarkdown FSNotesCore/NotesTextProcessor.swift:337— MethodTooLong — highlightMarkdown runs 311 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 211 over it, 3.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ViewController.openSidebarSettings FSNotes iOS/ViewController+More.swift:180— MethodTooLong — openSidebarSettings runs 172 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 72 over it, 1.72× 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: ViewController.keyDown FSNotes/ViewController.swift:665— MethodTooLong — keyDown runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ViewController.processFileMenuItems FSNotes/ViewController+Menu.swift:13— MethodTooLong — processFileMenuItems runs 132 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EditorViewController.validateMenuItem REDACTED:65— MethodTooLong — validateMenuItem runs 122 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 22 over it, 1.22× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MPreviewView.htmlFromTemplate FSNotesCore/MPreviewView.swift:478— MethodTooLong — htmlFromTemplate runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ViewController.makeSidebarSettingsMenu FSNotes iOS/ViewController+More.swift:14— MethodTooLong — makeSidebarSettingsMenu runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: NotesTableView.actionsSheet FSNotes iOS/View/NotesTableView.swift:424— MethodTooLong — actionsSheet runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: NotesTableView.makeBulkMenu FSNotes iOS/View/NotesTableView.swift:267— MethodTooLong — makeBulkMenu runs 108 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× 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.
Change coupling: REDACTED ↔ LanguageViewController.swift FSNotes iOS/EditorViewController.swift:1— `FSNotes iOS/EditorViewController.swift` and `FSNotes iOS/Preferences/LanguageViewController.swift` change together 100% of the time (11 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 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 11 shared commits counted here, the most recent 3 are `ef286693` - Default keybaord refactoring (at that commit the file was still `FSNotes iOS/Settings/LanguageViewController.swift`); `a8801d9b` - Allows bulk delete - Allows multiple select - Adds new icons (at that commit the file was still `FSNotes iOS/Settings/LanguageViewController.swift`); `e8bad49e` Adds iPhone X, XS, XR support (at that commit the file was still `FSNotes iOS/Settings/LanguageViewController.swift`) — run `git show` on any of them.
Change coupling: SidebarItem.swift ↔ Storage.swift FSNotesCore/Business/SidebarItem.swift:1— `FSNotesCore/Business/SidebarItem.swift` and `FSNotesCore/Business/Storage.swift` change together 60% of the time (12 of the 20 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 12 shared commits counted here, the most recent 3 are `bb6c0c30` - Consistecy refactoring (at that commit the files were still `FSNotes/Business/SidebarItem.swift` and `FSNotes/Business/Storage.swift`); `267c72e1` - Ongoing refactoring (at that commit the files were still `FSNotes/Business/SidebarItem.swift` and `FSNotes/Business/Storage.swift`); `3eb18b47` #1143 #1147 (at that commit the files were still `FSNotes/Business/SidebarItem.swift` and `FSNotes/Business/Storage.swift`) — run `git show` on any of them.
Change coupling: ProjectSettingsViewController.swift ↔ NotesTableView.swift FSNotes iOS/Preferences/ProjectSettingsViewController.swift:1— `FSNotes iOS/Preferences/ProjectSettingsViewController.swift` and `FSNotes iOS/View/NotesTableView.swift` change together 55% of the time (12 of the 22 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 12 shared commits counted here, the most recent 3 are `bb6c0c30` - Consistecy refactoring (at that commit the file was still `FSNotes iOS/Settings/ProjectSettingsViewController.swift`); `e8bd7fca` - Fixes and improvements (at that commit the file was still `FSNotes iOS/Settings/ProjectSettingsViewController.swift`); `c6d10b0a` Fixes and improvements (at that commit the file was still `FSNotes iOS/Settings/ProjectSettingsViewController.swift`) — run `git show` on any of them.
Change coupling: EditTextView.swift ↔ EditorSplitView.swift FSNotes/View/EditTextView.swift:1— `FSNotes/View/EditTextView.swift` and `FSNotes/View/EditorSplitView.swift` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). 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 6 shared commits counted here, the most recent 3 are `2826061a` - refactoring; `79b249f3` Fixed resizing master view while in Preview mode; `14dc9d5e` Fixed resizing master view while in Preview mode — run `git show` on any of them.
Change coupling: Project+Git.swift ↔ Note+History.swift FSNotesCore/Extensions/Project+Git.swift:1— `FSNotesCore/Extensions/Project+Git.swift` and `FSNotesCore/Note+History.swift` change together 52% of the time (11 of the 21 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 11 shared commits counted here, the most recent 3 are `dce89695` #1477 (at that commit the files were still `FSNotesCore/Shared/Extensions/Project+Git.swift` and `FSNotesCore/Shared/Note+History.swift`); `c47da23a` - Fixes and improvements (at that commit the files were still `FSNotesCore/Shared/Extensions/Project+Git.swift` and `FSNotesCore/Shared/Note+History.swift`); `ef82804d` - Fixes and improvements (at that commit the files were still `FSNotesCore/Shared/Extensions/Project+Git.swift` and `FSNotesCore/Shared/Note+History.swift`) — run `git show` on any of them.
Change coupling: AppDelegate.swift ↔ REDACTED FSNotes iOS/AppDelegate.swift:1— `FSNotes iOS/AppDelegate.swift` and `FSNotes iOS/EditorViewController.swift` change together 51% of the time (27 of the 53 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 27 shared commits counted here, the most recent 3 are `3681254d` #1777; `c75f2cc2` - Fixes and improvements; `ff554947` - Adds preview state sync for iOS/macOS — run `git show` on any of them.
Change coupling: CloudDriveManager.swift ↔ MoveViewController.swift FSNotes iOS/Helpers/CloudDriveManager.swift:1— `FSNotes iOS/Helpers/CloudDriveManager.swift` and `FSNotes iOS/MoveViewController.swift` change together 50% of the time (11 of the 22 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 11 shared commits counted here, the most recent 3 are `267c72e1` - Ongoing refactoring (at that commit the file was still `FSNotes iOS/CloudDriveManager.swift`); `4fb5e5d3` - Improves versioning (at that commit the file was still `FSNotes iOS/CloudDriveManager.swift`); `15754ccb` Refactoring (at that commit the file was still `FSNotes iOS/CloudDriveManager.swift`) — run `git show` on any of them.
Change coupling: Note.swift ↔ SidebarItem.swift FSNotesCore/Business/Note.swift:1— `FSNotesCore/Business/Note.swift` and `FSNotesCore/Business/SidebarItem.swift` change together 50% of the time (10 of the 20 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 10 shared commits counted here, the most recent 3 are `bb6c0c30` - Consistecy refactoring (at that commit the files were still `FSNotes/Business/Note.swift` and `FSNotes/Business/SidebarItem.swift`); `267c72e1` - Ongoing refactoring (at that commit the files were still `FSNotes/Business/Note.swift` and `FSNotes/Business/SidebarItem.swift`); `f38222ff` #188 (at that commit the files were still `FSNotes/Business/Note.swift` and `FSNotes/Business/SidebarItem.swift`) — run `git show` on any of them.
Change coupling: Sidebar.swift ↔ NotesTableView.swift FSNotes iOS/Helpers/Sidebar.swift:1— `FSNotes iOS/Helpers/Sidebar.swift` and `FSNotes iOS/View/NotesTableView.swift` change together 50% of the time (8 of the 16 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 8 shared commits counted here, the most recent 3 are `f821ee39` #iOS app improvements; `bb6c0c30` - Consistecy refactoring (at that commit the file was still `FSNotes iOS/Business/Sidebar.swift`); `92fc9e72` init (at that commit the file was still `FSNotes iOS/Business/Sidebar.swift`) — run `git show` on any of them.
Duplicated block (7 lines × 2) FSNotes iOS/Extensions/UITextView+.swift:45— FSNotes iOS/Extensions/UITextView+.swift:45-51 | FSNotes iOS/Extensions/UITextView+.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `FSNotes iOS/Extensions/UITextView+.swift:52` calls `setActionName` and `FSNotes iOS/Extensions/UITextView+.swift:73` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) FSNotes iOS/Helpers/CloudDriveManager.swift:266— FSNotes iOS/Helpers/CloudDriveManager.swift:266-272 | FSNotes iOS/Helpers/CloudDriveManager.swift:282-288 — both copies are in the same file, so extract the 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 `FSNotes iOS/Helpers/CloudDriveManager.swift:266` 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) FSNotes iOS/ImagePreviewViewController.swift:160— FSNotes iOS/ImagePreviewViewController.swift:160-166 | FSNotes iOS/Preferences/ProjectsViewController.swift:180-186 — 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 `FSNotes iOS/ImagePreviewViewController.swift:160` 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 (7 lines × 2) FSNotes iOS/View/NotesTableView.swift:445— FSNotes iOS/View/NotesTableView.swift:445-451 | FSNotes iOS/View/NotesTableView.swift:456-462 — both copies are in the same file, so extract the 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 `FSNotes iOS/View/NotesTableView.swift:445` 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) FSNotes iOS/ViewController.swift:692— FSNotes iOS/ViewController.swift:692-698 | FSNotes/ViewController.swift:1786-1792 — 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 `FSNotes iOS/ViewController.swift:692` 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) FSNotes iOS/ViewController.swift:1410— FSNotes iOS/ViewController.swift:1410-1416 | FSNotes iOS/ViewController.swift:1439-1445 — both copies are in the same file, so extract the 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 `FSNotes iOS/ViewController.swift:1410` 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) FSNotes/View/SidebarOutlineView.swift:168— FSNotes/View/SidebarOutlineView.swift:168-174 | FSNotes/View/SidebarOutlineView.swift:1025-1031 — both copies are in the same file, so extract the 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 (7 lines × 2) FSNotes iOS/Helpers/SandboxBookmark.swift:18— FSNotes iOS/Helpers/SandboxBookmark.swift:18-25 | FSNotes/Helpers/SandboxBookmark.swift:16-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.
Duplicated block (7 lines × 2) FSNotes iOS/View/NotesTableView.swift:259— FSNotes iOS/View/NotesTableView.swift:259-265 | FSNotes iOS/View/SidebarTableView.swift:365-371 — 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) FSNotes iOS/View/NotesTableView.swift:459— FSNotes iOS/View/NotesTableView.swift:459-464 | FSNotes iOS/View/NotesTableView.swift:508-514 — both copies are in the same file, so extract the 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 `FSNotes iOS/View/NotesTableView.swift:459` 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) REDACTED:1228— REDACTED:1228-1233 | REDACTED:1237-1242 — both copies are in the same file, so extract the 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:1228` 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) FSNotes/View/EditTextView.swift:629— FSNotes/View/EditTextView.swift:629-634 | FSNotes/View/EditTextView.swift:740-745 — both copies are in the same file, so extract the 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 `FSNotes/View/EditTextView.swift:629` 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, `FSNotes/View/EditTextView.swift:748` calls `insertText`, `String` and `FSNotes/View/EditTextView.swift:636` 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) FSNotesCore/Business/FSTag.swift:23— FSNotesCore/Business/FSTag.swift:23-28 | FSNotesCore/Business/FSTag.swift:34-39 — both copies are in the same file, so extract the 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 `FSNotesCore/Business/FSTag.swift:23` 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 × 2) FSNotesCore/TextFormatter.swift:731— FSNotesCore/TextFormatter.swift:731-736 | FSNotesCore/TextFormatter.swift:1287-1292 — both copies are in the same file, so extract the 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) FSNotesCore/TextFormatter.swift:740— FSNotesCore/TextFormatter.swift:740-745 | FSNotesCore/TextFormatter.swift:1298-1303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `FSNotesCore/TextFormatter.swift:740` 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) FSNotes iOS/Preferences/GitViewController.swift:428— FSNotes iOS/Preferences/GitViewController.swift:428-433 | FSNotes iOS/Preferences/SFTPViewController.swift:416-421 — 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) FSNotes/View/EditTextView.swift:362— FSNotes/View/EditTextView.swift:362-367 | FSNotes/View/EditTextView.swift:390-395 — both copies are in the same file, so extract the 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 (10 lines × 2) FSNotes iOS/MoveViewController.swift:114— FSNotes iOS/MoveViewController.swift:114-123 | FSNotes iOS/Preferences/ProjectsViewController.swift:107-116 — before extracting anything, compare `FSNotes iOS/MoveViewController.swift` and `FSNotes iOS/Preferences/ProjectsViewController.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 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 `FSNotes iOS/MoveViewController.swift:114` 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) FSNotes iOS/Preferences/GitViewController.swift:274— FSNotes iOS/Preferences/GitViewController.swift:274-283 | FSNotes iOS/Preferences/GitViewController.swift:292-301 — both copies are in the same file, so extract the 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 `FSNotes iOS/Preferences/GitViewController.swift:274` 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 (10 lines × 2) FSNotes/View/NoteCellView.swift:213— FSNotes/View/NoteCellView.swift:213-222 | FSNotes/View/NoteCellView.swift:234-243 — both copies are in the same file, so extract the 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 `FSNotes/View/NoteCellView.swift:213` 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) FSNotes/ViewController+Menu.swift:50— FSNotes/ViewController+Menu.swift:50-59 | FSNotes/ViewController+Menu.swift:78-87 — both copies are in the same file, so extract the 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 `FSNotes/ViewController+Menu.swift:50` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `FSNotes/ViewController+Menu.swift:91` calls `NSLocalizedString` and `FSNotes/ViewController+Menu.swift:60` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) FSNotesCore/Business/LanguageType.swift:42— FSNotesCore/Business/LanguageType.swift:42-51 | FSNotesCore/Business/LanguageType.swift:67-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 `FSNotesCore/Business/LanguageType.swift:42` 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) FSNotesCore/Business/LanguageType.swift:56— FSNotesCore/Business/LanguageType.swift:56-65 | FSNotesCore/Business/LanguageType.swift:81-90 — both copies are in the same file, so extract the 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 `FSNotesCore/Business/LanguageType.swift:56` 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) FSNotesCore/Business/Storage.swift:671— FSNotesCore/Business/Storage.swift:671-680 | FSNotesCore/Business/Storage.swift:682-691 — both copies are in the same file, so extract the 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) FSNotes iOS/ViewController+More.swift:266— FSNotes iOS/ViewController+More.swift:266-273 | FSNotes iOS/ViewController+More.swift:304-311 — both copies are in the same file, so extract the 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 `FSNotes iOS/ViewController+More.swift:266` 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) FSNotes iOS/ViewController.swift:534— FSNotes iOS/ViewController.swift:534-541 | FSNotes iOS/ViewController.swift:553-560 — both copies are in the same file, so extract the 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 `FSNotes iOS/ViewController.swift:534` 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) FSNotes iOS/ViewController.swift:675— FSNotes iOS/ViewController.swift:675-682 | FSNotes/ViewController.swift:1769-1776 — 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 `FSNotes iOS/ViewController.swift:675` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) FSNotesCore/Business/Note.swift:841— FSNotesCore/Business/Note.swift:841-848 | FSNotesCore/Business/Note.swift:850-857 — both copies are in the same file, so extract the 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 `FSNotesCore/Business/Note.swift:841` 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) FSNotesCore/Business/Project.swift:832— FSNotesCore/Business/Project.swift:832-839 | FSNotesCore/Business/Storage.swift:833-840 — 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 `FSNotesCore/Business/Project.swift:832` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) FSNotesCore/Business/Storage.swift:209— FSNotesCore/Business/Storage.swift:209-216 | FSNotesCore/UserDefaultsManagement.swift:253-260 — 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 `FSNotesCore/Business/Storage.swift:209` 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) FSNotesCore/NotesTextProcessor.swift:695— FSNotesCore/NotesTextProcessor.swift:695-702 | FSNotesCore/NotesTextProcessor.swift:727-734 — both copies are in the same file, so extract the 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 `FSNotesCore/NotesTextProcessor.swift:695` 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.
Swallowed exception (caught, then discarded) FSNotesCore/Git/revision/FileHistoryIterator.swift:153— `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) FSNotesCore/Git/revision/FileHistoryIterator.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) FSNotesCore/Git/branch/Branch.swift:65— `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) FSNotesCore/Business/Note.swift:238— `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) FSNotesCore/Business/Note.swift:1709— `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) FSNotesCore/Business/Storage.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.
Duplicated block (9 lines × 2) FSNotes iOS/Preferences/ProViewController.swift:149— FSNotes iOS/Preferences/ProViewController.swift:149-157 | FSNotes iOS/RevisionsViewController.swift:67-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 `FSNotes iOS/Preferences/ProViewController.swift:149` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) FSNotes iOS/View/NoteCellView.swift:142— FSNotes iOS/View/NoteCellView.swift:142-150 | FSNotes/View/NoteCellView.swift:258-266 — 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 `FSNotes iOS/View/NoteCellView.swift:142` 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) FSNotes iOS/ViewController.swift:1373— FSNotes iOS/ViewController.swift:1373-1381 | REDACTED:1168-1176 — 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 (9 lines × 2) FSNotesCore/MPreviewView.swift:173— FSNotesCore/MPreviewView.swift:173-181 | FSNotesCore/MPreviewView.swift:416-424 — both copies are in the same file, so extract the 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 `FSNotesCore/MPreviewView.swift:173` 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) FSNotesCore/TextFormatter.swift:165— FSNotesCore/TextFormatter.swift:165-173 | FSNotesCore/TextFormatter.swift:175-183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) FSNotes iOS/Helpers/SingleImageTouchDownGestureRecognizer.swift:19— FSNotes iOS/Helpers/SingleImageTouchDownGestureRecognizer.swift:19-31 | FSNotes iOS/Helpers/SingleImageTouchDownGestureRecognizer.swift:45-57 — both copies are in the same file, so extract the 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 `FSNotes iOS/Helpers/SingleImageTouchDownGestureRecognizer.swift:19` 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, `FSNotes iOS/Helpers/SingleImageTouchDownGestureRecognizer.swift:36` calls `Int` and `FSNotes iOS/Helpers/SingleImageTouchDownGestureRecognizer.swift:61` 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) REDACTED:94— REDACTED:94-106 | FSNotes/Preferences/SettingsViewController.swift:88-100 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:94` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) FSNotes/View/SidebarOutlineView.swift:1399— FSNotes/View/SidebarOutlineView.swift:1399-1411 | FSNotes/View/SidebarOutlineView.swift:1421-1433 — both copies are in the same file, so extract the 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 `FSNotes/View/SidebarOutlineView.swift:1399` 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) FSNotesCore/TextFormatter.swift:533— FSNotesCore/TextFormatter.swift:533-545 | FSNotesCore/TextFormatter.swift:554-566 — both copies are in the same file, so extract the 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 `FSNotesCore/TextFormatter.swift:533` 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.
Change-coupling hub: ViewController.swift → AppDelegate.swift, UserDefaultsManagement+.swift, MoveViewController.swift, ProjectSettingsViewController.swift, ProjectsViewController.swift, NoteCellView.swift, SidebarTableCellView.swift FSNotes iOS/ViewController.swift— `FSNotes iOS/ViewController.swift` changes together with 7 other files — `FSNotes iOS/AppDelegate.swift`, `FSNotes iOS/Extensions/UserDefaultsManagement+.swift`, `FSNotes iOS/MoveViewController.swift`, `FSNotes iOS/Preferences/ProjectSettingsViewController.swift`, `FSNotes iOS/Preferences/ProjectsViewController.swift`, `FSNotes iOS/View/NoteCellView.swift`, `FSNotes iOS/View/SidebarTableCellView.swift` — none of which declares a dependency on it: one file is the hub of 7 separate couplings, not 7 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 7.
Change-coupling hub: ViewController.swift → SandboxBookmark.swift, REDACTED, SidebarCellView.swift FSNotes/ViewController.swift— `FSNotes/ViewController.swift` changes together with 3 other files — `FSNotes/Helpers/SandboxBookmark.swift`, `REDACTED`, `FSNotes/View/SidebarCellView.swift` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: SidebarTableView.swift → MoveViewController.swift, ProjectSettingsViewController.swift, ProjectsViewController.swift, NotesTableView.swift FSNotes iOS/View/SidebarTableView.swift— `FSNotes iOS/View/SidebarTableView.swift` changes together with 4 other files — `FSNotes iOS/MoveViewController.swift`, `FSNotes iOS/Preferences/ProjectSettingsViewController.swift`, `FSNotes iOS/Preferences/ProjectsViewController.swift`, `FSNotes iOS/View/NotesTableView.swift` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
Duplicated block (18 lines × 2) FSNotes iOS/View/NotesTableView.swift:976— FSNotes iOS/View/NotesTableView.swift:976-993 | REDACTED:761-778 — 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 `FSNotes iOS/View/NotesTableView.swift:976` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) FSNotes iOS/ViewController+More.swift:879— FSNotes iOS/ViewController+More.swift:879-896 | FSNotes iOS/ViewController+More.swift:903-920 — both copies are in the same file, so extract the 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 `FSNotes iOS/ViewController+More.swift:879` 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 × 2) FSNotesCore/Business/Note.swift:371— FSNotesCore/Business/Note.swift:371-388 | FSNotesCore/Business/Note.swift:408-425 — both copies are in the same file, so extract the 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 `FSNotesCore/Business/Note.swift:371` 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) FSNotes iOS/View/NotesTableView.swift:729— FSNotes iOS/View/NotesTableView.swift:729-745 | FSNotesCore/Business/Note.swift:2003-2019 — 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 `FSNotes iOS/View/NotesTableView.swift:729` 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) FSNotesCore/TextFormatter.swift:272— FSNotesCore/TextFormatter.swift:272-288 | FSNotesCore/TextFormatter.swift:364-380 — both copies are in the same file, so extract the 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 `FSNotesCore/TextFormatter.swift:272` 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) FSNotesCore/ViewController+WebApi.swift:38— FSNotesCore/ViewController+WebApi.swift:38-54 | FSNotesCore/ViewController+WebApi.swift:113-129 — both copies are in the same file, so extract the 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 `FSNotesCore/ViewController+WebApi.swift:38` 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.
Swallowed exception (empty catch) FSNotesCore/ImagesProcessor.swift:88— 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) FSNotesCore/Extensions/Project+Git.swift:247— 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) FSNotesCore/Extensions/URL+.swift:121— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Floating branch dependency: libcmark_gfm — Dependency `libcmark_gfm` is resolved in FSNotes.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch `master` rather than a released version — the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit.
Floating branch dependency: shout — Dependency `shout` is resolved in FSNotes.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved against branch `master` rather than a released version — the project pins no immutable point, so resolving the packages again moves this dependency to whatever that branch holds at the time. Change the dependency rule in Xcode to a version requirement, or to an exact commit.
TodoComment FSNotesCore/Git/status/Status.swift:42— // TODO: Unknown status — 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 FSNotes iOS/Helpers/Sidebar.swift:66— // Todo — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
HackComment FSNotes/View/EditTextView.swift:802— // Hack for invalidate prev layout data (order is important, only before fill) — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment FSNotes/Helpers/FileSystemEventManager.swift:113— // hack: occasionally get rename event when created — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
NoteCellView.getPreviewImage (cognitive 17) FSNotes iOS/View/NoteCellView.swift:141— NoteCellView.getPreviewImage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 9). 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.
NoteCellView.getPreviewImage (cognitive 17) FSNotes/View/NoteCellView.swift:257— NoteCellView.getPreviewImage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 9). 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.
Duplicated block (20 lines × 2) FSNotes iOS/ViewController.swift:1417— FSNotes iOS/ViewController.swift:1417-1436 | FSNotes iOS/ViewController.swift:1447-1466 — both copies are in the same file, so extract the 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 `FSNotes iOS/ViewController.swift:1417` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:11— FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:11-30 | FSNotesCore/SwiftHighlighter/Themes/AtomOneLight.swift:11-30 — before extracting anything, compare `FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift` and `FSNotesCore/SwiftHighlighter/Themes/AtomOneLight.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) FSNotesCore/TextFormatter.swift:1154— FSNotesCore/TextFormatter.swift:1154-1168 | FSNotesCore/TextFormatter.swift:1211-1225 — both copies are in the same file, so extract the 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 `FSNotesCore/TextFormatter.swift:1154` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) FSNotesCore/TextFormatter.swift:1194— FSNotesCore/TextFormatter.swift:1194-1208 | FSNotesCore/TextFormatter.swift:1265-1279 — both copies are in the same file, so extract the 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 `FSNotesCore/TextFormatter.swift:1194` 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) FSNotes/View/SidebarOutlineView.swift:134— FSNotes/View/SidebarOutlineView.swift:134-146 | FSNotes/View/SidebarOutlineView.swift:1731-1742 — both copies are in the same file, so extract the 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, `FSNotes/View/SidebarOutlineView.swift:1745` calls `expandItem`, `item` and `FSNotes/View/SidebarOutlineView.swift:148` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) FSNotes/ViewController.swift:953— FSNotes/ViewController.swift:953-964 | FSNotes/ViewController.swift:967-978 — both copies are in the same file, so extract the 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 (11 lines × 3) REDACTED:124— REDACTED:124-134 | REDACTED:137-147 | REDACTED:150-160 — 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:124` 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 × 3) FSNotesCore/SwiftHighlighter/Themes/GitHubDark.swift:11— FSNotesCore/SwiftHighlighter/Themes/GitHubDark.swift:11-21 | FSNotesCore/SwiftHighlighter/Themes/SolarizedDark.swift:11-21 | FSNotesCore/SwiftHighlighter/Themes/SolarizedLight.swift:11-21 — before extracting anything, compare `FSNotesCore/SwiftHighlighter/Themes/GitHubDark.swift` and `FSNotesCore/SwiftHighlighter/Themes/SolarizedDark.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) FSNotes iOS/Preferences/ProViewController.swift:58— FSNotes iOS/Preferences/ProViewController.swift:58-68 | FSNotes iOS/Preferences/SettingsEditorViewController.swift:92-102 — 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 `FSNotes iOS/Preferences/ProViewController.swift:58` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) FSNotes iOS/ViewController+More.swift:719— FSNotes iOS/ViewController+More.swift:719-729 | FSNotes iOS/ViewController+More.swift:796-806 — both copies are in the same file, so extract the 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 `FSNotes iOS/ViewController+More.swift:719` 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) FSNotes/Preferences/PreferencesAdvancedViewController.swift:109— FSNotes/Preferences/PreferencesAdvancedViewController.swift:109-116 | FSNotes/Preferences/PreferencesEditorViewController.swift:173-180 | FSNotes/Preferences/PreferencesGeneralViewController.swift:159-167 — 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.
Duplicated block (8–9 lines × 3) FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:23— FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:23-31 | FSNotesCore/SwiftHighlighter/Themes/AtomOneLight.swift:23-31 | FSNotesCore/SwiftHighlighter/Themes/GitHubDark.swift:46-53 — before extracting anything, compare `FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift` and `FSNotesCore/SwiftHighlighter/Themes/AtomOneLight.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 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 `FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:23` 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.
NotesTextProcessor.highlightMarkdown (cyclomatic 100) FSNotesCore/NotesTextProcessor.swift:337— NotesTextProcessor.highlightMarkdown has cyclomatic complexity 100 (threshold 15). Of this number, 99 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
ViewController.processFileMenuItems (cyclomatic 85) FSNotes/ViewController+Menu.swift:13— ViewController.processFileMenuItems has cyclomatic complexity 85 (threshold 15). Of this number, 83 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ViewController.keyDown (cyclomatic 76) FSNotes/ViewController.swift:665— ViewController.keyDown has cyclomatic complexity 76 (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.
ViewController.openSidebarSettings (cyclomatic 50) FSNotes iOS/ViewController+More.swift:180— ViewController.openSidebarSettings has cyclomatic complexity 50 (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.
EditorViewController.validateMenuItem (cyclomatic 50) REDACTED:65— EditorViewController.validateMenuItem has cyclomatic complexity 50 (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.
SidebarOutlineView.outlineView (cyclomatic 46) FSNotes/View/SidebarOutlineView.swift:154— SidebarOutlineView.outlineView 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.
ViewController.makeSidebarSettingsMenu (cyclomatic 45) FSNotes iOS/ViewController+More.swift:14— ViewController.makeSidebarSettingsMenu has cyclomatic complexity 45 (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.
NotesTableView.makeBulkMenu (cyclomatic 40) FSNotes iOS/View/NotesTableView.swift:267— NotesTableView.makeBulkMenu has cyclomatic complexity 40 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
NotesTableView.actionsSheet (cyclomatic 39) FSNotes iOS/View/NotesTableView.swift:424— NotesTableView.actionsSheet has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EditTextView.touchBar (cyclomatic 33) FSNotes/View/EditTextView.swift:1695— EditTextView.touchBar has cyclomatic complexity 33 (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.
SearchQuery.isFit (cyclomatic 33) FSNotesCore/Business/SearchQuery.swift:60— SearchQuery.isFit has cyclomatic complexity 33 (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.
ViewController.processLibraryMenuItems (cyclomatic 31) FSNotes/ViewController+Menu.swift:256— ViewController.processLibraryMenuItems has cyclomatic complexity 31 (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.
CloudDriveManager.change (cyclomatic 29) FSNotes iOS/Helpers/CloudDriveManager.swift:120— CloudDriveManager.change 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.
EditTextView.keyDown (cyclomatic 29) FSNotes/View/EditTextView.swift:1065— EditTextView.keyDown 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.
SearchTextField.control (cyclomatic 29) FSNotes/View/SearchTextField.swift:130— SearchTextField.control 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.
ViewController.processShareMenuItems (cyclomatic 27) FSNotes/ViewController+Menu.swift:215— ViewController.processShareMenuItems has cyclomatic complexity 27 (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.
EditorViewController.createNote (cyclomatic 26) REDACTED:1463— EditorViewController.createNote 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.
SidebarOutlineView.isAllowedDropIndex (cyclomatic 26) FSNotes/View/SidebarOutlineView.swift:1020— SidebarOutlineView.isAllowedDropIndex has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SidebarOutlineView.outlineViewSelectionDidChange (cyclomatic 25) FSNotes/View/SidebarOutlineView.swift:554— SidebarOutlineView.outlineViewSelectionDidChange 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.
GitViewController.tableView (cyclomatic 24) FSNotes iOS/Preferences/GitViewController.swift:99— GitViewController.tableView 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.
SettingsEditorViewController.switchValueDidChange (cyclomatic 24) FSNotes iOS/Preferences/SettingsEditorViewController.swift:204— SettingsEditorViewController.switchValueDidChange 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.
SettingsViewController.tableView (cyclomatic 24) FSNotes iOS/Preferences/SettingsViewController.swift:194— SettingsViewController.tableView 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.
ProjectSettingsViewController.tableView (cyclomatic 23) FSNotes iOS/Preferences/ProjectSettingsViewController.swift:105— ProjectSettingsViewController.tableView has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileSystemEventManager.start (cyclomatic 22) FSNotes/Helpers/FileSystemEventManager.swift:24— FileSystemEventManager.start 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.
SidebarOutlineView.outlineView (cyclomatic 22) FSNotes/View/SidebarOutlineView.swift:322— SidebarOutlineView.outlineView 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.
TextFormatter.todo (cyclomatic 21) FSNotesCore/TextFormatter.swift:692— TextFormatter.todo 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.
SwiftHighlighter.expandRangeForMultilineConstructs (cyclomatic 21) FSNotesCore/SwiftHighlighter/SwiftHighlighter.swift:448— SwiftHighlighter.expandRangeForMultilineConstructs 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.
EditorViewController.removeNotes (cyclomatic 20) REDACTED:877— EditorViewController.removeNotes 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.
NoteCellView.loadImagesPreview (cyclomatic 20) FSNotesCore/NoteCellView+.swift:18— NoteCellView.loadImagesPreview has cyclomatic complexity 20 (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.
SidebarTableView.tableView (cyclomatic 20) FSNotes iOS/View/SidebarTableView.swift:228— SidebarTableView.tableView 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.
ViewController.buildSearchQuery (cyclomatic 19) FSNotes/ViewController.swift:1466— ViewController.buildSearchQuery 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.
PreferencesWebViewController.test (cyclomatic 19) REDACTED:127— PreferencesWebViewController.test 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.
EditorViewController.tagsHandler (cyclomatic 18) FSNotes iOS/EditorViewController.swift:354— EditorViewController.tagsHandler 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.
EditorViewController.tapHandler (cyclomatic 18) FSNotes iOS/EditorViewController.swift:1146— EditorViewController.tapHandler 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.
ViewController.createNote (cyclomatic 18) FSNotes iOS/ViewController.swift:963— ViewController.createNote 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.
TextFormatter.unTab (cyclomatic 18) FSNotesCore/TextFormatter.swift:290— TextFormatter.unTab 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.
TextFormatter.newLine (cyclomatic 18) FSNotesCore/TextFormatter.swift:585— TextFormatter.newLine 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.
SidebarOutlineView.rename (cyclomatic 18) FSNotes/View/SidebarOutlineView.swift:1861— SidebarOutlineView.rename 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.
Project.fetchAllDirectories (cyclomatic 18) FSNotesCore/Business/Project.swift:820— Project.fetchAllDirectories has cyclomatic complexity 18 (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.
SingleTouchDownGestureRecognizer.touchesBegan (cyclomatic 17) FSNotes iOS/Helpers/SingleTouchDownGestureRecognizer.swift:21— SingleTouchDownGestureRecognizer.touchesBegan 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.
FileSystemEventManager.handleDirEvents (cyclomatic 17) FSNotes/Helpers/FileSystemEventManager.swift:88— FileSystemEventManager.handleDirEvents 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.
EditTextView.mouseMoved (cyclomatic 17) FSNotes/View/EditTextView.swift:457— EditTextView.mouseMoved 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.
SidebarOutlineView.getSidebarProjects (cyclomatic 17) FSNotes/View/SidebarOutlineView.swift:1314— SidebarOutlineView.getSidebarProjects 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.
Note.cleanMetaData (cyclomatic 17) FSNotesCore/Business/Note.swift:824— Note.cleanMetaData 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.
Note.scanContentTags (cyclomatic 17) FSNotesCore/Business/Note.swift:1266— Note.scanContentTags 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.
Storage.sortQuery (cyclomatic 17) FSNotesCore/Business/Storage.swift:543— Storage.sortQuery 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.
EditorViewController.toggleNotesLock (cyclomatic 16) REDACTED:350— EditorViewController.toggleNotesLock 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.
ViewController.restoreOpenedWindows (cyclomatic 16) FSNotes/ViewController.swift:1987— ViewController.restoreOpenedWindows 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.
SettingsEditorViewController.tableView (cyclomatic 16) FSNotes iOS/Preferences/SettingsEditorViewController.swift:92— SettingsEditorViewController.tableView has cyclomatic complexity 16 (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.
SidebarOutlineView.remove (cyclomatic 16) FSNotes/View/SidebarOutlineView.swift:1556— SidebarOutlineView.remove 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.
Storage.getTitles (cyclomatic 16) FSNotesCore/Business/Storage.swift:722— Storage.getTitles 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.
Storage.fetchAllDirectories (cyclomatic 16) FSNotesCore/Business/Storage.swift:817— Storage.fetchAllDirectories has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Storage.checkWelcome (cyclomatic 16) FSNotesCore/Business/Storage.swift:1056— Storage.checkWelcome 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.
ViewController.keyDown (cognitive 135) FSNotes/ViewController.swift:665— ViewController.keyDown has cognitive complexity 135 (threshold 15). Drivers by points: if/else 46 (105 pts), boolean chains 28, match/switch 1 (2 pts) (nesting depth added 60). 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.
NotesTextProcessor.highlightMarkdown (cognitive 122) FSNotesCore/NotesTextProcessor.swift:337— NotesTextProcessor.highlightMarkdown has cognitive complexity 122 (threshold 15). Drivers by points: if/else 88 (106 pts), boolean chains 13, loops 1 (3 pts) (nesting depth added 20). Of this number, 121 points are the body's own statements and 1 belongs 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, 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.
EditorViewController.validateMenuItem (cognitive 117) REDACTED:65— EditorViewController.validateMenuItem has cognitive complexity 117 (threshold 15). Drivers by points: if/else 27 (66 pts), ternaries 10 (39 pts), match/switch 4 (11 pts), boolean chains 1 (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SidebarOutlineView.outlineView (cognitive 86) FSNotes/View/SidebarOutlineView.swift:154— SidebarOutlineView.outlineView has cognitive complexity 86 (threshold 15). Drivers by points: if/else 33 (62 pts), boolean chains 14, loops 4 (10 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViewController.processFileMenuItems (cognitive 85) FSNotes/ViewController+Menu.swift:13— ViewController.processFileMenuItems has cognitive complexity 85 (threshold 15). Drivers by points: boolean chains 45, if/else 22 (39 pts), match/switch 1 (nesting depth added 17). Of this number, 83 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CloudDriveManager.change (cognitive 67) FSNotes iOS/Helpers/CloudDriveManager.swift:120— CloudDriveManager.change has cognitive complexity 67 (threshold 15). Drivers by points: if/else 21 (55 pts), boolean chains 7, ternaries 1 (4 pts), loops 1 (nesting depth added 37). 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.
ViewController.openSidebarSettings (cognitive 65) FSNotes iOS/ViewController+More.swift:180— ViewController.openSidebarSettings has cognitive complexity 65 (threshold 15). Drivers by points: if/else 39 (58 pts), loops 1 (3 pts), boolean chains 2, match/switch 1, ternaries 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.
NotesTableView.actionsSheet (cognitive 56) FSNotes iOS/View/NotesTableView.swift:424— NotesTableView.actionsSheet has cognitive complexity 56 (threshold 15). Drivers by points: if/else 24 (37 pts), boolean chains 11, ternaries 4 (8 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextFormatter.todo (cognitive 52) FSNotesCore/TextFormatter.swift:692— TextFormatter.todo has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (36 pts), loops 3 (7 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 26). 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.
Note.cleanMetaData (cognitive 48) FSNotesCore/Business/Note.swift:824— Note.cleanMetaData has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (42 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SearchTextField.control (cognitive 47) FSNotes/View/SearchTextField.swift:130— SearchTextField.control has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 10, match/switch 1 (nesting depth added 20). 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.
SwiftHighlighter.expandRangeForMultilineConstructs (cognitive 47) FSNotesCore/SwiftHighlighter/SwiftHighlighter.swift:448— SwiftHighlighter.expandRangeForMultilineConstructs has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (30 pts), loops 3 (7 pts), boolean chains 5, ternaries 1 (5 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SettingsEditorViewController.switchValueDidChange (cognitive 43) FSNotes iOS/Preferences/SettingsEditorViewController.swift:204— SettingsEditorViewController.switchValueDidChange has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 3 (6 pts), ternaries 2 (6 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditTextView.keyDown (cognitive 39) FSNotes/View/EditTextView.swift:1065— EditTextView.keyDown has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 12 (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.
Note.parseURL (cognitive 38) FSNotesCore/Business/Note.swift:912— Note.parseURL has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (34 pts), error handling 1 (4 pts) (nesting depth added 28). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SwiftHighlighter.processLanguage (cognitive 36) FSNotesCore/SwiftHighlighter/SwiftHighlighter.swift:230— SwiftHighlighter.processLanguage has cognitive complexity 36 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 5 (13 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectSettingsViewController.tableView (cognitive 35) FSNotes iOS/Preferences/ProjectSettingsViewController.swift:105— ProjectSettingsViewController.tableView has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 3 (6 pts), boolean chains 4 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditTextView.touchBar (cognitive 34) FSNotes/View/EditTextView.swift:1695— EditTextView.touchBar has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 16, match/switch 1 (nesting depth added 8). 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.
SidebarOutlineView.remove (cognitive 33) FSNotes/View/SidebarOutlineView.swift:1556— SidebarOutlineView.remove has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ViewController.processLibraryMenuItems (cognitive 32) FSNotes/ViewController+Menu.swift:256— ViewController.processLibraryMenuItems has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 17, if/else 10 (14 pts), match/switch 1 (nesting depth added 4). 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.
ViewController.ubiquitousKeyValueStoreDidChange (cognitive 32) FSNotes/ViewController.swift:1769— ViewController.ubiquitousKeyValueStoreDidChange has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 2 (8 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CloudDriveManager.loadEncryptionStatus (cognitive 32) FSNotes iOS/Helpers/CloudDriveManager.swift:383— CloudDriveManager.loadEncryptionStatus has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (30 pts), boolean chains 2 (nesting depth added 19). 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.
EditTextView.detectCodeBlockLanguageInput (cognitive 32) FSNotes/View/EditTextView+Complete.swift:91— EditTextView.detectCodeBlockLanguageInput has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (24 pts), loops 2 (6 pts), boolean chains 2 (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.
NotesTableView.makeBulkMenu (cognitive 32) FSNotes iOS/View/NotesTableView.swift:267— NotesTableView.makeBulkMenu has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 9, ternaries 4, match/switch 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.
SearchQuery.isFit (cognitive 32) FSNotesCore/Business/SearchQuery.swift:60— SearchQuery.isFit has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 32. 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.
Note.removeFile (cognitive 31) FSNotesCore/Business/Note.swift:517— Note.removeFile has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 4, loops 1 (4 pts) (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.
Note.scanContentTags (cognitive 31) FSNotesCore/Business/Note.swift:1266— Note.scanContentTags has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 3 (5 pts), boolean chains 2, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileSystemEventManager.handleDirEvents (cognitive 30) FSNotes/Helpers/FileSystemEventManager.swift:88— FileSystemEventManager.handleDirEvents has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 2 (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.
EditorViewController.createNote (cognitive 29) REDACTED:1463— EditorViewController.createNote has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 8 (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.
TextFormatter.orderedList (cognitive 29) FSNotesCore/TextFormatter.swift:1210— TextFormatter.orderedList has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 15). 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.
SingleTouchDownGestureRecognizer.touchesBegan (cognitive 29) FSNotes iOS/Helpers/SingleTouchDownGestureRecognizer.swift:21— SingleTouchDownGestureRecognizer.touchesBegan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 7, loops 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.
GitViewController.tableView (cognitive 29) FSNotes iOS/Preferences/GitViewController.swift:99— GitViewController.tableView has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 11 (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.
FileSystemEventManager.resolveConflict (cognitive 29) FSNotes/Helpers/FileSystemEventManager.swift:327— FileSystemEventManager.resolveConflict has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (5 pts), error handling 1 (3 pts), boolean chains 2 (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.
NoteCellView.fixTopConstraint (cognitive 29) FSNotes/View/NoteCellView.swift:326— NoteCellView.fixTopConstraint has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 4 (12 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SidebarOutlineView.outlineView (cognitive 29) FSNotes/View/SidebarOutlineView.swift:322— SidebarOutlineView.outlineView has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 4, ternaries 1 (2 pts), 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.
PreferencesWebViewController.test (cognitive 28) REDACTED:127— PreferencesWebViewController.test has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (6 pts), boolean chains 4, 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.
SidebarOutlineView.outlineViewSelectionDidChange (cognitive 28) FSNotes/View/SidebarOutlineView.swift:554— SidebarOutlineView.outlineViewSelectionDidChange has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 9 (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.
ViewController.processShareMenuItems (cognitive 27) FSNotes/ViewController+Menu.swift:215— ViewController.processShareMenuItems has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 19, if/else 5 (7 pts), match/switch 1 (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.
TextFormatter.newLine (cognitive 27) FSNotesCore/TextFormatter.swift:585— TextFormatter.newLine has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 3 (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.
EditorViewController.tapHandler (cognitive 26) FSNotes iOS/EditorViewController.swift:1146— EditorViewController.tapHandler has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViewController.ubiquitousKeyValueStoreDidChange (cognitive 26) FSNotes iOS/ViewController.swift:675— ViewController.ubiquitousKeyValueStoreDidChange has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 1 (2 pts) (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ViewController.makeSidebarSettingsMenu (cognitive 26) FSNotes iOS/ViewController+More.swift:14— ViewController.makeSidebarSettingsMenu has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20 (22 pts), match/switch 3, boolean chains 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, 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.
ViewController.buildSearchQuery (cognitive 26) FSNotes/ViewController.swift:1466— ViewController.buildSearchQuery has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 7, loops 1 (2 pts), ternaries 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.
MPreviewView.loadAttachments (cognitive 26) FSNotesCore/MPreviewView.swift:163— MPreviewView.loadAttachments has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 3, loops 1 (2 pts), 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.
TextFormatter.unTab (cognitive 26) FSNotesCore/TextFormatter.swift:290— TextFormatter.unTab has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 2, ternaries 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.
SFTPUploader.upload (cognitive 26) FSNotes iOS/Helpers/SFTPUploader.swift:47— SFTPUploader.upload has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SidebarOutlineView.isAllowedDropIndex (cognitive 26) FSNotes/View/SidebarOutlineView.swift:1020— SidebarOutlineView.isAllowedDropIndex has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 17, if/else 9. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SwiftHighlighter.processMode (cognitive 26) FSNotesCore/SwiftHighlighter/SwiftHighlighter.swift:273— SwiftHighlighter.processMode has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 3, loops 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.
EditorViewController.tagsHandler (cognitive 25) FSNotes iOS/EditorViewController.swift:354— EditorViewController.tagsHandler has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 6 (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.
EditorViewController.removeNotes (cognitive 25) REDACTED:877— EditorViewController.removeNotes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 7, 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.
ProjectSettingsViewController.tableView (cognitive 25) FSNotes iOS/Preferences/ProjectSettingsViewController.swift:43— ProjectSettingsViewController.tableView has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 2 (6 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.
SettingsViewController.tableView (cognitive 25) FSNotes iOS/Preferences/SettingsViewController.swift:194— SettingsViewController.tableView has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), match/switch 3 (6 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.
SidebarOutlineView.rename (cognitive 25) FSNotes/View/SidebarOutlineView.swift:1861— SidebarOutlineView.rename has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 7 (10 pts), boolean chains 3, ternaries 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViewController.restoreOpenedWindows (cognitive 24) FSNotes/ViewController.swift:1987— ViewController.restoreOpenedWindows has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 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.
CloudDriveManager.resolveConflict (cognitive 24) FSNotes iOS/Helpers/CloudDriveManager.swift:438— CloudDriveManager.resolveConflict has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (17 pts), error handling 1 (3 pts), boolean chains 2, 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.
SidebarOutlineView.getSidebarProjects (cognitive 24) FSNotes/View/SidebarOutlineView.swift:1314— SidebarOutlineView.getSidebarProjects has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 6, loops 4 (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.
ViewController.createNote (cognitive 23) FSNotes iOS/ViewController.swift:963— ViewController.createNote has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 5 (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.
ViewController.configureSidebar (cognitive 23) FSNotes/ViewController.swift:392— ViewController.configureSidebar has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 3 (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.
MPreviewView.loadImages (cognitive 23) FSNotesCore/MPreviewView.swift:413— MPreviewView.loadImages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotesTextProcessor.convertAppTags (cognitive 23) FSNotesCore/NotesTextProcessor.swift:217— NotesTextProcessor.convertAppTags has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 1 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextFormatter.list (cognitive 23) FSNotesCore/TextFormatter.swift:1153— TextFormatter.list has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (4 pts), boolean chains 2, 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.
DefaultExtensionViewController.tableView (cognitive 23) FSNotes iOS/Preferences/DefaultExtensionControllerView.swift:54— DefaultExtensionViewController.tableView has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (6 pts), boolean chains 2 (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.
Storage.sortQuery (cognitive 23) FSNotesCore/Business/Storage.swift:543— Storage.sortQuery has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 8, ternaries 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NSTextStorage.addTabStops (cognitive 23) FSNotesCore/NSTextStorage++.swift:80— NSTextStorage.addTabStops has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (6 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.
EditorViewController.uploadWebNote (cognitive 22) FSNotes/ViewController+Web.swift:49— EditorViewController.uploadWebNote has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 1 (2 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectSettingsViewController.switchValueDidChange (cognitive 22) FSNotes iOS/Preferences/ProjectSettingsViewController.swift:205— ProjectSettingsViewController.switchValueDidChange has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileSystemEventManager.start (cognitive 22) FSNotes/Helpers/FileSystemEventManager.swift:24— FileSystemEventManager.start has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 9 (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.
NoteCellView.renderPin (cognitive 22) FSNotes/View/NoteCellView.swift:210— NoteCellView.renderPin has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HtmlExtractor.swift.cleanHTMLString (cognitive 22) FSNotesCore/HtmlExtractor.swift:35— HtmlExtractor.swift.cleanHTMLString has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). 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.
ViewController.buildSearchQuery (cognitive 21) FSNotes iOS/ViewController.swift:1562— ViewController.buildSearchQuery has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NotesTextProcessor.convertAppLinks (cognitive 21) FSNotesCore/NotesTextProcessor.swift:170— NotesTextProcessor.convertAppLinks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (4 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.
SidebarTableView.tableView (cognitive 21) FSNotes iOS/View/SidebarTableView.swift:228— SidebarTableView.tableView has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 7. 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.
FileSystemEventManager.reloadNote (cognitive 21) FSNotes/Helpers/FileSystemEventManager.swift:243— FileSystemEventManager.reloadNote has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SidebarOutlineView.remove (cognitive 21) FSNotes/View/SidebarOutlineView.swift:1825— SidebarOutlineView.remove has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (5 pts), boolean chains 1 (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.
Note.getCommits (cognitive 21) FSNotesCore/Note+History.swift:131— Note.getCommits has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), error handling 2 (3 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Project.fetchAllDirectories (cognitive 21) FSNotesCore/Business/Project.swift:820— Project.fetchAllDirectories has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 12, if/else 3 (6 pts), error handling 1 (2 pts), loops 1 (nesting depth added 4). 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.
Storage.checkWelcome (cognitive 21) FSNotesCore/Business/Storage.swift:1056— Storage.checkWelcome has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 2, loops 1 (2 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.
SceneDelegate.handle (cognitive 20) FSNotes iOS/SceneDelegate.swift:99— SceneDelegate.handle has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorViewController.toggleNotesLock (cognitive 20) REDACTED:350— EditorViewController.toggleNotesLock has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextFormatter.toggleTodo (cognitive 20) FSNotesCore/TextFormatter.swift:807— TextFormatter.toggleTodo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CloudDriveManager.added (cognitive 20) FSNotes iOS/Helpers/CloudDriveManager.swift:297— CloudDriveManager.added has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 1 (3 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.
SettingsEditorViewController.tableView (cognitive 20) FSNotes iOS/Preferences/SettingsEditorViewController.swift:92— SettingsEditorViewController.tableView has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 4 (8 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.
EditTextView.mouseMoved (cognitive 20) FSNotes/View/EditTextView.swift:457— EditTextView.mouseMoved has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7 (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.
SearchTextField.search (cognitive 20) FSNotes/View/SearchTextField.swift:272— SearchTextField.search has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 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.
SidebarOutlineView.keyDown (cognitive 20) FSNotes/View/SidebarOutlineView.swift:78— SidebarOutlineView.keyDown has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 7 (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.
SidebarOutlineView.delete (cognitive 20) FSNotes/View/SidebarOutlineView.swift:764— SidebarOutlineView.delete has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 1 (3 pts), boolean chains 1, loops 1 (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.
ViewController.updateTableViews (cognitive 19) FSNotes/ViewController.swift:1272— ViewController.updateTableViews has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextStorageProcessor.process (cognitive 19) FSNotesCore/TextStorageProcessor.swift:51— TextStorageProcessor.process has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SingleTouchDownGestureRecognizer.touchesEnded (cognitive 19) FSNotes iOS/Helpers/SingleTouchDownGestureRecognizer.swift:162— SingleTouchDownGestureRecognizer.touchesEnded has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NoteCellView.loadImagesPreview (cognitive 19) FSNotesCore/NoteCellView+.swift:18— NoteCellView.loadImagesPreview has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 9, loops 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Note.move (cognitive 19) FSNotesCore/Business/Note.swift:635— Note.move has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (3 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Note.moveFilesAssetsToFlat (cognitive 19) FSNotesCore/Business/Note.swift:1607— Note.moveFilesAssetsToFlat has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Note.getNonEmptyLines (cognitive 19) FSNotesCore/Business/Note+Preview.swift:42— Note.getNonEmptyLines has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Storage.getTitles (cognitive 19) FSNotesCore/Business/Storage.swift:722— Storage.getTitles has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (8 pts), ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Storage.fetchAllDirectories (cognitive 19) FSNotesCore/Business/Storage.swift:817— Storage.fetchAllDirectories has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 3 (6 pts), error handling 1 (2 pts), loops 1 (nesting depth added 4). 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.
EditorViewController.getMasterPassword (cognitive 18) REDACTED:1166— EditorViewController.getMasterPassword has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (4 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.
EditTextView.handleURLs (cognitive 18) FSNotes/View/EditTextView+DragOperation.swift:69— EditTextView.handleURLs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 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.
PreferencesAdvancedViewController.viewDidAppear (cognitive 18) FSNotes/Preferences/PreferencesAdvancedViewController.swift:34— PreferencesAdvancedViewController.viewDidAppear has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, ternaries 1 (3 pts), loops 1, match/switch 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.
EditTextView.copy (cognitive 18) FSNotes/View/EditTextView.swift:605— EditTextView.copy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NoteCellView.applyPreviewStyle (cognitive 18) FSNotes/View/NoteCellView.swift:106— NoteCellView.applyPreviewStyle has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 1 (2 pts), ternaries 1 (2 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.
SidebarOutlineView.outlineView (cognitive 18) FSNotes/View/SidebarOutlineView.swift:454— SidebarOutlineView.outlineView has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 1 (2 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.
Storage.sortNotes (cognitive 18) FSNotesCore/Business/Storage.swift:495— Storage.sortNotes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7 (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.
Storage.fetchBookmarkUrls (cognitive 18) FSNotesCore/Business/Storage.swift:1173— Storage.fetchBookmarkUrls has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextFormatter.bold (cognitive 17) FSNotesCore/TextFormatter.swift:79— TextFormatter.bold has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 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. This shape REPEATS in the file: one other method here (TextFormatter.italic) 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.
TextFormatter.italic (cognitive 17) FSNotesCore/TextFormatter.swift:122— TextFormatter.italic has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 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. This shape REPEATS in the file: one other method here (TextFormatter.bold) 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.
CloudDriveManager.remove (cognitive 17) FSNotes iOS/Helpers/CloudDriveManager.swift:342— CloudDriveManager.remove has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), 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.
Note.write (cognitive 17) FSNotesCore/Business/Note.swift:1045— Note.write has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Reference.updateTargetCommit (cognitive 17) FSNotesCore/Git/reference/Reference+Target.swift:59— Reference.updateTargetCommit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 2 (6 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.
Markdown.swift.replaceHorizontalRulesOutsideCodeBlocks (cognitive 17) FSNotesCore/Business/Markdown.swift:12— Markdown.swift.replaceHorizontalRulesOutsideCodeBlocks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, 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.
EditorViewController.isBetweenBraces (cognitive 16) FSNotes iOS/EditorViewController.swift:472— EditorViewController.isBetweenBraces has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditorViewController.makeFullSnapshot (cognitive 16) FSNotes/ViewController+Git.swift:113— EditorViewController.makeFullSnapshot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, error handling 1 (2 pts), 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.
EditorViewController.getSSHResource (cognitive 16) FSNotes/ViewController+Web.swift:141— EditorViewController.getSSHResource has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 1 (2 pts), error handling 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.
EditorViewController.togglePreview (cognitive 16) REDACTED:470— EditorViewController.togglePreview has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ViewController.move (cognitive 16) FSNotes/ViewController.swift:610— ViewController.move has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 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.
TextFormatter.hasPrefix (cognitive 16) FSNotesCore/TextFormatter.swift:1344— TextFormatter.hasPrefix has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SandboxBookmark.load (cognitive 16) FSNotes iOS/Helpers/SandboxBookmark.swift:27— SandboxBookmark.load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 1 (3 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Storage.restoreCloudPins (cognitive 16) FSNotesCore/Business/Storage.swift:937— Storage.restoreCloudPins has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 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.
NSTextStorage.highlightKeyword (cognitive 16) FSNotesCore/NSTextStorage++.swift:188— NSTextStorage.highlightKeyword has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, loops 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
index.html.loadCodeActions (cognitive 16) Resources/MPreview.bundle/index.html:166— index.html.loadCodeActions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 188, 201, 176, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D4 · Code Duplication· Near-duplicate member family (5 members, 14 shared lines) · ×1
Near-duplicate member family (5 members, 14 shared lines) FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:10— FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:10-77 | FSNotesCore/SwiftHighlighter/Themes/AtomOneLight.swift:10-78 | FSNotesCore/SwiftHighlighter/Themes/GitHubDark.swift:10-95 | FSNotesCore/SwiftHighlighter/Themes/SolarizedDark.swift:10-71 | FSNotesCore/SwiftHighlighter/Themes/SolarizedLight.swift:10-66 — These 5 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Near-duplicate member pair (60 shared lines) FSNotes iOS/View/NotesTableView.swift:424— FSNotes iOS/View/NotesTableView.swift:424-601 | FSNotes iOS/ViewController+More.swift:180-436 — These two members are variants of one another: 60 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (42 shared lines) FSNotes iOS/MoveViewController.swift:113— FSNotes iOS/MoveViewController.swift:113-163 | FSNotes iOS/Preferences/ProjectsViewController.swift:106-154 — These two members are variants of one another: 42 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 (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) FSNotesCore/Business/LanguageType.swift:42— FSNotesCore/Business/LanguageType.swift:42-65 | FSNotesCore/Business/LanguageType.swift:67-90 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (12 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (12 members, 50+ identical tokens) FSNotes iOS/Extensions/UIColor+.swift:14— FSNotes iOS/Extensions/UIColor+.swift:14-20 | FSNotes iOS/Extensions/UIColor+.swift:22-28 | FSNotes iOS/Extensions/UIColor+.swift:30-36 | FSNotes iOS/Extensions/UIColor+.swift:38-44 | FSNotes iOS/Extensions/UIColor+.swift:46-52 | FSNotes iOS/Extensions/UIColor+.swift:55-61 | FSNotes iOS/Extensions/UIColor+.swift:63-69 | FSNotes iOS/Extensions/UIColor+.swift:71-77 | FSNotes iOS/Extensions/UIColor+.swift:79-85 | FSNotes iOS/Extensions/UIColor+.swift:87-93 | FSNotes iOS/Extensions/UIColor+.swift:95-101 | FSNotes iOS/Extensions/UIColor+.swift:103-109 — These 12 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 12 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 12 times.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (4 members, 50+ identical tokens) FSNotes/Extensions/UserDefaultsManagement+.swift:44— FSNotes/Extensions/UserDefaultsManagement+.swift:44-58 | FSNotes/Extensions/UserDefaultsManagement+.swift:69-83 | FSNotes/Extensions/UserDefaultsManagement+.swift:94-108 | FSNotes/Extensions/UserDefaultsManagement+.swift:119-133 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (29–32 lines × 2) FSNotesCore/NotesTextProcessor.swift:539— FSNotesCore/NotesTextProcessor.swift:539-567 | FSNotesCore/NotesTextProcessor.swift:608-639 — both copies are in the same file, so extract the 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 `FSNotesCore/NotesTextProcessor.swift:539` 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 (31 lines × 2) FSNotes iOS/Helpers/CloudDriveManager.swift:438— FSNotes iOS/Helpers/CloudDriveManager.swift:438-468 | FSNotes/Helpers/FileSystemEventManager.swift:327-357 — 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 `FSNotes iOS/Helpers/CloudDriveManager.swift:438` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29–31 lines × 2) FSNotes iOS/View/NotesTableView.swift:1182— FSNotes iOS/View/NotesTableView.swift:1182-1210 | FSNotes iOS/View/NotesTableView.swift:1213-1243 — both copies are in the same file, so extract the 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 (27–29 lines × 2) FSNotes iOS/MoveViewController.swift:135— FSNotes iOS/MoveViewController.swift:135-163 | FSNotes iOS/Preferences/ProjectsViewController.swift:128-154 — before extracting anything, compare `FSNotes iOS/MoveViewController.swift` and `FSNotes iOS/Preferences/ProjectsViewController.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 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 `FSNotes iOS/MoveViewController.swift:135` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27 lines × 2) FSNotesCore/NotesTextProcessor.swift:189— FSNotesCore/NotesTextProcessor.swift:189-215 | FSNotesCore/NotesTextProcessor.swift:241-267 — both copies are in the same file, so extract the 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 `FSNotesCore/NotesTextProcessor.swift:189` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–26 lines × 2) FSNotes/View/MPreviewContainerView.swift:282— FSNotes/View/MPreviewContainerView.swift:282-307 | FSNotes/View/MPreviewContainerView.swift:331-339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `FSNotes/View/MPreviewContainerView.swift:282` 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 (24 lines × 2) FSNotesCore/FSParser.swift:133— FSNotesCore/FSParser.swift:133-156 | FSNotesCore/NotesTextProcessor.swift:1340-1363 — 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 (21–22 lines × 2) FSNotes iOS/View/SidebarTableView.swift:73— FSNotes iOS/View/SidebarTableView.swift:73-94 | FSNotes iOS/View/SidebarTableView.swift:121-141 — both copies are in the same file, so extract the 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 `FSNotes iOS/View/SidebarTableView.swift:73` 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 (19–21 lines × 2) FSNotes/View/EditTextView+MoveLines.swift:51— FSNotes/View/EditTextView+MoveLines.swift:51-71 | FSNotes/View/EditTextView+MoveLines.swift:118-136 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: `FSNotes/View/EditTextView+MoveLines.swift:51` is reached only past a guard at line 19 that tests `lineRange.location` and leaves the function early, and `FSNotes/View/EditTextView+MoveLines.swift:118` reads `lineRange.location` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
Duplicated block (13–19 lines × 2) FSNotes iOS/Helpers/Sidebar.swift:84— FSNotes iOS/Helpers/Sidebar.swift:84-102 | FSNotes/Helpers/Sidebar.swift:63-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 `FSNotes iOS/Helpers/Sidebar.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. 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 (16 lines × 2) FSNotesCore/Business/AttributedBox.swift:46— FSNotesCore/Business/AttributedBox.swift:46-61 | FSNotesCore/Business/AttributedBox.swift:71-86 — both copies are in the same file, so extract the 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 `FSNotesCore/Business/AttributedBox.swift:46` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14–15 lines × 3) FSNotesCore/Git/branch/Branches.swift:67— FSNotesCore/Git/branch/Branches.swift:67-81 | FSNotesCore/Git/remote/Remotes.swift:61-74 | FSNotesCore/Git/repository/Repository+Lookup.swift:28-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (14 lines × 3) FSNotes iOS/EditorViewController.swift:1271— FSNotes iOS/EditorViewController.swift:1271-1284 | FSNotes iOS/View/EditTextView.swift:287-300 | FSNotes/View/EditTextView.swift:544-557 — 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 `FSNotes iOS/EditorViewController.swift:1271` 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 (13–14 lines × 2) FSNotes iOS/Helpers/CloudDriveManager.swift:480— FSNotes iOS/Helpers/CloudDriveManager.swift:480-493 | FSNotes/Helpers/FileSystemEventManager.swift:373-385 — 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 `FSNotes iOS/Helpers/CloudDriveManager.swift:480` 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 (12–14 lines × 2) FSNotes iOS/View/NoteCellView.swift:184— FSNotes iOS/View/NoteCellView.swift:184-195 | FSNotes/View/NoteCellView.swift:350-363 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) FSNotesCore/Business/Project.swift:845— FSNotesCore/Business/Project.swift:845-858 | FSNotesCore/Business/Storage.swift:845-858 — 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 `FSNotesCore/Business/Project.swift:845` 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–12 lines × 2) FSNotes iOS/Preferences/ExternalViewController.swift:13— FSNotes iOS/Preferences/ExternalViewController.swift:13-22 | FSNotes iOS/Preferences/ProjectsViewController.swift:204-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 `FSNotes iOS/Preferences/ExternalViewController.swift:13` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 4) FSNotes/Extensions/UserDefaultsManagement+.swift:48— FSNotes/Extensions/UserDefaultsManagement+.swift:48-58 | FSNotes/Extensions/UserDefaultsManagement+.swift:73-83 | FSNotes/Extensions/UserDefaultsManagement+.swift:98-108 | FSNotes/Extensions/UserDefaultsManagement+.swift:123-133 — 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 `FSNotes/Extensions/UserDefaultsManagement+.swift:48` 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 (8–11 lines × 2) FSNotes iOS/View/NotesTableView.swift:475— FSNotes iOS/View/NotesTableView.swift:475-482 | FSNotes iOS/View/NotesTableView.swift:517-527 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `FSNotes iOS/View/NotesTableView.swift:475` 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 (5–10 lines × 9) FSNotes/View/EditTextView.swift:1698— FSNotes/View/EditTextView.swift:1698-1702 | FSNotes/View/EditTextView.swift:1703-1711 | FSNotes/View/EditTextView.swift:1714-1722 | FSNotes/View/EditTextView.swift:1725-1733 | FSNotes/View/EditTextView.swift:1736-1745 | FSNotes/View/EditTextView.swift:1748-1757 | FSNotes/View/EditTextView.swift:1760-1768 | FSNotes/View/EditTextView.swift:1771-1779 | FSNotes/View/EditTextView.swift:1781-1787 — all 9 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 `FSNotes/View/EditTextView.swift:1698` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `FSNotes/View/EditTextView.swift:1711` calls `tint`, `NSSize` and `FSNotes/View/EditTextView.swift:1702` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–10 lines × 2) FSNotes iOS/EditorViewController.swift:426— FSNotes iOS/EditorViewController.swift:426-433 | FSNotes iOS/EditorViewController.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.
Duplicated block (3–10 lines × 3) FSNotesCore/Business/Note.swift:1397— FSNotesCore/Business/Note.swift:1397-1406 | FSNotesCore/NameHelper.swift:34-36 | FSNotesCore/NameHelper.swift:65-74 — 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 `FSNotesCore/NameHelper.swift:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 3) FSNotes/Helpers/Sidebar.swift:26— FSNotes/Helpers/Sidebar.swift:26-34 | FSNotes/Helpers/Sidebar.swift:49-59 | FSNotes/Helpers/Sidebar.swift:67-75 — 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. 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 × 5) FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:10— FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:10-20 | FSNotesCore/SwiftHighlighter/Themes/AtomOneLight.swift:10-20 | FSNotesCore/SwiftHighlighter/Themes/GitHubDark.swift:10-17 | FSNotesCore/SwiftHighlighter/Themes/SolarizedDark.swift:10-17 | FSNotesCore/SwiftHighlighter/Themes/SolarizedLight.swift:10-17 — before extracting anything, compare `FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift` and `FSNotesCore/SwiftHighlighter/Themes/AtomOneLight.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 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 `FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:10` 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 × 4) FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:70— FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:70-77 | FSNotesCore/SwiftHighlighter/Themes/AtomOneLight.swift:70-78 | FSNotesCore/SwiftHighlighter/Themes/SolarizedDark.swift:63-71 | FSNotesCore/SwiftHighlighter/Themes/SolarizedLight.swift:58-66 — before extracting anything, compare `FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift` and `FSNotesCore/SwiftHighlighter/Themes/AtomOneLight.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 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 `FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:70` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (7–8 lines × 2) FSNotesCore/NotesTextProcessor.swift:522— FSNotesCore/NotesTextProcessor.swift:522-528 | FSNotesCore/NotesTextProcessor.swift:571-578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `FSNotesCore/NotesTextProcessor.swift:522` 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 × 14) FSNotes iOS/View/NotesTableView.swift:445— FSNotes iOS/View/NotesTableView.swift:445-451 | FSNotes iOS/ViewController+More.swift:251-257 | FSNotes iOS/ViewController+More.swift:263-269 | FSNotes iOS/ViewController+More.swift:275-283 | FSNotes iOS/ViewController+More.swift:289-295 | FSNotes iOS/ViewController+More.swift:313-319 | FSNotes iOS/ViewController+More.swift:325-331 | FSNotes iOS/ViewController+More.swift:337-343 | FSNotes iOS/ViewController+More.swift:349-355 | FSNotes iOS/ViewController+More.swift:361-367 | FSNotes iOS/ViewController+More.swift:373-379 | FSNotes iOS/ViewController+More.swift:385-391 | FSNotes iOS/ViewController+More.swift:397-403 | FSNotes iOS/ViewController+More.swift:409-415 — there are 14 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 14 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `FSNotes iOS/View/NotesTableView.swift:445` 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 × 12) FSNotes iOS/Extensions/UIColor+.swift:14— FSNotes iOS/Extensions/UIColor+.swift:14-20 | FSNotes iOS/Extensions/UIColor+.swift:22-28 | FSNotes iOS/Extensions/UIColor+.swift:30-36 | FSNotes iOS/Extensions/UIColor+.swift:38-44 | FSNotes iOS/Extensions/UIColor+.swift:46-52 | FSNotes iOS/Extensions/UIColor+.swift:55-61 | FSNotes iOS/Extensions/UIColor+.swift:63-69 | FSNotes iOS/Extensions/UIColor+.swift:71-77 | FSNotes iOS/Extensions/UIColor+.swift:79-85 | FSNotes iOS/Extensions/UIColor+.swift:87-93 | FSNotes iOS/Extensions/UIColor+.swift:95-101 | FSNotes iOS/Extensions/UIColor+.swift:103-109 — all 12 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `blue` to `0.90` in one and `0.11` 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 (7 lines × 9) FSNotes iOS/ViewController+More.swift:251— FSNotes iOS/ViewController+More.swift:251-257 | FSNotes iOS/ViewController+More.swift:275-283 | FSNotes iOS/ViewController+More.swift:325-331 | FSNotes iOS/ViewController+More.swift:337-343 | FSNotes iOS/ViewController+More.swift:373-379 | FSNotes iOS/ViewController+More.swift:385-391 | FSNotes iOS/ViewController+More.swift:397-403 | FSNotes iOS/ViewController+More.swift:409-415 | FSNotes iOS/ViewController+More.swift:421-427 — all 9 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 `FSNotes iOS/ViewController+More.swift:251` 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 × 5) FSNotes iOS/View/NotesTableView.swift:552— FSNotes iOS/View/NotesTableView.swift:552-560 | FSNotes iOS/View/NotesTableView.swift:578-586 | FSNotes iOS/ViewController+More.swift:289-295 | FSNotes iOS/ViewController+More.swift:349-355 | FSNotes iOS/ViewController+More.swift:361-367 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `FSNotes iOS/View/NotesTableView.swift:552` 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 × 3) FSNotes iOS/View/NotesTableView.swift:456— FSNotes iOS/View/NotesTableView.swift:456-462 | FSNotes iOS/View/NotesTableView.swift:578-586 | FSNotes iOS/ViewController+More.swift:421-427 — 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 `FSNotes iOS/View/NotesTableView.swift:456` 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–7 lines × 2) FSNotes iOS/ViewController+More.swift:681— FSNotes iOS/ViewController+More.swift:681-686 | FSNotes iOS/ViewController+More.swift:761-767 — both copies are in the same file, so extract the 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 `FSNotes iOS/ViewController+More.swift:681` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 9) FSNotes iOS/View/NotesTableView.swift:466— FSNotes iOS/View/NotesTableView.swift:466-471 | FSNotes iOS/View/NotesTableView.swift:475-480 | FSNotes iOS/View/NotesTableView.swift:485-492 | FSNotes iOS/View/NotesTableView.swift:517-524 | FSNotes iOS/View/NotesTableView.swift:552-559 | FSNotes iOS/View/NotesTableView.swift:578-585 | FSNotes iOS/ViewController+More.swift:289-294 | FSNotes iOS/ViewController+More.swift:349-354 | FSNotes iOS/ViewController+More.swift:361-366 — there are 9 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 9 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `FSNotes iOS/View/NotesTableView.swift:466` 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–6 lines × 7) FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:66— FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift:66-71 | FSNotesCore/SwiftHighlighter/Themes/AtomOneLight.swift:66-71 | FSNotesCore/SwiftHighlighter/Themes/GitHubDark.swift:43-49 | FSNotesCore/SwiftHighlighter/Themes/GitHubDark.swift:56-60 | FSNotesCore/SwiftHighlighter/Themes/GitHubDark.swift:62-71 | FSNotesCore/SwiftHighlighter/Themes/SolarizedDark.swift:54-64 | FSNotesCore/SwiftHighlighter/Themes/SolarizedLight.swift:54-59 — before extracting anything, compare `FSNotesCore/SwiftHighlighter/Themes/AtomOneDark.swift` and `FSNotesCore/SwiftHighlighter/Themes/AtomOneLight.swift` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 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 `FSNotesCore/SwiftHighlighter/Themes/GitHubDark.swift:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `FSNotesCore/SwiftHighlighter/Themes/GitHubDark.swift:60` calls `PlatformColor` and `FSNotesCore/SwiftHighlighter/Themes/GitHubDark.swift:49` 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 × 3) FSNotesCore/NotesTextProcessor.swift:557— FSNotesCore/NotesTextProcessor.swift:557-562 | FSNotesCore/NotesTextProcessor.swift:629-634 | FSNotesCore/NotesTextProcessor.swift:643-648 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) FSNotesCore/Business/Note.swift:841— FSNotesCore/Business/Note.swift:841-845 | FSNotesCore/Business/Note.swift:850-854 | FSNotesCore/Business/Note.swift:859-863 — 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 `FSNotesCore/Business/Note.swift:841` 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 (2–5 lines × 3) FSNotes iOS/MoveViewController.swift:52— FSNotes iOS/MoveViewController.swift:52-53 | FSNotes iOS/MoveViewController.swift:127-131 | FSNotes iOS/Preferences/ProjectsViewController.swift:120-124 — before extracting anything, compare `FSNotes iOS/MoveViewController.swift` and `FSNotes iOS/Preferences/ProjectsViewController.swift` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 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 `FSNotes iOS/MoveViewController.swift:127` 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. 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 predicate FSNotes/View/NoteCellView.swift:97— `!UserDefaultsManagement.horizontalOrientation && !UserDefaultsManagement.hidePreviewImages` appears character-identically in 2 files — FSNotes/View/NoteCellView.swift, FSNotes/View/NotesTableView.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 FSNotes iOS/View/NotesTableView.swift:81— `!note.isLoaded && !note.isLoadedFromCache` appears character-identically in 2 files — FSNotes iOS/View/NotesTableView.swift, FSNotes/View/NotesTableView.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 FSNotesCore/Business/Note.swift:2238— `FileManager.default.fileExists(atPath: destination.path) || FileManager.default.fileExists(atPath: icloud.path)` appears character-identically in 2 files — FSNotesCore/Business/Note.swift, FSNotesCore/ImagesProcessor.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 FSNotes iOS/ViewController.swift:1582— `item.type == .All || item.type == .Untagged || item.type == .Todo || item.type == .Trash || item.type == .Inbox` appears character-identically in 2 files — FSNotes iOS/ViewController.swift, FSNotes/ViewController.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 FSNotes iOS/EditorViewController.swift:1278— `location >= range.location && location <= upper` appears character-identically in 3 files — FSNotes iOS/EditorViewController.swift, FSNotes iOS/View/EditTextView.swift, FSNotes/View/EditTextView.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 FSNotes iOS/Helpers/CloudDriveManager.swift:177— `note.isTextBundle() && !note.isFullLoadedTextBundle()` appears character-identically in 3 files — FSNotes iOS/Helpers/CloudDriveManager.swift, FSNotesCore/Business/Project.swift, FSNotesCore/Business/Storage.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 FSNotes iOS/View/NotesTableView.swift:968— `note.isTextBundle() || note.isEncrypted()` appears character-identically in 2 files — FSNotes iOS/View/NotesTableView.swift, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate FSNotes iOS/View/NotesTableView.swift:984— `note.type == .Markdown && note.container == .none` appears character-identically in 2 files — FSNotes iOS/View/NotesTableView.swift, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate FSNotes iOS/ViewController.swift:1383— `passwordExist && context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil)` appears character-identically in 2 files — FSNotes iOS/ViewController.swift, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate FSNotes iOS/Helpers/CloudDriveManager.swift:419— `project.isEncrypted && project.isLocked()` appears character-identically in 3 files — FSNotes iOS/Helpers/CloudDriveManager.swift, FSNotes/Helpers/FileSystemEventManager.swift, FSNotes/ViewController.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 FSNotes iOS/View/NotesTableView.swift:1253— `results.0.count > 0 || results.1.count > 0 || results.2.count > 0` appears character-identically in 2 files — FSNotes iOS/View/NotesTableView.swift, FSNotes/View/NotesTableView.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.
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 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (46112 LoC, 318 module-visible types across 33 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.
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 1 of 164 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (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; 164 of the 270 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: FSNotes iOS/Helpers/SFTPUploader.swift. 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.
Orphaned file FSNotes iOS/Helpers/SFTPUploader.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.
No tests found — No test suite could be collected — no discoverable tests to count. If this repository does test, wiring the suite to a framework a runner can collect (XCTest or Swift Testing) is what makes it countable here; a pipeline step that invokes a runner is not evidence on its own, because a runner over an empty suite passes. Tests written as plain executables or shell/PowerShell harnesses are not collectible this way and are not scored here.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No src/ separation — Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
P1 · CI/CD gates· CI test execution not evidenced · ×1
CI test execution not evidenced — A CI pipeline exists but no test-runner invocation (your stack's test command, or a test job) was found — changes may merge without the suite running.
No SAST — No static application security testing detected. For this repository's stack, add CodeQL's Swift pack (Swift/Xcode) (or `semgrep --config=auto`, which runs on any language) as a CI step. What was searched, so you can tell an absence from a miss: the 384 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
Silent fallback default in catch FSNotesCore/Extensions/String+.swift:156— `matchingStrings` 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.
Outdated: rncryptor — `rncryptor` is resolved at 5.1.0, but 5.2.0 is the newest release tagged on https://github.com/RNCryptor/RNCryptor.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 rncryptor` reaches this one with no change to Package.swift.
Outdated: tocropviewcontroller — `tocropviewcontroller` is resolved at 2.7.4, but 2.8.0 is the newest release tagged on https://github.com/TimOliver/TOCropViewController.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 tocropviewcontroller` reaches this one with no change to Package.swift.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 12 file(s) — `FSNotes iOS/Preferences/ProViewController.swift`, `FSNotes iOS/RevisionsViewController.swift`, `FSNotes iOS/View/NotesTableView.swift`, `FSNotes iOS/ViewController+More.swift`, `FSNotes iOS/ViewController.swift`, … (+7 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
provenance: not applicable — The CI pipeline builds and tests but publishes no released artifact — no package publish, container push, GitHub release or deployment step. Supply-chain provenance, signing and SBOM attest RELEASED artifacts, so there is nothing to attest here. Add them to the release pipeline when this repo starts shipping artifacts (a published package, a container image, a deployed service or a tagged release).
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a177dd-cc0b-74b2-b686-c64ba3410e3e · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 13 · Warnings: 421 · Recommendations: 22 · Info: 2 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 26-10-2026 @ 10:59 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.