Public report — memos, published 6 Aug 2026. Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version; ask the repo owner for the full report.
Watchdog 06-08-2026 @ 05:15 UTC Public
Code Health Audit

Usememos/memos

No baseline yet — first run
55% At Risk

Medium · 83,827 LoC · rebuild ~0.8 person-years · weakest lens: Accessibility (47%)

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

41/44dimensions tool-verifieddeterministic · confidence 1.0 · 3 LLM-assisted, advisory
348findings with an exact file:lineof 362 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
44/112dimensions across the health lenses83827 LoC — wide & deep

Executive summary

Read through the Preview lens: this repo is pre-1.0 / in development, so the colour bands are relaxed to what a preview needs — *green* means good enough for a preview, not yet production-stable. Code correctness and security stay near-strict even here; the score itself is absolute and comparable across repos.

usememos/memos is sound in substance but carries real gaps (55%). It is not in crisis, but the issues below raise the cost of changing it — friction its consumers ultimately inherit.

It is strongest in Domain Modelling (100%) — the domain model is expressive and well-guarded. Code Health (78%) is solid too.

Most urgent: a critical security exposure was detected (see the Security & Compliance lens). Treat it as a priority regardless of the overall grade.

The area that most needs attention is Accessibility (47%) — it raises ongoing delivery and operational cost. Architecture (52%) is the next concern — the code resists change, so features cost more over time.

Leadership focus, highest impact first: Make custom controls keyboard-operable (role + tabindex + key handler) (Keyboard semantics); accessibility in the toolchain you already use (A11y enforcement); Give every control a programmatic label (a <label for> /… (Forms & labels).

For scale: Medium (~83,827 production lines); rebuilding it from scratch would take roughly ~0.8 person-years (~1–2 engineers). Approximate, ±~30%.

It builds on a genuinely strong Domain Modelling foundation (100%); the priorities above are the highest-leverage way to bring the rest up to that level.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Accessibility 47% · 46% weightArchitecture 52% · 25% weightSecurity 67% · 14% weightMaturity 70% · 8% weightReadiness 71% · 4% weightCode Health 78% · 2% weightDomain Modelling 100% · 1% weight

Raise Accessibility 47 → 70 (the Healthy floor) ⇒ headline 55 → ~62.

Code composition — where the lines go
Tests 100%
Rebuild cost & value ~ Modeled — €39,000–€190,000
Cost to rebuild€39,000–€190,000 (0.4–1.2 person-years (646–2,051 h), ~1–2 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.8× (at 55% quality) — the last 20% of quality is most of the work
Size & shapeMedium · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
Dead frontend code~543 LoC unreachable (11 file(s)) — that slice of this estimate buys code with zero runtime value; deleting it is the cheapest win in this report (the R7 card lists every file)

This codebase represents roughly ~0.8 person-years of build effort (about ~€120,000 to rebuild). Its weakest lens is Accessibility at 47% — the part of that asset most exposed by the findings below.

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.8× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

The highest-leverage moves; the full ranked list is in the Roadmap below.

1
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
+7.4 pts · Medium effort · Keyboard semantics
2
Enforce accessibility in the toolchain you already use: enable Biome's a11y rule group in your biome.json `linter.rules` (it is off whenever `recommended` is false and the group is unlisted), then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
+7.4 pts · Medium effort · A11y enforcement
3
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
+7.4 pts · Medium effort · Forms & labels

Diagnosis — what's actually going on

The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 36.4–218.4 engineer-days every year, paid as drag on the ~277,213 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–3 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 5–12% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 68,354 line(s) changed over a 90-day window ⇒ ~277,213/year · D1/D2/D4 code quality: averaging 5.9/10 ⇒ a 5–12% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 3 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Medium asset (~0.8 person-years to rebuild), and its weakest lens is Accessibility at 47%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Medium, ~0.8 person-years rebuild (83,827 LoC) · weakest lens: Accessibility 47%
→ Direct remediation budget at Accessibility first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 5.9/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 5–12% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 5.9/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

Architecture — module dependency matrix

45 modules, 54 dependencies — 1 dependency cycle, shown as the red cell(s) above the diagonal. Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

…e4dd0b8b6fc0c8f7aaa23…mos/memos/internal/ai…mos/internal/ai/audio…/internal/ai/audiollm…memos/internal/ai/stt…s/memos/internal/base…/memos/internal/email…memos/internal/filter…s/internal/httpgetter…os/memos/internal/idp…l/markdown/extensions…ernal/markdown/parser…rkdown/parser/tagdata…nal/markdown/renderer…emos/internal/profile…os/internal/scheduler…s/internal/storage/s3…emos/internal/webhook…mos/memos/store/cache…memos/memos/cmd/memos…al/ai/audiollm/gemini…nternal/ai/stt/openai…s/internal/idp/oauth2…mos/server/router/mcp…/usememos/memos/store…internal/markdown/ast…s/server/notification…erver/router/frontend…rver/runner/s3presign…ememos/memos/store/db…/memos/store/db/mysql…mos/store/db/postgres…memos/store/db/sqlite…mos/internal/markdown…mos/memos/server/auth…mos/server/router/rss…er/runner/memopayload…/server/router/api/v1…ver/router/fileserver…usememos/memos/server…e4dd0b8b6fc0c8f7aaa231…mos/memos/internal/ai2…mos/internal/ai/audio3…/internal/ai/audiollm4…memos/internal/ai/stt5…s/memos/internal/base6…/memos/internal/email7…memos/internal/filter8…s/internal/httpgetter9…os/memos/internal/idp10…l/markdown/extensions11…ernal/markdown/parser12…rkdown/parser/tagdata13…nal/markdown/renderer14…emos/internal/profile15…os/internal/scheduler16…s/internal/storage/s317…emos/internal/webhook18…mos/memos/store/cache19…memos/memos/cmd/memos20…al/ai/audiollm/gemini21…nternal/ai/stt/openai22…s/internal/idp/oauth223…mos/server/router/mcp24…/usememos/memos/store25…internal/markdown/ast26…s/server/notification27…erver/router/frontend28…rver/runner/s3presign29…ememos/memos/store/db30…/memos/store/db/mysql31…mos/store/db/postgres32…memos/store/db/sqlite33…mos/internal/markdown34…mos/memos/server/auth35…mos/server/router/rss36…er/runner/memopayload37…/server/router/api/v138…ver/router/fileserver39…usememos/memos/server40114141222151055532822211246246246196393242323131261142151221+5 more modules (most-connected shown)

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

At a glance — Architecture · 52% · Adequate · gated by R9

At a glance — Maturity · 70% · Strong

At a glance — Readiness · 71% · Strong

At a glance — Security · 67% · Adequate · gated by D36, D38

At a glance — Domain Modelling · 100% · Exemplary

At a glance — Accessibility · 47% · Adequate · gated by AC4

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A06:2021 — Vulnerable & Outdated Components19High / Critical
A02:2021 — Cryptographic Failures3High / Critical
A05:2021 — Security Misconfiguration3Medium

Roadmap

First, make all custom controls keyboard-operable and ensure anchors have valid hrefs. Next, enforce accessibility standards by enabling linting rules and automated testing in CI. Then, provide programmatic labels for all form controls and buttons, and add text alternatives for images, SVGs, and videos. Finally, improve page structure by adding a language attribute, title, main landmark, and proper heading hierarchy.

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

Do thisHelpsEffortDimension
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+7.4 ptsMediumKeyboard semantics
Enforce accessibility in the toolchain you already use: enable Biome's a11y rule group in your biome.json `linter.rules` (it is off whenever `recommended` is false and the group is unlisted), then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.+7.4 ptsMediumA11y enforcement
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.+7.4 ptsMediumForms & labels
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.+7.3 ptsMediumText alternatives
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.+7.0 ptsMediumPage structure
Resolve the 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with webhook.go.+2.5 ptsLowChange Coupling
Break each cycle by extracting the shared piece into a module both sides can import.+4.9 ptsMediumCircular Imports
Resolve the 2 Secret finding(s) in Secrets (history) — start with 01__dump.sql (2).+0.6 ptsLowSecrets (history)

File quality

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

FileScoreBandWorst signal
go.mod0.2SlopOSV Dependency Vulnerabilities: Critical CVE: [GHSA redacted]
web/pnpm-lock.yaml0.4SlopOSV Dependency Vulnerabilities: High vulnerability: [GHSA redacted]
store/seed/sqlite/01__dump.sql5.8MixedSecrets (history): Secret: generic-api-key
scripts/Dockerfile6.2MixedIaC & Container Security: Medium IaC: CKV_DOCKER_8
server/router/api/v1/memo_service.go7.0Near-cleanCyclomatic Complexity: APIV1Service.UpdateMemo (cyclomatic 34)
store/deployment_config.go7.0Near-cleanCyclomatic Complexity: store.validateAndNormalizeDeploymentInstanceSetting (cyclomatic 27)
store/db/mysql/attachment.go7.0Near-cleanCyclomatic Complexity: DB.ListAttachments (cyclomatic 25)
internal/filter/parser.go7.0Near-cleanCyclomatic Complexity: filter.evaluateNumeric (cyclomatic 22)
store/db/mysql/user_delete.go7.0Near-cleanCognitive Complexity: mysql.listDeleteUserMemoTreeIterative (cognitive 17)
server/router/api/v1/user_service.go7.0Near-cleanCyclomatic Complexity: APIV1Service.UpdateUser (cyclomatic 32)
server/router/api/v1/attachment_service.go7.0Near-cleanCyclomatic Complexity: APIV1Service.CreateAttachment (cyclomatic 31)
store/db/mysql/memo.go7.0Near-cleanCyclomatic Complexity: DB.ListMemos (cyclomatic 28)
store/db/mysql/memo_relation.go7.0Near-cleanCyclomatic Complexity: DB.ListMemoRelations (cyclomatic 21)
server/router/api/v1/memo_attachment_service.go7.0Near-cleanCyclomatic Complexity: APIV1Service.normalizeMemoAttachmentRequest (cyclomatic 23)
store/db/postgres/memo_relation.go7.0Near-cleanCyclomatic Complexity: DB.ListMemoRelations (cyclomatic 23)
store/db/mysql/user.go7.0Near-cleanCyclomatic Complexity: DB.ListUsers (cyclomatic 22)
server/router/api/v1/instance_service.go7.1Near-cleanCyclomatic Complexity: APIV1Service.UpdateInstanceSetting (cyclomatic 29)
server/router/api/v1/memo_service_comments.go7.1Near-cleanCyclomatic Complexity: APIV1Service.ListMemoComments (cyclomatic 27)
store/db/postgres/user.go7.1Near-cleanCyclomatic Complexity: DB.ListUsers (cyclomatic 20)
store/db/mysql/inbox.go7.1Near-cleanCognitive Complexity: DB.ListInboxes (cognitive 18)

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 41 of 44 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 3 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.7 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 44 dimensions across the health lenses
D1D2D4D7D13D15D16D19D20D21D28D29D31D33D34D35D36D37D38AC1AC2AC3AC4AC5AC6AC7DM6M1M2M3M4P1P3P4P6R1R10R2R3R4R6R7R8R9

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

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

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

Tools & methods

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

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

Every finding is locatable in findings.md. Run 019fd57f-9227-7afd-9cd1-31394699836e.

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

Run transparency — what happened this run

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

  • D30 Dependency Vulnerabilities — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.

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.
  • D4 Code Duplication: Duplication is token-similarity (jscpd) — 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.
  • D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
  • 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").
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D33 JS/npm Dependency Vulnerabilities: JS/npm CVE matching reads package manifests and lockfiles — risk from how a dependency is used, and advisories not yet published, fall outside this scan.
  • 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.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A clean result is "no unlabelled native control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • 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.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (4): D19, D20, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity5.6 / 10Adequate✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 5.6 / 10 · rule-coverage 100% · ceiling Prevented

59 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was MarkdownRenderer.renderNode at 51. A further 1 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being mcp.valueToString at 16 — they are counted neither in the figure above nor in this dimension's score.

DB.ListMemos (cyclomatic 28) · ×2store/db/mysql/memo.go:62
DB.ListAttachments (cyclomatic 25) · ×2store/db/mysql/attachment.go:49
DB.ListUsers (cyclomatic 22) · ×2store/db/mysql/user.go:79
DB.ListMemoRelations (cyclomatic 21) · ×2store/db/mysql/memo_relation.go:34
MarkdownRenderer.renderNode (cyclomatic 51)internal/markdown/renderer/markdown_renderer.go:34

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

What to do

  1. Resolve the 2 DB.ListMemos (cyclomatic 28) finding(s) in Cyclomatic Complexity — start with memo.go (2). — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 2 DB.ListAttachments (cyclomatic 25) finding(s) in Cyclomatic Complexity — start with attachment.go (2). — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 2 DB.ListUsers (cyclomatic 22) finding(s) in Cyclomatic Complexity — start with user.go (2). — One of this dimension's main actionable groups (2 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 3.0 / 10 · rule-coverage 100% · ceiling Prevented

92 method(s) exceeded the cognitive complexity threshold of 15; the worst was APIV1Service.parseUserAgent at 80.

DB.ListInboxes (cognitive 18) · ×3store/db/mysql/inbox.go:48
DB.ApplyAuthenticationConfigMutation (cognitive 17) · ×3store/db/mysql/auth_config.go:23
DB.ListMemos (cognitive 37) · ×2store/db/mysql/memo.go:62
DB.ListAttachments (cognitive 33) · ×2store/db/mysql/attachment.go:49
DB.ListMemoRelations (cognitive 29) · ×2store/db/mysql/memo_relation.go:34

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

What to do

  1. Resolve the 3 DB.ListInboxes (cognitive 18) finding(s) in Cognitive Complexity — start with inbox.go (3). — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 3 DB.ApplyAuthenticationConfigMutation (cognitive 17) finding(s) in Cognitive Complexity — start with auth_config.go (3). — One of this dimension's main actionable groups (3 warning-level).
  3. Resolve the 2 DB.ListMemos (cognitive 37) finding(s) in Cognitive Complexity — start with memo.go (2). — One of this dimension's main actionable groups (2 warning-level).
  4. 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.

D4 · Code Duplication9.1 / 10Exemplary✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: DocumentedVerifiedPrevented · effective 9.1 / 10 · rule-coverage 100% · ceiling Verified

155 duplicated block group(s) detected.

Duplicated block (9 lines × 2) · ×21internal/markdown/extensions/mention.go:70
Duplicated block (10 lines × 2) · ×16internal/markdown/extensions/mention.go:54
Duplicated block (7 lines × 2) · ×14internal/markdown/extensions/gfm.go:150
Duplicated block (8 lines × 2) · ×13internal/email/client.go:92
Duplicated block (11 lines × 2) · ×11internal/filter/parser.go:315

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

✓ On the Gold path — maintain.

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

D7 · Architectural Integrity10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the code respects its intended layering / architecture rules.

Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Of 1 mechanizable ADRs, 1 are prevented by analyzers, 0 by tests, 0 exist only in prose. Coverage: 100 %. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

✓ On the Gold path — maintain.

Detailed fixes: d7_recommendation.md.

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D15 · Churn × Complexity Hotspots9.8 / 10Exemplary✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: web/src/components/PagedMemoList/PagedMemoList.tsx (15×30=450); server/router/api/v1/user_service.go (9×32=288); server/router/api/v1/memo_service.go (7×34=238)

Hotspot: web/src/components/PagedMemoList/PagedMemoList.tsx · ×10web/src/components/PagedMemoList/PagedMemoList.tsx

✓ On the Gold path — maintain.

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

D16 · Bus Factor9.2 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: DocumentedVerifiedPrevented · effective 9.2 / 10 · rule-coverage 100% · ceiling Documented

21 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is internal/filter/parser.go.

Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

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

D19 · Documentation Quality / 10Exemplary◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Documented

This project's documentation is comprehensive and well-structured across READMEs, architecture/ADR docs, proto files, and a dedicated UI-kit reference. Memos' README features an impressive live-demo badge, a feature list, quick-install guides for Docker, native binary, and other install paths, plus a full ADR index with conventions, statuses, and suggested structure. The scheduler plugin doc is exemplary: it names every listed feature, provides a runnable Quick Start, dives into the 5- and 6-field cron formats, lists special characters, gives common examples, and covers timezone support, middleware, graceful shutdown, and best practices. The fileserver package README is also top-notch — an architecture section with separation-of-concerns design principles, a detailed API endpoint reference for both attachment binary and user avatar endpoints, authentication flows, permission checks, and a dependency table. Despite the clipped clip markers (e.g., the scheduler plugin's Common Examples and the UI-kit variant catalog), every named section is present in the visible portion of the document. The memo project's documentation is clear and complete: the READMEs for each component (MemoEditor, ConfirmDialog, MemoContent) cover architecture, usage, props, and a full outline; an ADR glossary defines Memos domain terms across several files; Configuration Provisioning explains the deployment-configuration model with design rationale, validation, and migration notes; and Authentication State Architecture justifies AuthContext over React Query for synchronous initialization and single-source-truth. The only unshown section is the one clipped by the scanner in each README (architecture/usage props), so those are not flagged as missing.

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality / 10Exemplary◐ Sampled · advisory

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

Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Documented

Evaluated 2 ADR(s) individually; mean quality 9.0/10 (consistently complete and clear). 0 flagged with a specific gap.

✓ On the Gold path — maintain.

Detailed fixes: d20_recommendation.md.

D21 · Naming Consistency / 10Exemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: DocumentedVerifiedPrevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D28 · Secrets (history)4.0 / 10Weak✓ Tool-verified

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

Method: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.

Maturity: DocumentedVerifiedPrevented · effective 4.0 / 10 · rule-coverage 100% · ceiling Documented

6 finding(s): 0 critical, 6 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

Secret: generic-api-key · ×2store/seed/sqlite/01__dump.sql:205detected by gitleaks finding
Rotate the exposed credentials — git history can't be un-committed

What to do

  1. Resolve the 2 Secret finding(s) in Secrets (history) — start with 01__dump.sql (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

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

D29 · Static Analysis (SAST)10.0 / 10Exemplary○ Nothing flagged

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

semgrep found no security issues.

✓ On the Gold path — maintain.

Detailed fixes: d29_recommendation.md.

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

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

Medium IaC: CKV_DOCKER_8 · ×2scripts/Dockerfile:43detected by trivy finding
Low IaC: DS-0026scripts/Dockerfiledetected by trivy finding

✓ On the Gold path — maintain.

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

D33 · JS/npm Dependency Vulnerabilities10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether JavaScript/npm dependencies have known published vulnerabilities (CVEs) — the npm ecosystem's biggest risk.

Method: JS/npm CVE scan via trivy fs --scanners vuln over JS manifests (package.json/yarn.lock/pnpm-lock/bun.lockb); 0-10 tight normalizer. NotApplicable without JS manifests. Exhaustive, deterministic.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No known-vulnerable JS/npm dependencies.

✓ On the Gold path — maintain.

Detailed fixes: d33_recommendation.md.

D34 · Knowledge Freshness9.8 / 10Exemplary✓ Tool-verified

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

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

Maturity: DocumentedVerifiedPrevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

6 of 309 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is web/src/components/Inbox/MemoMentionMessage.tsx.

Further orphaned files (smaller)

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.9 / 10Exemplary✓ Tool-verified

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

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

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling; coupling through a build step, config, or non-source file isn't seen.

Maturity: DocumentedVerifiedPrevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: PreferencesSection.tsx↔setting.d.ts 84%; SignIn.tsx↔SignUp.tsx 72%; LocationDisplayView.tsx↔RelationListView.tsx 60%

Boundary-crossing change coupling: webhook.go ↔ memo_service.gointernal/webhook/webhook.go
Change coupling: PreferencesSection.tsx ↔ setting.d.ts · ×7web/src/components/Settings/PreferencesSection.tsx

✓ On the Gold path — maintain.

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

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

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

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

Maturity: DocumentedVerifiedPrevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

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

Unpinned build actions
PR-triggered workflow without a permissions block
Secret passed as a command-line argument
No build provenance
No artifact signing

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

What to do

  1. Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 PR-triggered workflow without a permissions block finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Secret passed as a command-line argument finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).

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

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

Maturity: DocumentedVerifiedPrevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D38 · OSV Dependency Vulnerabilities3.0 / 10Weak✓ Tool-verified

What it measures: Whether dependencies have known published vulnerabilities (CVEs) per the OSV database — read natively from whatever lockfile the repository ships (Cargo, npm, Go, Python, Maven, RubyGems, …). D33 and D30 add ecosystem-specific scanners on top for npm and .NET.

Method: Multi-ecosystem dependency-CVE scan via osv-scanner --recursive (queries the osv.dev database + parses lockfiles natively across ecosystems: npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven/Gradle pom.xml/gradle.lockfile, PyPI requirements.txt/poetry.lock/Pipfile.lock, Composer composer.lock, RubyGems Gemfile.lock, Hex mix.lock, pub pubspec.lock, Swift Package.resolved); severity tally (Critical/High/Medium/Low) to 0-10 tight normalizer (8.0). NotApplicable only when the repo declares no supported non-.NET dependency lockfile (a NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain); coverage needs a resolved lockfile. Additive to D33 (trivy fs); exhaustive + deterministic, DB kept fresh.

Maturity: DocumentedVerifiedPrevented · effective 3.0 / 10 · rule-coverage 100% · ceiling Documented

19 finding(s): 1 critical, 6 high, 10 medium, 2 low.

High CVE: [GHSA redacted] · ×4go.moddetected by osv-scanner finding
High vulnerability: [GHSA redacted] · ×2go.moddetected by osv-scanner finding
Critical CVE: [GHSA redacted]go.moddetected by osv-scanner finding
Medium CVE: [GHSA redacted] · ×8web/pnpm-lock.yamldetected by osv-scanner finding
Medium vulnerability: [GHSA redacted] · ×2go.moddetected by osv-scanner finding

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

What to do

  1. Resolve the 4 High CVE finding(s) in OSV Dependency Vulnerabilities — start with pnpm-lock.yaml (3), go.mod. — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 2 High vulnerability finding(s) in OSV Dependency Vulnerabilities — start with go.mod, pnpm-lock.yaml. — One of this dimension's main actionable groups (2 issue-level).
  3. Resolve the 1 Critical CVE finding(s) in OSV Dependency Vulnerabilities — start with go.mod. — One of this dimension's main actionable groups (1 issue-level).

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

Frontend & cross-cutting dimensions

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

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

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

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

  • An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. — AttachmentIcon.tsx:49
  • Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). (×2) — AttachmentCard.tsx:35, PreviewImageDialog.tsx:159

What to do

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

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

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

  • This UI-library field component has no label / aria-label / aria-labelledby / id / name — and neither does anything it renders — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. — CreateAccessTokenDialog.tsx:127
  • This UI-library field component has no label / aria-label / aria-labelledby / id / name, and nothing it renders carries one either. The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×6) — CreateAccessTokenDialog.tsx:148, CreateUserDialog.tsx:121, MemoSharePanel.tsx:140, …
  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×2) — DateTimeInput.tsx:20, TimestampPopover.tsx:45
  • This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×3) — AISection.tsx:439, SettingList.tsx:86, ThemeSelect.tsx:34

What to do

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

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

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

  • user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta. — index.html:11

What to do

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

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

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

  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×12) — AttachmentIcon.tsx:49, AttachmentIcon.tsx:102, AttachmentMediaGrid.tsx:19, …

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

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

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

AC6 · Visual & motion safety10.0 / 10Exemplary○ Nothing flagged

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

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

AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.

Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.

  • No accessibility enforcement found — your Biome config enables no a11y rules and there's no axe/pa11y/Lighthouse in tests or CI. Start by turning on Biome's own a11y rule group to catch issues at author time.

What to do

  • Enforce accessibility in the toolchain you already use: enable Biome's a11y rule group in your biome.json `linter.rules` (it is off whenever `recommended` is false and the group is unlisted), then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
DM6 · Domain ↔ infrastructure boundary10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (TypeORM/Prisma/MikroORM/Sequelize/Mongoose) on its own declaration (active-record) 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.

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

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

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

What to do

  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 1 of 1 project(s) that lack one — worth up to 2 pts.
M2 · Architecture documentation4.0 / 10Weak✓ Tool-verified

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

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

What to do

  • Grow the ADR log (currently 3) — reach 8 to raise the maturity tier; document significant decisions as they're made.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

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

M4 · Documentation accuracy9.0 / 10Exemplary◐ Sampled · advisory

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.

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

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

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

P3 · Security & performance tooling5.0 / 10Adequate✓ Tool-verified

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

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

What to do

  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback7.0 / 10Strong✓ Tool-verified

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

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

P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

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

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

What to do

  • Stamp a version in your build/package manifest (e.g. csproj <Version>, package.json, pyproject.toml, Cargo.toml, or a VERSION file) or tag releases with semver so builds and releases are traceable.
R1 · Type Safety10.0 / 10Exemplary✓ Tool-verified

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

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

R10 · Code Duplication8.8 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Copy-pasted token-identical blocks across the frontend (the D4 clone algorithm over JS/TS tokens, D-386).

Method: Copy-pasted token-identical blocks across the frontend (the D4 clone algorithm run over JS/TS tokens). Deterministic.

  • web/src/components/MemoEditor/Editor/markdownTagRanges.ts:72 · web/src/utils/gfm-email.ts:30 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — markdownTagRanges.ts:72
  • web/src/components/MotionPhotoPlayer.tsx:10 · web/src/components/MotionPhotoPreview.tsx:11 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — MotionPhotoPlayer.tsx:10
  • web/src/components/MemoMetadata/Attachment/AttachmentListEditor.tsx:40 · web/src/components/MemoMetadata/Attachment/AttachmentListEditor.tsx:56 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — AttachmentListEditor.tsx:40
  • web/src/contexts/InstanceContext.tsx:216 · web/src/contexts/MemoFilterContext.tsx:148 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — InstanceContext.tsx:216
  • web/src/components/Inbox/MemoCommentMessage.tsx:67 · web/src/components/Inbox/MemoMentionMessage.tsx:69 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — MemoCommentMessage.tsx:67
  • web/src/components/Settings/MemberSection.tsx:110 · web/src/components/Settings/SSOSection.tsx:116 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — MemberSection.tsx:110
  • web/src/components/VideoPoster.tsx:40 · web/src/hooks/useNearViewport.ts:25 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — VideoPoster.tsx:40
  • web/src/components/ui/dropdown-menu.tsx:22 · web/src/components/ui/popover.tsx:18 · web/src/components/ui/tooltip.tsx:22 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — dropdown-menu.tsx:22

What to do

  • Extract the duplicated blocks into shared functions/components.
R2 · Cyclomatic Complexity9.4 / 10Exemplary✓ Tool-verified

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

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

  • Branch-heavy code is where defects cluster — extract decisions into smaller functions. (×8) — PagedMemoList.tsx:114, markdownTagRanges.ts:225, MemoDetail.tsx:40, …

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files8.8 / 10Exemplary✓ Tool-verified

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

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

What to do

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

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

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

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×8) — generate-tag-unicode-data.mjs, AttachmentIcon.tsx, tabs.tsx, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

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

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

R7 · Dead Code7.7 / 10Strong✓ Tool-verified

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

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

  • Unreachable from the 4 application, 8 tooling and 89 test entry point(s) detected in this repo. Gate removals on your build/type-check — an undetected custom entry would make these reachable.
  • no import path from any entry point (4 application, 8 tooling, 89 test roots considered) (×7) — generate-tag-unicode-data.mjs, AttachmentIcon.tsx, tabs.tsx, …

What to do

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

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

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

R9 · Circular Imports1.7 / 10Critical✓ Tool-verified

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

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

  • web/src/components/AppSidebar/AppSidebar.tsx → web/src/components/UserMenu.tsx → web/src/router/index.tsx → web/src/layouts/RootLayout.tsx → web/src/components/AppSidebar/index.ts → web/src/components/AppSidebar/AppSidebar.tsx (one verified cycle inside a mutually-dependent group of 33 files) — AppSidebar.tsx
  • web/src/contexts/AuthContext.tsx → web/src/hooks/useUserQueries.ts → web/src/hooks/useCurrentUser.ts → web/src/contexts/AuthContext.tsx — AuthContext.tsx
  • web/src/i18n.ts → web/src/utils/i18n.ts → web/src/i18n.ts — i18n.ts

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.

WCAG coverage — what static analysis assessed

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

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

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

Reference — by lens

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

LensScoreRatingImpact
Code Health78%Adequate — gated by D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture52%Adequate — gated by R9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity70%StrongSolid.
Readiness71%StrongSolid.
Security67%Adequate — gated by D36, D38Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling100%ExemplaryStrongest area.
Accessibility47%Adequate — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 68 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.

  • AX1 Captive dependencies — no DI registrations detected
  • AX10 Code composition — not assessed — code composition is computed by ROLE over a document set 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 singleton implementations detected
  • AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph 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
  • AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over a project-reference graph 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
  • 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 — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) 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
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — 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.
  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~32977 lines of test source are present (.go, .ts, .tsx) but the test-quality collector reads C# only, so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included
  • D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
  • D14 License Compliance — Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (a Go module (go.mod/go.sum) and package.json), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
  • D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — No exposed public API
  • D23 Boundary Type-Coupling — Production source is present (.go, .mts, .ts, .tsx) but bounded contexts are resolved over the C#/VB project set, which exposed none, so context scope could not be assessed. Not scored — this is a gap in the analyzer, not a verdict about this repository. Declaring the codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed — see the recommendation on this dimension for where. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — none of 2 ADRs are conformance-checkable — unverifiable.
  • D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
  • D3 God Classes — Most of this repository's production source (.go, .mts, .ts, .tsx) was not read by god-class detection, so class size was not assessed for the languages that are the product — whatever else this pass did read is not this repository's class size. Not scored — this is a gap in the analyzer, not a verdict about this repository.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Go module (go.mod/go.sum) and package.json — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
  • D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
  • 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.
  • D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
  • D6 Cohesion (LCOM4) — Cohesion (LCOM4) is measured over a C#/VB class graph, and this repository's production source is mostly .go, .mts, .ts, .tsx, which this pass does not read, so cohesion was not assessed for this repository. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • D9 Test Distribution — Test source is present (.go, .ts, .tsx) but the test-pyramid classifier reads C# only, so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • DM1 Aggregate boundaries — not scored for TypeScript: a class holding another class reads the same whether the inner type is an aggregate or a value object, so this cannot be decided from source without guessing — reported as guidance rather than measured
  • DM2 Strongly-typed ids — not scored for TypeScript: branded ids (`type Id = string & { __brand }`) are an uncommon idiom, so a bare-string id is not on its own evidence of a missing typed id — reported as guidance rather than measured
  • DM3 Integration-event coupling — not scored for TypeScript: a domain type used across packages is indistinguishable in source from a deliberate shared-kernel package, so this is reported as guidance rather than measured
  • DM4 Rich vs anemic model — not scored for TypeScript: telling a rich domain entity from an anemic data holder needs the behaviour a source-only read cannot always attribute (components, DTOs and readonly value objects are all legitimately data-shaped), so this is reported as guidance rather than measured
  • DM5 Encapsulated state — not scored for TypeScript: the language already steers state behind #private/private/readonly, so a mutable public field is rare enough that we report this as guidance rather than measuring it
  • DM7 Repository granularity — not scored for TypeScript: deciding whether a repository belongs to an aggregate root needs the aggregate structure, which source alone does not state — reported as guidance rather than measured
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this check looks for
  • 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 check looks for
  • GD1 Unfinished & placeholder code — no source files
  • 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 — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
  • P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
  • P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
  • P8 Schema migrations — not assessed — schema-migration practice is read from 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
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • R5 Dependency Freshness — uses a pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D33 (JS/npm Dependency Vulnerabilities)
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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
  • 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
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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

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.

Issue — 10 finding(s)
D38 · OSV Dependency Vulnerabilities · High CVE · ×4
  • High CVE: [GHSA redacted] go.mod — golang.org/x/image 0.39.0: [GHSA redacted] — golang.org/x/image is not a DIRECT requirement of this module: go.mod records it as `// indirect`, pulled in transitively, so raise it in place (run `go get golang.org/x/image@v0.41.0`, which updates the require line go.mod already holds for it). This one row stands for the 6 advisories this scan raises against golang.org/x/image 0.39.0: [GHSA redacted], GO-2026-4961, GO-2026-5031, GO-2026-5061, GO-2026-5062, GO-2026-5066.
  • High CVE: [GHSA redacted] web/pnpm-lock.yaml — react-router 7.15.0: [GHSA redacted] — react-router is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin react-router to 7.18.0 with an `overrides` entry (`pnpm.overrides` for pnpm)). This is 1 of 6 advisories with a published fix this scan raises against react-router 7.15.0, and their fixed versions do not agree — anything below 7.18.0 still leaves at least one of them open. Take this package to 7.18.0 or later: that is the floor for the package, not this row's target alone. This one row stands for the 6 advisories this scan raises against react-router 7.15.0: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] web/pnpm-lock.yaml — undici 7.25.0: [GHSA redacted] — undici is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin undici to 7.29.0 with an `overrides` entry (`pnpm.overrides` for pnpm)). This is 1 of 12 advisories with a published fix this scan raises against undici 7.25.0, and their fixed versions do not agree — anything below 7.29.0 still leaves at least one of them open. Take this package to 7.29.0 or later: that is the floor for the package, not this row's target alone. This one row stands for the 12 advisories this scan raises against undici 7.25.0: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
  • High CVE: [GHSA redacted] web/pnpm-lock.yaml — vite 8.0.11: [GHSA redacted] — this repo declares vite ^8.0.11, a range that ALREADY admits the fixed 8.0.16, so there is no manifest edit to make here. Re-resolve the lock so vite moves onto 8.0.16 or later; if the flagged 8.0.11 comes back, a dependency is pinning it — upgrade that dependent, or pin vite with an `overrides` entry (`pnpm.overrides` for pnpm) so only one copy resolves. This one row stands for the 2 advisories this scan raises against vite 8.0.11: [GHSA redacted], [GHSA redacted].
D28 · Secrets (history) · Secret · ×2
  • Secret: generic-api-key store/seed/sqlite/01__dump.sql:205 — matched rule 'generic-api-key'
  • Secret: jwt store/seed/sqlite/01__dump.sql:5 — matched rule 'jwt'
D38 · OSV Dependency Vulnerabilities · High vulnerability · ×2
  • High vulnerability: [GHSA redacted] go.mod — google.golang.org/grpc 1.80.0: [GHSA redacted] — upgrade to 1.82.1
  • High vulnerability: [GHSA redacted] web/pnpm-lock.yaml — postcss 8.5.14: [GHSA redacted] — postcss is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin postcss to 8.5.18 with an `overrides` entry (`pnpm.overrides` for pnpm)). This is 1 of 2 advisories with a published fix this scan raises against postcss 8.5.14, and their fixed versions do not agree — anything below 8.5.23 still leaves at least one of them open. Take this package to 8.5.23 or later: that is the floor for the package, not this row's target alone. This one row stands for the 2 advisories this scan raises against postcss 8.5.14: [GHSA redacted], [GHSA redacted].
D35 · Change Coupling · Boundary-crossing change coupling · ×1
  • Boundary-crossing change coupling: webhook.go ↔ memo_service.go internal/webhook/webhook.go — `internal/webhook/webhook.go` (context internal) and `server/router/api/v1/memo_service.go` (context router) sit in DIFFERENT parts of the tree yet change together 56% of the time (9 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) — 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.
D38 · OSV Dependency Vulnerabilities · Critical CVE · ×1
  • Critical CVE: [GHSA redacted] go.mod — golang.org/x/crypto 0.50.0: [GHSA redacted] — upgrade to 0.52.0. This one row stands for the 14 advisories this scan raises against golang.org/x/crypto 0.50.0: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], GO-2026-5932.
Warning — 338 finding(s)
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×21
  • Duplicated block (9 lines × 2) internal/markdown/extensions/mention.go:70 — internal/markdown/extensions/mention.go:70-78 | internal/markdown/extensions/tag.go:118-126 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/markdown/extensions/mention.go:70` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) internal/markdown/renderer/markdown_renderer.go:81 — internal/markdown/renderer/markdown_renderer.go:81-89 | internal/markdown/renderer/markdown_renderer.go:111-119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) server/router/api/v1/memo_service.go:293 — server/router/api/v1/memo_service.go:293-301 | server/router/api/v1/memo_service_comments.go:238-246 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_service.go:293` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) server/router/rss/rss.go:95 — server/router/rss/rss.go:95-103 | server/router/rss/rss.go:150-158 — both copies are in the same file, so extract the 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 `server/router/rss/rss.go:95` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) server/router/api/v1/auth_service_session.go:51 — server/router/api/v1/auth_service_session.go:51-59 | server/router/api/v1/auth_service_session.go:167-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/auth_service_session.go:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) server/router/api/v1/idp_service.go:97 — server/router/api/v1/idp_service.go:97-105 | server/router/api/v1/idp_service.go:159-167 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) server/router/api/v1/instance_service_validation.go:148 — server/router/api/v1/instance_service_validation.go:148-156 | server/router/api/v1/user_service.go:33-41 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/instance_service_validation.go:148` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) server/router/api/v1/memo_attachment_service.go:18 — server/router/api/v1/memo_attachment_service.go:18-26 | server/router/api/v1/memo_relation_service.go:18-26 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_attachment_service.go:18` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) server/router/api/v1/memo_attachment_service.go:42 — server/router/api/v1/memo_attachment_service.go:42-50 | server/router/api/v1/memo_relation_service.go:42-50 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_attachment_service.go:42` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) server/router/api/v1/memo_attachment_service.go:219 — server/router/api/v1/memo_attachment_service.go:219-227 | server/router/api/v1/reaction_service.go:35-43 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_attachment_service.go:219` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) server/router/api/v1/memo_service_comments.go:167 — server/router/api/v1/memo_service_comments.go:167-175 | server/router/api/v1/user_service.go:83-92 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_service_comments.go:167` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) server/router/api/v1/user_service.go:295 — server/router/api/v1/user_service.go:295-303 | server/router/api/v1/user_service.go:401-409 — both copies are in the same file, so extract the 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 `server/router/api/v1/user_service.go:295` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) server/router/api/v1/user_service.go:397 — server/router/api/v1/user_service.go:397-405 | server/router/api/v1/user_service_stats.go:193-202 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/user_service.go:397` 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) store/db/mysql/attachment.go:210 — store/db/mysql/attachment.go:210-218 | store/db/sqlite/attachment.go:191-199 — 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) store/db/mysql/inbox.go:58 — store/db/mysql/inbox.go:58-66 | store/db/sqlite/inbox.go:50-58 — 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 `store/db/mysql/inbox.go:58` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) store/db/mysql/inbox.go:117 — store/db/mysql/inbox.go:117-125 | store/db/postgres/inbox.go:108-116 — 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 `store/db/mysql/inbox.go:117` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) store/db/mysql/memo.go:77 — store/db/mysql/memo.go:77-85 | store/db/sqlite/memo.go:69-77 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/mysql/memo.go:77` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) store/db/mysql/memo_relation.go:47 — store/db/mysql/memo_relation.go:47-55 | store/db/sqlite/memo_relation.go:54-62 — `store/db/mysql/memo_relation.go` and `store/db/sqlite/memo_relation.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (9 lines × 2) store/db/mysql/memo_share.go:15 — store/db/mysql/memo_share.go:15-23 | store/db/sqlite/memo_share.go:15-23 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) store/db/mysql/user.go:109 — store/db/mysql/user.go:109-117 | store/db/sqlite/user.go:107-115 — 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 `store/db/mysql/user.go:109` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) store/db/postgres/user.go:78 — store/db/postgres/user.go:78-86 | store/db/sqlite/user.go:78-86 — 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 `store/db/postgres/user.go:78` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×16
  • Duplicated block (10 lines × 2) internal/markdown/extensions/mention.go:54 — internal/markdown/extensions/mention.go:54-63 | internal/markdown/extensions/tag.go:102-111 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `internal/markdown/extensions/mention.go:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) server/notification/email.go:235 — server/notification/email.go:235-244 | server/router/api/v1/memo_batch_helpers.go:25-34 — 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 `server/notification/email.go:235` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) server/router/api/v1/memo_service.go:250 — server/router/api/v1/memo_service.go:250-259 | server/router/api/v1/memo_service_comments.go:186-195 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_service.go:250` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) server/router/api/v1/memo_service.go:343 — server/router/api/v1/memo_service.go:343-352 | server/router/api/v1/memo_service.go:520-529 — both copies are in the same file, so extract the 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 `server/router/api/v1/memo_service.go:343` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) server/router/api/v1/memo_service.go:414 — server/router/api/v1/memo_service.go:414-423 | server/router/api/v1/memo_service.go:529-538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_service.go:414` 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) server/router/api/v1/memo_batch_helpers.go:15 — server/router/api/v1/memo_batch_helpers.go:15-24 | server/router/api/v1/user_service_stats.go:22-31 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
  • Duplicated block (10 lines × 2) server/router/api/v1/memo_share_service.go:24 — server/router/api/v1/memo_share_service.go:24-33 | server/router/api/v1/memo_share_service.go:73-82 — both copies are in the same file, so extract the 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 `server/router/api/v1/memo_share_service.go:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) server/router/api/v1/shortcut_service.go:51 — server/router/api/v1/shortcut_service.go:51-60 | server/router/api/v1/shortcut_service.go:137-146 — both copies are in the same file, so extract the 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 `server/router/api/v1/shortcut_service.go:51` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) server/router/api/v1/user_service_settings.go:18 — server/router/api/v1/user_service_settings.go:18-27 | server/router/api/v1/user_service_settings.go:56-65 — both copies are in the same file, so extract the 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 `server/router/api/v1/user_service_settings.go:18` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) server/router/api/v1/user_service_webhooks.go:22 — server/router/api/v1/user_service_webhooks.go:22-31 | server/router/api/v1/user_service_webhooks.go:55-64 — both copies are in the same file, so extract the 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 `server/router/api/v1/user_service_webhooks.go:22` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) server/router/api/v1/user_service_webhooks.go:112 — server/router/api/v1/user_service_webhooks.go:112-121 | server/router/api/v1/user_service_webhooks.go:207-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/user_service_webhooks.go:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) store/db/mysql/inbox.go:16 — store/db/mysql/inbox.go:16-25 | store/db/sqlite/inbox.go:16-25 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) store/db/mysql/memo.go:261 — store/db/mysql/memo.go:261-270 | store/db/sqlite/memo.go:239-248 — 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 `store/db/mysql/memo.go:261` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) store/db/mysql/user.go:98 — store/db/mysql/user.go:98-107 | store/db/sqlite/user.go:96-105 — 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 `store/db/mysql/user.go:98` 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) store/db/postgres/idp.go:114 — store/db/postgres/idp.go:114-123 | store/db/sqlite/idp.go:114-123 — `store/db/postgres/idp.go` and `store/db/sqlite/idp.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/postgres/idp.go:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) store/db/postgres/memo_relation.go:78 — store/db/postgres/memo_relation.go:78-87 | store/db/sqlite/memo_relation.go:76-85 — `store/db/postgres/memo_relation.go` and `store/db/sqlite/memo_relation.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 69 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/postgres/memo_relation.go:78` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×14
  • Duplicated block (7 lines × 2) internal/markdown/extensions/gfm.go:150 — internal/markdown/extensions/gfm.go:150-156 | internal/markdown/extensions/gfm.go:183-189 — both copies are in the same file, so extract the 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 `internal/markdown/extensions/gfm.go:150` 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) server/notification/email.go:214 — server/notification/email.go:214-220 | server/router/api/v1/memo_batch_helpers.go:10-16 — 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 `server/notification/email.go:214` 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) server/router/api/v1/memo_service.go:283 — server/router/api/v1/memo_service.go:283-290 | server/router/api/v1/memo_service_comments.go:228-234 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_service.go:283` 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) server/router/api/v1/memo_service.go:359 — server/router/api/v1/memo_service.go:359-365 | server/router/api/v1/memo_service.go:454-460 — both copies are in the same file, so extract the 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 `server/router/api/v1/memo_service.go:359` 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) store/db/mysql/attachment.go:50 — store/db/mysql/attachment.go:50-56 | store/db/sqlite/attachment.go:43-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/mysql/attachment.go:50` 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) store/db/mysql/attachment.go:193 — store/db/mysql/attachment.go:193-199 | store/db/sqlite/attachment.go:174-180 — 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 `store/db/mysql/attachment.go:193` 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) store/db/mysql/memo_relation.go:36 — store/db/mysql/memo_relation.go:36-42 | store/db/mysql/memo_relation.go:128-134 — both copies are in the same file, so extract the 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 `store/db/mysql/memo_relation.go:36` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) store/db/mysql/memo_relation.go:57 — store/db/mysql/memo_relation.go:57-63 | store/db/sqlite/memo_relation.go:64-70 — `store/db/mysql/memo_relation.go` and `store/db/sqlite/memo_relation.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/mysql/memo_relation.go:57` 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) store/db/mysql/memo_relation.go:65 — store/db/mysql/memo_relation.go:65-71 | store/db/sqlite/memo_relation.go:72-78 — `store/db/mysql/memo_relation.go` and `store/db/sqlite/memo_relation.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/mysql/memo_relation.go:65` 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) store/db/mysql/memo_relation.go:81 — store/db/mysql/memo_relation.go:81-88 | store/db/sqlite/memo_relation.go:86-92 — `store/db/mysql/memo_relation.go` and `store/db/sqlite/memo_relation.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/mysql/memo_relation.go:81` 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) store/db/mysql/memo_share.go:113 — store/db/mysql/memo_share.go:113-119 | store/db/sqlite/memo_share.go:136-142 — 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) store/db/postgres/memo_relation.go:70 — store/db/postgres/memo_relation.go:70-76 | store/db/sqlite/memo_relation.go:68-74 — `store/db/postgres/memo_relation.go` and `store/db/sqlite/memo_relation.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 69 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/postgres/memo_relation.go:70` 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) store/db/sqlite/memo_relation.go:43 — store/db/sqlite/memo_relation.go:43-49 | store/db/sqlite/memo_relation.go:139-145 — both copies are in the same file, so extract the 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 `store/db/sqlite/memo_relation.go:43` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) store/db/sqlite/reaction.go:29 — store/db/sqlite/reaction.go:29-35 | store/db/sqlite/reaction.go:93-99 — both copies are in the same file, so extract the 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 `store/db/sqlite/reaction.go:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×13
  • Duplicated block (8 lines × 2) internal/email/client.go:92 — internal/email/client.go:92-99 | internal/email/client.go:126-134 — both copies are in the same file, so extract the 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 `internal/email/client.go:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (8 lines × 2) server/router/api/v1/memo_service.go:229 — server/router/api/v1/memo_service.go:229-236 | server/router/api/v1/user_service.go:79-86 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_service.go:229` 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) server/router/api/v1/memo_service.go:314 — server/router/api/v1/memo_service.go:314-321 | server/router/api/v1/memo_service_comments.go:260-267 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_service.go:314` 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) server/router/fileserver/fileserver.go:222 — server/router/fileserver/fileserver.go:222-230 | server/router/fileserver/fileserver.go:269-276 — both copies are in the same file, so extract the 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 `server/router/fileserver/fileserver.go:222` 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 (8 lines × 2) server/router/rss/rss.go:83 — server/router/rss/rss.go:83-90 | server/router/rss/rss.go:127-134 — both copies are in the same file, so extract the 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 `server/router/rss/rss.go:83` 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 (8 lines × 2) store/db/mysql/user_identity.go:163 — store/db/mysql/user_identity.go:163-170 | store/db/sqlite/user_identity.go:141-148 — 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 `store/db/mysql/user_identity.go:163` 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) server/router/api/v1/attachment_service.go:271 — server/router/api/v1/attachment_service.go:271-278 | server/router/api/v1/attachment_service.go:317-324 — both copies are in the same file, so extract the 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 `server/router/api/v1/attachment_service.go:317` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (8 lines × 2) server/router/api/v1/attachment_service.go:279 — server/router/api/v1/attachment_service.go:279-287 | server/router/api/v1/attachment_service.go:374-381 — both copies are in the same file, so extract the 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 `server/router/api/v1/attachment_service.go:279` 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) server/router/api/v1/auth_service_session.go:33 — server/router/api/v1/auth_service_session.go:33-40 | server/router/api/v1/auth_service_session.go:142-149 — both copies are in the same file, so extract the 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 `server/router/api/v1/auth_service_session.go:33` 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) server/router/api/v1/auth_service_session.go:334 — server/router/api/v1/auth_service_session.go:334-341 | server/router/api/v1/auth_service_session.go:343-350 — both copies are in the same file, so extract the 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) server/router/api/v1/memo_service_comments.go:34 — server/router/api/v1/memo_service_comments.go:34-41 | server/router/api/v1/reaction_service.go:31-38 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_service_comments.go: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.
  • Duplicated block (8 lines × 2) store/db/postgres/inbox.go:28 — store/db/postgres/inbox.go:28-36 | store/db/postgres/memo_share.go:22-29 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/postgres/inbox.go:28` 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 (8 lines × 2) store/db/sqlite/inbox.go:30 — store/db/sqlite/inbox.go:30-38 | store/db/sqlite/memo_share.go:24-31 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/sqlite/inbox.go:30` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×11
  • Duplicated block (11 lines × 2) internal/filter/parser.go:315 — internal/filter/parser.go:315-325 | internal/filter/parser.go:349-359 — both copies are in the same file, so extract the 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 `internal/filter/parser.go:315` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) server/router/api/v1/memo_service.go:373 — server/router/api/v1/memo_service.go:373-383 | server/router/api/v1/memo_service.go:546-556 — both copies are in the same file, so extract the 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 `server/router/api/v1/memo_service.go:373` 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 (11 lines × 2) store/db/postgres/user_identity.go:58 — store/db/postgres/user_identity.go:58-68 | store/db/sqlite/user_identity.go:58-68 — 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 `store/db/postgres/user_identity.go:58` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 2) server/router/api/v1/instance_service_validation.go:158 — server/router/api/v1/instance_service_validation.go:158-168 | server/router/api/v1/user_service.go:43-53 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/instance_service_validation.go:158` 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 (11 lines × 2) server/router/api/v1/memo_attachment_service.go:206 — server/router/api/v1/memo_attachment_service.go:206-216 | server/router/api/v1/reaction_service.go:22-32 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_attachment_service.go:206` 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) server/router/api/v1/user_service_identities.go:86 — server/router/api/v1/user_service_identities.go:86-96 | server/router/api/v1/user_service_identities.go:111-121 — both copies are in the same file, so extract the 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 `server/router/api/v1/user_service_identities.go:86` 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) server/router/api/v1/user_service_notifications.go:94 — server/router/api/v1/user_service_notifications.go:94-104 | server/router/api/v1/user_service_notifications.go:165-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/user_service_notifications.go: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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) server/router/api/v1/user_service_stats.go:96 — server/router/api/v1/user_service_stats.go:96-106 | server/router/api/v1/user_service_stats.go:231-241 — both copies are in the same file, so extract the 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 `server/router/api/v1/user_service_stats.go:96` 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) store/db/mysql/attachment.go:77 — store/db/mysql/attachment.go:77-87 | store/db/sqlite/attachment.go:70-80 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/mysql/attachment.go:77` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) store/db/mysql/memo.go:22 — store/db/mysql/memo.go:22-32 | store/db/sqlite/memo.go:22-32 — 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 `store/db/mysql/memo.go:22` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) store/db/mysql/memo.go:242 — store/db/mysql/memo.go:242-252 | store/db/sqlite/memo.go:220-230 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/mysql/memo.go:242` 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.
D15 · Churn × Complexity Hotspots · Hotspot · ×10
  • Hotspot: web/src/components/PagedMemoList/PagedMemoList.tsx web/src/components/PagedMemoList/PagedMemoList.tsx — web/src/components/PagedMemoList/PagedMemoList.tsx changed 15 times in last 90 days, max complexity 30. 3 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: server/router/api/v1/user_service.go server/router/api/v1/user_service.go — server/router/api/v1/user_service.go changed 9 times in last 90 days, max complexity 32. 3 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: server/router/api/v1/memo_service.go server/router/api/v1/memo_service.go — server/router/api/v1/memo_service.go changed 7 times in last 90 days, max complexity 34. 3 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: web/src/pages/MemoDetail.tsx web/src/pages/MemoDetail.tsx — web/src/pages/MemoDetail.tsx changed 8 times in last 90 days, max complexity 26. 2 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: web/src/components/MemoEditor/index.tsx web/src/components/MemoEditor/index.tsx — web/src/components/MemoEditor/index.tsx changed 9 times in last 90 days, max complexity 21. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: server/router/api/v1/instance_service.go server/router/api/v1/instance_service.go — server/router/api/v1/instance_service.go changed 6 times in last 90 days, max complexity 29. 2 of those changes were fix/bug commits, and the other 4 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: web/src/utils/tag-grammar.ts web/src/utils/tag-grammar.ts — web/src/utils/tag-grammar.ts changed 6 times in last 90 days, max complexity 18. 3 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: internal/markdown/renderer/markdown_renderer.go internal/markdown/renderer/markdown_renderer.go — internal/markdown/renderer/markdown_renderer.go changed 2 times in last 90 days, max complexity 51. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, behind tests written first.
  • Hotspot: web/src/components/ColumnGrid/ColumnGrid.tsx web/src/components/ColumnGrid/ColumnGrid.tsx — web/src/components/ColumnGrid/ColumnGrid.tsx changed 5 times in last 90 days, max complexity 19. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
  • Hotspot: web/src/utils/remark-plugins/remark-tag.ts web/src/utils/remark-plugins/remark-tag.ts — web/src/utils/remark-plugins/remark-tag.ts changed 5 times in last 90 days, max complexity 17. 2 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, cover the area it touches with tests, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time.
D38 · OSV Dependency Vulnerabilities · Medium CVE · ×8
  • Medium CVE: [GHSA redacted] web/pnpm-lock.yaml — dompurify 3.4.1: [GHSA redacted] — dompurify is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin dompurify to 3.4.7 with an `overrides` entry (`pnpm.overrides` for pnpm)). This is 1 of 8 advisories with a published fix this scan raises against dompurify 3.4.1, and their fixed versions do not agree — anything below 3.4.12 still leaves at least one of them open. Take this package to 3.4.12 or later: that is the floor for the package, not this row's target alone. This one row stands for the 9 advisories this scan raises against dompurify 3.4.1: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
  • Medium CVE: GO-2026-5158 go.mod — go.opentelemetry.io/otel 1.43.0 (go.opentelemetry.io/otel/baggage, go.opentelemetry.io/otel/propagation): GO-2026-5158 — go.opentelemetry.io/otel is not a DIRECT requirement of this module: go.mod records it as `// indirect`, pulled in transitively, so raise it in place (run `go get go.opentelemetry.io/otel@v1.44.0`, which updates the require line go.mod already holds for it).
  • Medium CVE: [GHSA redacted] go.mod — golang.org/x/net 0.53.0: [GHSA redacted] — upgrade to 0.55.0. This one row stands for the 7 advisories this scan raises against golang.org/x/net 0.53.0: [GHSA redacted], GO-2026-5025, GO-2026-5026, GO-2026-5027, GO-2026-5029, GO-2026-5030, GO-2026-5942.
  • Medium CVE: GO-2026-5024 go.mod — golang.org/x/sys 0.43.0 (golang.org/x/sys/windows): GO-2026-5024 — golang.org/x/sys is not a DIRECT requirement of this module: go.mod records it as `// indirect`, pulled in transitively, so raise it in place (run `go get golang.org/x/sys@v0.44.0`, which updates the require line go.mod already holds for it).
  • Medium CVE: GO-2026-5970 go.mod — golang.org/x/text 0.36.0 (golang.org/x/text/unicode/norm): GO-2026-5970 — upgrade to 0.39.0
  • Medium CVE: [GHSA redacted] web/pnpm-lock.yaml — mermaid 11.14.0: [GHSA redacted] — this repo declares mermaid ^11.14.0, a range that ALREADY admits the fixed 11.15.0, so there is no manifest edit to make here. Re-resolve the lock so mermaid moves onto 11.15.0 or later; if the flagged 11.14.0 comes back, a dependency is pinning it — upgrade that dependent, or pin mermaid with an `overrides` entry (`pnpm.overrides` for pnpm) so only one copy resolves. This one row stands for the 4 advisories this scan raises against mermaid 11.14.0: [GHSA redacted], [GHSA redacted], [GHSA redacted], [GHSA redacted].
  • Medium CVE: GO-2026-4918 go.mod — stdlib 1.26.2 (net/http): GO-2026-4918 — fixed in Go 1.26.3; pin a build toolchain at or above it (go.mod `toolchain` directive, or your CI's Go version) — the `go` directive is a minimum language version, not the compiler that builds your binaries. This one row stands for the 13 advisories this scan raises against stdlib 1.26.2: GO-2026-4918, GO-2026-4970, GO-2026-4971, GO-2026-4976, GO-2026-4977, GO-2026-4980, GO-2026-4981, GO-2026-4982, GO-2026-4986, GO-2026-5037, GO-2026-5038, GO-2026-5039, GO-2026-5856.
  • Medium CVE: [GHSA redacted] web/pnpm-lock.yaml — uuid 11.1.0: [GHSA redacted] — uuid is not declared in this repo's manifests: it is pulled in transitively, so upgrade the dependency that requires it (or pin uuid to 11.1.1 with an `overrides` entry (`pnpm.overrides` for pnpm)).
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×8
  • Duplicated block (6 lines × 2) server/router/api/v1/memo_service.go:218 — server/router/api/v1/memo_service.go:218-224 | server/router/api/v1/user_service_stats.go:84-89 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_service.go:218` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) store/db/postgres/user_identity.go:80 — store/db/postgres/user_identity.go:80-85 | store/db/postgres/user_identity.go:136-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 `store/db/postgres/user_identity.go:80` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) store/db/mysql/memo.go:218 — store/db/mysql/memo.go:218-223 | store/db/sqlite/memo.go:196-201 — 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 `store/db/mysql/memo.go:218` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) store/db/mysql/user.go:41 — store/db/mysql/user.go:41-46 | store/db/mysql/user.go:116-121 — both copies are in the same file, so extract the 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) store/db/mysql/user.go:90 — store/db/mysql/user.go:90-95 | store/db/sqlite/user.go:88-93 — 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 `store/db/mysql/user.go:90` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) store/db/mysql/user_setting.go:22 — store/db/mysql/user_setting.go:22-27 | store/db/mysql/user_setting.go:61-66 — both copies are in the same file, so extract the 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 `store/db/mysql/user_setting.go:22` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) store/db/sqlite/user.go:25 — store/db/sqlite/user.go:25-30 | store/db/sqlite/user.go:114-119 — both copies are in the same file, so extract the 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) store/db/sqlite/user_setting.go:29 — store/db/sqlite/user_setting.go:29-34 | store/db/sqlite/user_setting.go:73-78 — both copies are in the same file, so extract the 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 `store/db/sqlite/user_setting.go:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D35 · Change Coupling · Change coupling · ×7
  • Change coupling: PreferencesSection.tsx ↔ setting.d.ts web/src/components/Settings/PreferencesSection.tsx — `web/src/components/Settings/PreferencesSection.tsx` and `web/src/types/modules/setting.d.ts` change together 84% of the time (26 of the 31 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking.
  • Change coupling: SignIn.tsx ↔ SignUp.tsx web/src/pages/SignIn.tsx — `web/src/pages/SignIn.tsx` and `web/src/pages/SignUp.tsx` change together 72% of the time (31 of the 43 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking.
  • Change coupling: LocationDisplayView.tsx ↔ RelationListView.tsx web/src/components/MemoMetadata/Location/LocationDisplayView.tsx — `web/src/components/MemoMetadata/Location/LocationDisplayView.tsx` and `web/src/components/MemoMetadata/Relation/RelationListView.tsx` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking.
  • Change coupling: AuthCallback.tsx ↔ SignIn.tsx web/src/pages/AuthCallback.tsx — `web/src/pages/AuthCallback.tsx` and `web/src/pages/SignIn.tsx` change together 56% of the time (10 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking.
  • Change coupling: PasswordSignInForm.tsx ↔ SignUp.tsx web/src/components/PasswordSignInForm.tsx — `web/src/components/PasswordSignInForm.tsx` and `web/src/pages/SignUp.tsx` change together 56% of the time (10 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking.
  • Change coupling: constants.ts ↔ index.tsx web/src/components/MemoContent/constants.ts — `web/src/components/MemoContent/constants.ts` and `web/src/components/MemoContent/index.tsx` 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking.
  • Change coupling: AttachmentListView.tsx ↔ LocationDisplayView.tsx web/src/components/MemoMetadata/Attachment/AttachmentListView.tsx — `web/src/components/MemoMetadata/Attachment/AttachmentListView.tsx` and `web/src/components/MemoMetadata/Location/LocationDisplayView.tsx` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×6
  • Duplicated block (12 lines × 3) store/db/mysql/user_delete.go:32 — store/db/mysql/user_delete.go:32-43 | store/db/postgres/user_delete.go:32-43 | store/db/sqlite/user_delete.go:32-43 — 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 `store/db/mysql/user_delete.go:32` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (12 lines × 3) store/db/mysql/user_delete.go:243 — store/db/mysql/user_delete.go:243-254 | store/db/postgres/user_delete.go:206-217 | store/db/sqlite/user_delete.go:206-217 — 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 `store/db/mysql/user_delete.go:243` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (12 lines × 3) store/db/mysql/user_delete.go:279 — store/db/mysql/user_delete.go:279-290 | store/db/postgres/user_delete.go:242-253 | store/db/sqlite/user_delete.go:242-253 — 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 `store/db/mysql/user_delete.go:279` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (12 lines × 3) store/db/mysql/user_delete.go:306 — store/db/mysql/user_delete.go:306-317 | store/db/postgres/user_delete.go:269-280 | store/db/sqlite/user_delete.go:269-280 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 3) store/db/mysql/user_delete.go:322 — store/db/mysql/user_delete.go:322-333 | store/db/postgres/user_delete.go:285-296 | store/db/sqlite/user_delete.go:285-296 — 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 `store/db/mysql/user_delete.go:322` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (12 lines × 3) store/db/mysql/user_setting.go:33 — store/db/mysql/user_setting.go:33-44 | store/db/postgres/user_setting.go:46-57 | store/db/sqlite/user_setting.go:46-57 — 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 `store/db/mysql/user_setting.go:33` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×6
  • Duplicated block (5 lines × 2) store/db/postgres/attachment.go:174 — store/db/postgres/attachment.go:174-179 | store/db/postgres/memo.go:203-207 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/postgres/attachment.go:174` 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) store/db/postgres/memo.go:210 — store/db/postgres/memo.go:210-214 | store/db/postgres/user.go:22-26 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/postgres/memo.go:210` 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) store/db/postgres/memo_relation.go:42 — store/db/postgres/memo_relation.go:42-46 | store/db/postgres/memo_relation.go:154-158 — both copies are in the same file, so extract the 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 `store/db/postgres/memo_relation.go: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.
  • Duplicated block (5 lines × 2) store/db/postgres/user.go:25 — store/db/postgres/user.go:25-29 | store/db/postgres/user.go:104-108 — both copies are in the same file, so extract the 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 `store/db/postgres/user.go:25` 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) store/db/postgres/user.go:31 — store/db/postgres/user.go:31-35 | store/db/postgres/user.go:113-117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/postgres/user.go:31` 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) store/db/postgres/user_setting.go:31 — store/db/postgres/user_setting.go:31-35 | store/db/postgres/user_setting.go:76-80 — both copies are in the same file, so extract the 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 `store/db/postgres/user_setting.go:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×5
  • Duplicated block (12 lines × 2) server/cors.go:42 — server/cors.go:42-54 | server/router/mcp/origin.go:15-26 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) server/router/api/v1/shortcut_service.go:107 — server/router/api/v1/shortcut_service.go:107-118 | server/router/api/v1/shortcut_service.go:296-307 — both copies are in the same file, so extract the 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 `server/router/api/v1/shortcut_service.go:107` 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 (12 lines × 2) server/router/api/v1/shortcut_service.go:230 — server/router/api/v1/shortcut_service.go:230-241 | server/router/api/v1/shortcut_service.go:300-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 `server/router/api/v1/shortcut_service.go:230` 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) store/db/postgres/idp.go:98 — store/db/postgres/idp.go:98-110 | store/db/sqlite/idp.go:99-110 — `store/db/postgres/idp.go` and `store/db/sqlite/idp.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/postgres/idp.go:98` 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 (12 lines × 2) store/db/postgres/inbox.go:128 — store/db/postgres/inbox.go:128-139 | store/db/sqlite/inbox.go:118-129 — 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 `store/db/postgres/inbox.go:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×5
  • Duplicated block (11 lines × 3) store/db/mysql/user_delete.go:109 — store/db/mysql/user_delete.go:109-119 | store/db/postgres/user_delete.go:109-119 | store/db/sqlite/user_delete.go:109-119 — 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 `store/db/mysql/user_delete.go:109` 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 (11 lines × 3) store/db/mysql/user_delete.go:186 — store/db/mysql/user_delete.go:186-196 | store/db/postgres/user_delete.go:149-159 | store/db/sqlite/user_delete.go:149-159 — 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 `store/db/mysql/user_delete.go:186` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (11 lines × 3) server/router/api/v1/user_service_notifications.go:30 — server/router/api/v1/user_service_notifications.go:30-40 | server/router/api/v1/user_service_settings.go:25-37 | server/router/api/v1/user_service_settings.go:181-192 — 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 `server/router/api/v1/user_service_notifications.go:30` 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 (11 lines × 3) store/db/mysql/attachment.go:22 — store/db/mysql/attachment.go:22-32 | store/db/postgres/attachment.go:21-31 | store/db/sqlite/attachment.go:22-32 — 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 `store/db/mysql/attachment.go:22` 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) store/db/mysql/auth_config.go:57 — store/db/mysql/auth_config.go:57-67 | store/db/postgres/auth_config.go:57-67 | store/db/sqlite/auth_config.go:59-69 — 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 `store/db/mysql/auth_config.go:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×4
  • Duplicated block (15 lines × 3) store/db/mysql/instance_setting.go:45 — store/db/mysql/instance_setting.go:45-59 | store/db/postgres/instance_setting.go:52-66 | store/db/sqlite/instance_setting.go:52-66 — 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 `store/db/mysql/instance_setting.go:45` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 3) store/db/mysql/memo_relation.go:110 — store/db/mysql/memo_relation.go:110-124 | store/db/postgres/memo_relation.go:137-151 | store/db/sqlite/memo_relation.go:121-135 — `store/db/mysql/memo_relation.go` and `store/db/sqlite/memo_relation.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/mysql/memo_relation.go:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 3) store/db/mysql/reaction.go:80 — store/db/mysql/reaction.go:80-94 | store/db/postgres/reaction.go:68-82 | store/db/sqlite/reaction.go:75-89 — 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 `store/db/mysql/reaction.go:80` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 3) store/db/mysql/user.go:166 — store/db/mysql/user.go:166-180 | store/db/postgres/user.go:170-184 | store/db/sqlite/user.go:179-193 — 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 `store/db/mysql/user.go:166` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×4
  • Duplicated block (15 lines × 2) internal/filter/parser.go:199 — internal/filter/parser.go:199-213 | internal/filter/parser.go:216-230 — both copies are in the same file, so extract the 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 `internal/filter/parser.go:199` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) server/router/api/v1/attachment_service.go:399 — server/router/api/v1/attachment_service.go:399-413 | server/router/api/v1/shortcut_service.go:342-356 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/attachment_service.go:399` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) store/db/mysql/attachment.go:245 — store/db/mysql/attachment.go:245-259 | store/db/sqlite/attachment.go:225-239 — 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 `store/db/mysql/attachment.go:245` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (15 lines × 2) store/db/postgres/user_setting.go:38 — store/db/postgres/user_setting.go:38-52 | store/db/sqlite/user_setting.go:38-52 — 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 `store/db/postgres/user_setting.go: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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×4
  • Duplicated block (14 lines × 3) store/db/mysql/user_delete.go:358 — store/db/mysql/user_delete.go:358-371 | store/db/postgres/user_delete.go:321-334 | store/db/sqlite/user_delete.go:321-334 — 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 `store/db/mysql/user_delete.go:358` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) store/db/mysql/attachment.go:140 — store/db/mysql/attachment.go:140-153 | store/db/postgres/attachment.go:133-146 | store/db/sqlite/attachment.go:133-146 — 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 `store/db/mysql/attachment.go:140` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 3) store/db/mysql/idp.go:43 — store/db/mysql/idp.go:43-56 | store/db/postgres/idp.go:42-55 | store/db/sqlite/idp.go:45-58 — `store/db/postgres/idp.go` and `store/db/sqlite/idp.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/mysql/idp.go:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (14 lines × 3) store/db/mysql/inbox.go:88 — store/db/mysql/inbox.go:88-101 | store/db/postgres/inbox.go:79-92 | store/db/sqlite/inbox.go:80-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×4
  • Duplicated block (14 lines × 2) store/db/mysql/memo.go:112 — store/db/mysql/memo.go:112-125 | store/db/sqlite/memo.go:104-117 — 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 `store/db/mysql/memo.go:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14 lines × 2) store/db/mysql/user_setting.go:96 — store/db/mysql/user_setting.go:96-109 | store/db/sqlite/user_setting.go:112-125 — 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 `store/db/mysql/user_setting.go:96` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) store/db/postgres/memo_relation.go:112 — store/db/postgres/memo_relation.go:112-125 | store/db/sqlite/memo_relation.go:96-109 — `store/db/postgres/memo_relation.go` and `store/db/sqlite/memo_relation.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 69 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
  • Duplicated block (14 lines × 2) store/db/postgres/user.go:61 — store/db/postgres/user.go:61-74 | store/db/sqlite/user.go:61-74 — 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 `store/db/postgres/user.go:61` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×4
  • Duplicated block (10 lines × 3) store/db/mysql/user_delete.go:444 — store/db/mysql/user_delete.go:444-453 | store/db/postgres/user_delete.go:407-416 | store/db/sqlite/user_delete.go:407-416 — 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 `store/db/mysql/user_delete.go:444` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 3) server/router/api/v1/idp_service.go:20 — server/router/api/v1/idp_service.go:20-29 | server/router/api/v1/idp_service.go:149-158 | server/router/api/v1/user_service.go:58-67 — 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 `server/router/api/v1/idp_service.go:20` 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 (10 lines × 3) server/router/api/v1/user_service_identities.go:47 — server/router/api/v1/user_service_identities.go:47-56 | server/router/api/v1/user_service_notifications.go:100-110 | server/router/api/v1/user_service_notifications.go:171-181 — 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 `server/router/api/v1/user_service_identities.go:47` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (10 lines × 3) store/db/mysql/auth_config.go:25 — store/db/mysql/auth_config.go:25-34 | store/db/postgres/auth_config.go:25-34 | store/db/sqlite/auth_config.go:27-36 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/mysql/auth_config.go:25` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D2 · Cognitive Complexity · DB.ListInboxes (cognitive 18) · ×3
  • DB.ListInboxes (cognitive 18) store/db/mysql/inbox.go:48 — DB.ListInboxes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • DB.ListInboxes (cognitive 18) store/db/postgres/inbox.go:38 — DB.ListInboxes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • DB.ListInboxes (cognitive 18) store/db/sqlite/inbox.go:40 — DB.ListInboxes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 17, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DB.ApplyAuthenticationConfigMutation (cognitive 17) · ×3
  • DB.ApplyAuthenticationConfigMutation (cognitive 17) store/db/mysql/auth_config.go:23 — DB.ApplyAuthenticationConfigMutation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • DB.ApplyAuthenticationConfigMutation (cognitive 17) store/db/postgres/auth_config.go:23 — DB.ApplyAuthenticationConfigMutation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
  • DB.ApplyAuthenticationConfigMutation (cognitive 17) store/db/sqlite/auth_config.go:25 — DB.ApplyAuthenticationConfigMutation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×3
  • Duplicated block (19 lines × 2) store/db/postgres/idp.go:32 — store/db/postgres/idp.go:32-50 | store/db/sqlite/idp.go:35-53 — `store/db/postgres/idp.go` and `store/db/sqlite/idp.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/postgres/idp.go:32` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (19 lines × 2) store/db/postgres/memo_share.go:103 — store/db/postgres/memo_share.go:103-121 | store/db/sqlite/memo_share.go:105-123 — 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 `store/db/postgres/memo_share.go:103` 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 (19 lines × 2) store/db/postgres/reaction.go:46 — store/db/postgres/reaction.go:46-64 | store/db/sqlite/reaction.go:53-71 — 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 `store/db/postgres/reaction.go:46` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×3
  • Duplicated block (16 lines × 2) store/db/postgres/user_identity.go:22 — store/db/postgres/user_identity.go:22-37 | store/db/sqlite/user_identity.go:22-37 — 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 `store/db/postgres/user_identity.go:22` 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 (16 lines × 2) store/db/postgres/instance_setting.go:34 — store/db/postgres/instance_setting.go:34-49 | store/db/sqlite/instance_setting.go:34-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/postgres/instance_setting.go: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. The matched lines also register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (16 lines × 2) store/db/postgres/memo_relation.go:24 — store/db/postgres/memo_relation.go:24-39 | store/db/sqlite/memo_relation.go:24-39 — `store/db/postgres/memo_relation.go` and `store/db/sqlite/memo_relation.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 69 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/postgres/memo_relation.go:24` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×3
  • Duplicated block (13 lines × 3) store/db/mysql/user_delete.go:65 — store/db/mysql/user_delete.go:65-77 | store/db/postgres/user_delete.go:65-77 | store/db/sqlite/user_delete.go:65-77 — 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 (13 lines × 3) store/db/mysql/user_delete.go:387 — store/db/mysql/user_delete.go:387-399 | store/db/postgres/user_delete.go:350-362 | store/db/sqlite/user_delete.go:350-362 — 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 `store/db/mysql/user_delete.go:387` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 3) store/db/mysql/memo.go:169 — store/db/mysql/memo.go:169-181 | store/db/postgres/memo.go:154-166 | store/db/sqlite/memo.go:160-172 — 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 `store/db/mysql/memo.go:169` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×3
  • Duplicated block (13 lines × 2) server/auth/token.go:147 — server/auth/token.go:147-159 | server/auth/token.go:174-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `server/auth/token.go:147` 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 lines × 2) server/notification/email.go:255 — server/notification/email.go:255-267 | server/router/api/v1/user_service_notifications.go:227-239 — 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 `server/notification/email.go:255` 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 lines × 2) store/db/mysql/attachment.go:106 — store/db/mysql/attachment.go:106-118 | store/db/sqlite/attachment.go:99-111 — 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 `store/db/mysql/attachment.go:106` 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.
D1 · Cyclomatic Complexity · DB.ListMemos (cyclomatic 28) · ×2
  • DB.ListMemos (cyclomatic 28) store/db/mysql/memo.go:62 — DB.ListMemos has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • DB.ListMemos (cyclomatic 28) store/db/sqlite/memo.go:54 — DB.ListMemos has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DB.ListAttachments (cyclomatic 25) · ×2
  • DB.ListAttachments (cyclomatic 25) store/db/mysql/attachment.go:49 — DB.ListAttachments has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • DB.ListAttachments (cyclomatic 25) store/db/sqlite/attachment.go:42 — DB.ListAttachments has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DB.ListUsers (cyclomatic 22) · ×2
  • DB.ListUsers (cyclomatic 22) store/db/mysql/user.go:79 — DB.ListUsers has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • DB.ListUsers (cyclomatic 22) store/db/sqlite/user.go:77 — DB.ListUsers has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DB.ListMemoRelations (cyclomatic 21) · ×2
  • DB.ListMemoRelations (cyclomatic 21) store/db/mysql/memo_relation.go:34 — DB.ListMemoRelations 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.
  • DB.ListMemoRelations (cyclomatic 21) store/db/sqlite/memo_relation.go:41 — DB.ListMemoRelations 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.
D2 · Cognitive Complexity · DB.ListMemos (cognitive 37) · ×2
  • DB.ListMemos (cognitive 37) store/db/mysql/memo.go:62 — DB.ListMemos has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26, loops 11 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • DB.ListMemos (cognitive 37) store/db/sqlite/memo.go:54 — DB.ListMemos has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26, loops 11 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · DB.ListAttachments (cognitive 33) · ×2
  • DB.ListAttachments (cognitive 33) store/db/mysql/attachment.go:49 — DB.ListAttachments has cognitive complexity 33 (threshold 15). Drivers by points: if/else 28, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • DB.ListAttachments (cognitive 33) store/db/sqlite/attachment.go:42 — DB.ListAttachments has cognitive complexity 33 (threshold 15). Drivers by points: if/else 28, loops 5 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DB.ListMemoRelations (cognitive 29) · ×2
  • DB.ListMemoRelations (cognitive 29) store/db/mysql/memo_relation.go:34 — DB.ListMemoRelations has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, loops 9 (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.
  • DB.ListMemoRelations (cognitive 29) store/db/sqlite/memo_relation.go:41 — DB.ListMemoRelations has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20, loops 9 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DB.ListUsers (cognitive 27) · ×2
  • DB.ListUsers (cognitive 27) store/db/mysql/user.go:79 — DB.ListUsers has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 9, boolean chains 1 (nesting depth added 6). Of this number, 23 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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.
  • DB.ListUsers (cognitive 27) store/db/sqlite/user.go:77 — DB.ListUsers has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17, loops 9, boolean chains 1 (nesting depth added 6). Of this number, 23 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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.
D31 · IaC & Container Security · Medium IaC · ×2
  • Medium IaC: CKV_DOCKER_8 scripts/Dockerfile:43 — Ensure the last USER is not root
  • Medium IaC: CKV_DOCKER_2 scripts/Dockerfile:1 — Ensure that HEALTHCHECK instructions have been added to container images
D38 · OSV Dependency Vulnerabilities · Medium vulnerability · ×2
  • Medium vulnerability: [GHSA redacted] go.mod — github.com/google/cel-go 0.28.1: [GHSA redacted] — upgrade to 0.29.0
  • Medium vulnerability: GO-2026-5841 go.mod — github.com/klauspost/compress 1.18.5 (github.com/klauspost/compress/s2): GO-2026-5841 — github.com/klauspost/compress is not a DIRECT requirement of this module: go.mod records it as `// indirect`, pulled in transitively, so raise it in place (run `go get github.com/klauspost/compress@v1.18.7`, which updates the require line go.mod already holds for it).
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×2
  • Duplicated block (20 lines × 3) store/db/mysql/user_identity.go:117 — store/db/mysql/user_identity.go:117-136 | store/db/postgres/user_identity.go:95-114 | store/db/sqlite/user_identity.go:95-114 — 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 `store/db/mysql/user_identity.go:117` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
  • Duplicated block (20 lines × 3) store/db/mysql/memo_share.go:60 — store/db/mysql/memo_share.go:60-79 | store/db/postgres/memo_share.go:47-66 | store/db/sqlite/memo_share.go:49-68 — 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 `store/db/mysql/memo_share.go:60` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×2
  • Duplicated block (9 lines × 3) server/router/api/v1/instance_service.go:181 — server/router/api/v1/instance_service.go:181-189 | server/router/api/v1/instance_service.go:257-265 | server/router/api/v1/instance_stats.go:48-56 — 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 `server/router/api/v1/instance_service.go:181` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 3) store/db/mysql/user_delete.go:518 — store/db/mysql/user_delete.go:518-526 | store/db/postgres/user_delete.go:481-489 | store/db/sqlite/user_delete.go:481-489 — 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 `store/db/mysql/user_delete.go:518` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×2
  • Duplicated block (8 lines × 4) server/router/api/v1/instance_service.go:143 — server/router/api/v1/instance_service.go:143-150 | server/router/api/v1/instance_service.go:182-189 | server/router/api/v1/instance_service.go:258-265 | server/router/api/v1/instance_stats.go:49-56 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/instance_service.go:143` 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 × 4) server/router/api/v1/memo_relation_service.go:29 — server/router/api/v1/memo_relation_service.go:29-36 | server/router/api/v1/memo_share_service.go:37-44 | server/router/api/v1/memo_share_service.go:86-93 | server/router/api/v1/memo_share_service.go:127-134 — there are 4 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 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/memo_relation_service.go:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×2
  • Duplicated block (8 lines × 3) store/db/mysql/user_delete.go:478 — store/db/mysql/user_delete.go:478-485 | store/db/postgres/user_delete.go:441-448 | store/db/sqlite/user_delete.go:441-448 — 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 `store/db/mysql/user_delete.go:478` 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 (8 lines × 3) store/db/mysql/auth_config.go:35 — store/db/mysql/auth_config.go:35-42 | store/db/postgres/auth_config.go:35-42 | store/db/sqlite/auth_config.go:37-44 — 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 `store/db/mysql/auth_config.go:35` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) store/db/mysql/user_delete.go:508 — store/db/mysql/user_delete.go:508-513 | store/db/postgres/user_delete.go:471-476 | store/db/sqlite/user_delete.go:471-476 — 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 (6 lines × 3) store/db/mysql/memo_relation.go:73 — store/db/mysql/memo_relation.go:73-79 | store/db/postgres/memo_relation.go:82-88 | store/db/sqlite/memo_relation.go:80-85 — `store/db/mysql/memo_relation.go` and `store/db/sqlite/memo_relation.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 53 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/mysql/memo_relation.go:73` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
D1 · Cyclomatic Complexity · MarkdownRenderer.renderNode (cyclomatic 51) · ×1
  • MarkdownRenderer.renderNode (cyclomatic 51) internal/markdown/renderer/markdown_renderer.go:34 — MarkdownRenderer.renderNode has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.parseUserAgent (cyclomatic 47) · ×1
  • APIV1Service.parseUserAgent (cyclomatic 47) server/router/api/v1/auth_service_session.go:312 — APIV1Service.parseUserAgent has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.UpdateMemo (cyclomatic 34) · ×1
  • APIV1Service.UpdateMemo (cyclomatic 34) server/router/api/v1/memo_service.go:401 — APIV1Service.UpdateMemo has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.UpdateUser (cyclomatic 32) · ×1
  • APIV1Service.UpdateUser (cyclomatic 32) server/router/api/v1/user_service.go:280 — APIV1Service.UpdateUser has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.CreateAttachment (cyclomatic 31) · ×1
  • APIV1Service.CreateAttachment (cyclomatic 31) server/router/api/v1/attachment_service.go:55 — APIV1Service.CreateAttachment has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · APIV1Service.UpdateInstanceSetting (cyclomatic 29) · ×1
  • APIV1Service.UpdateInstanceSetting (cyclomatic 29) server/router/api/v1/instance_service.go:180 — APIV1Service.UpdateInstanceSetting has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.ListMemos (cyclomatic 29) · ×1
  • APIV1Service.ListMemos (cyclomatic 29) server/router/api/v1/memo_service.go:178 — APIV1Service.ListMemos has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.ListMemoComments (cyclomatic 27) · ×1
  • APIV1Service.ListMemoComments (cyclomatic 27) server/router/api/v1/memo_service_comments.go:136 — APIV1Service.ListMemoComments has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · store.validateAndNormalizeDeploymentInstanceSetting (cyclomatic 27) · ×1
  • store.validateAndNormalizeDeploymentInstanceSetting (cyclomatic 27) store/deployment_config.go:222 — store.validateAndNormalizeDeploymentInstanceSetting has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parser.characterReferenceLength (cyclomatic 26) · ×1
  • parser.characterReferenceLength (cyclomatic 26) internal/markdown/parser/tag.go:189 — parser.characterReferenceLength has cyclomatic complexity 26 (threshold 15). Of this number, 20 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · APIV1Service.CreateMemo (cyclomatic 26) · ×1
  • APIV1Service.CreateMemo (cyclomatic 26) server/router/api/v1/memo_service.go:70 — APIV1Service.CreateMemo has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · APIV1Service.ListAllUserStats (cyclomatic 26) · ×1
  • APIV1Service.ListAllUserStats (cyclomatic 26) server/router/api/v1/user_service_stats.go:56 — APIV1Service.ListAllUserStats has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DB.ListMemos (cyclomatic 26) · ×1
  • DB.ListMemos (cyclomatic 26) store/db/postgres/memo.go:51 — DB.ListMemos has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · parser.scanTagSegment (cyclomatic 25) · ×1
  • parser.scanTagSegment (cyclomatic 25) internal/markdown/parser/tag.go:97 — parser.scanTagSegment has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · APIV1Service.UpdateUserWebhook (cyclomatic 24) · ×1
  • APIV1Service.UpdateUserWebhook (cyclomatic 24) server/router/api/v1/user_service_webhooks.go:106 — APIV1Service.UpdateUserWebhook has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DB.ListAttachments (cyclomatic 24) · ×1
  • DB.ListAttachments (cyclomatic 24) store/db/postgres/attachment.go:40 — DB.ListAttachments has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.normalizeMemoAttachmentRequest (cyclomatic 23) · ×1
  • APIV1Service.normalizeMemoAttachmentRequest (cyclomatic 23) server/router/api/v1/memo_attachment_service.go:102 — APIV1Service.normalizeMemoAttachmentRequest has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.UpdateUserSetting (cyclomatic 23) · ×1
  • APIV1Service.UpdateUserSetting (cyclomatic 23) server/router/api/v1/user_service_settings.go:53 — APIV1Service.UpdateUserSetting has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DB.ListMemoRelations (cyclomatic 23) · ×1
  • DB.ListMemoRelations (cyclomatic 23) store/db/postgres/memo_relation.go:41 — DB.ListMemoRelations has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filter.evaluateNumeric (cyclomatic 22) · ×1
  • filter.evaluateNumeric (cyclomatic 22) internal/filter/parser.go:517 — filter.evaluateNumeric has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.getInstanceSettingByName (cyclomatic 22) · ×1
  • APIV1Service.getInstanceSettingByName (cyclomatic 22) server/router/api/v1/instance_service.go:94 — APIV1Service.getInstanceSettingByName has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.prepareInstanceAISettingForUpdate (cyclomatic 22) · ×1
  • APIV1Service.prepareInstanceAISettingForUpdate (cyclomatic 22) server/router/api/v1/instance_service_validation.go:28 — APIV1Service.prepareInstanceAISettingForUpdate has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.CreateMemoComment (cyclomatic 22) · ×1
  • APIV1Service.CreateMemoComment (cyclomatic 22) server/router/api/v1/memo_service_comments.go:20 — APIV1Service.CreateMemoComment has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · APIV1Service.batchConvertMemoRelations (cyclomatic 22) · ×1
  • APIV1Service.batchConvertMemoRelations (cyclomatic 22) server/router/api/v1/memo_service_converter.go:173 — APIV1Service.batchConvertMemoRelations has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.CreateUser (cyclomatic 22) · ×1
  • APIV1Service.CreateUser (cyclomatic 22) server/router/api/v1/user_service.go:182 — APIV1Service.CreateUser has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RSSService.generateRSSFromMemoList (cyclomatic 22) · ×1
  • RSSService.generateRSSFromMemoList (cyclomatic 22) server/router/rss/rss.go:170 — RSSService.generateRSSFromMemoList has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filter.buildCallCondition (cyclomatic 21) · ×1
  • filter.buildCallCondition (cyclomatic 21) internal/filter/parser.go:48 — filter.buildCallCondition has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · scheduler.parseField (cyclomatic 21) · ×1
  • scheduler.parseField (cyclomatic 21) internal/scheduler/parser.go:130 — scheduler.parseField has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · filter.compareLiterals (cyclomatic 20) · ×1
  • filter.compareLiterals (cyclomatic 20) internal/filter/parser.go:197 — filter.compareLiterals has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · service.GenerateSnippet (cyclomatic 20) · ×1
  • service.GenerateSnippet (cyclomatic 20) internal/markdown/markdown.go:295 — service.GenerateSnippet has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 304). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · FileServerService.checkAttachmentPermission (cyclomatic 20) · ×1
  • FileServerService.checkAttachmentPermission (cyclomatic 20) server/router/fileserver/fileserver.go:650 — FileServerService.checkAttachmentPermission has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · store.validateDeploymentIdentityProvider (cyclomatic 20) · ×1
  • store.validateDeploymentIdentityProvider (cyclomatic 20) store/deployment_config.go:158 — store.validateDeploymentIdentityProvider has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DB.ListUsers (cyclomatic 20) · ×1
  • DB.ListUsers (cyclomatic 20) store/db/postgres/user.go:77 — DB.ListUsers has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · APIV1Service.UpdateIdentityProvider (cyclomatic 19) · ×1
  • APIV1Service.UpdateIdentityProvider (cyclomatic 19) server/router/api/v1/idp_service.go:80 — APIV1Service.UpdateIdentityProvider has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · filter.buildValueExpr (cyclomatic 18) · ×1
  • filter.buildValueExpr (cyclomatic 18) internal/filter/parser.go:378 — filter.buildValueExpr has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · v1.handleSSE (cyclomatic 18) · ×1
  • v1.handleSSE (cyclomatic 18) server/router/api/v1/sse_handler.go:36 — v1.handleSSE has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.Transcribe (cyclomatic 18) · ×1
  • APIV1Service.Transcribe (cyclomatic 18) server/router/api/v1/ai_service.go:48 — APIV1Service.Transcribe has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · APIV1Service.UpdateShortcut (cyclomatic 18) · ×1
  • APIV1Service.UpdateShortcut (cyclomatic 18) server/router/api/v1/shortcut_service.go:211 — APIV1Service.UpdateShortcut has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Store.validateAuthenticationMutationState (cyclomatic 18) · ×1
  • Store.validateAuthenticationMutationState (cyclomatic 18) store/auth_config.go:88 — Store.validateAuthenticationMutationState has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · audio.WebMOpusToWAV (cyclomatic 17) · ×1
  • audio.WebMOpusToWAV (cyclomatic 17) internal/ai/audio/webm.go:40 — audio.WebMOpusToWAV has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IdentityProvider.UserInfo (cyclomatic 17) · ×1
  • IdentityProvider.UserInfo (cyclomatic 17) internal/idp/oauth2/oauth2.go:83 — IdentityProvider.UserInfo has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · APIV1Service.GetUserStats (cyclomatic 17) · ×1
  • APIV1Service.GetUserStats (cyclomatic 17) server/router/api/v1/user_service_stats.go:191 — APIV1Service.GetUserStats has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · store.normalizeDeploymentAISetting (cyclomatic 17) · ×1
  • store.normalizeDeploymentAISetting (cyclomatic 17) store/deployment_config.go:290 — store.normalizeDeploymentAISetting has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Store.deleteAttachmentStorageImpl (cyclomatic 17) · ×1
  • Store.deleteAttachmentStorageImpl (cyclomatic 17) store/attachment.go:202 — Store.deleteAttachmentStorageImpl has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 225, 211). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · service.ExtractAll (cyclomatic 16) · ×1
  • service.ExtractAll (cyclomatic 16) internal/markdown/markdown.go:398 — service.ExtractAll has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 412). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · EmailDispatcher.DispatchInboxEmail (cyclomatic 16) · ×1
  • EmailDispatcher.DispatchInboxEmail (cyclomatic 16) server/notification/email.go:40 — EmailDispatcher.DispatchInboxEmail has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · v1.SaveAttachmentBlob (cyclomatic 16) · ×1
  • v1.SaveAttachmentBlob (cyclomatic 16) server/router/api/v1/attachment_service_storage.go:47 — v1.SaveAttachmentBlob has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · APIV1Service.DeleteMemo (cyclomatic 16) · ×1
  • APIV1Service.DeleteMemo (cyclomatic 16) server/router/api/v1/memo_service.go:518 — APIV1Service.DeleteMemo has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · APIV1Service.DeleteUser (cyclomatic 16) · ×1
  • APIV1Service.DeleteUser (cyclomatic 16) server/router/api/v1/user_service.go:395 — APIV1Service.DeleteUser has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Store.LoadDeploymentConfigurationDir (cyclomatic 16) · ×1
  • Store.LoadDeploymentConfigurationDir (cyclomatic 16) store/deployment_config.go:43 — Store.LoadDeploymentConfigurationDir has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Store.validateDeploymentAuthenticationState (cyclomatic 16) · ×1
  • Store.validateDeploymentAuthenticationState (cyclomatic 16) store/deployment_config.go:336 — Store.validateDeploymentAuthenticationState 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.
D2 · Cognitive Complexity · APIV1Service.parseUserAgent (cognitive 80) · ×1
  • APIV1Service.parseUserAgent (cognitive 80) server/router/api/v1/auth_service_session.go:312 — APIV1Service.parseUserAgent has cognitive complexity 80 (threshold 15). Drivers by points: if/else 74, boolean chains 6 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkdownRenderer.renderNode (cognitive 62) · ×1
  • MarkdownRenderer.renderNode (cognitive 62) internal/markdown/renderer/markdown_renderer.go:34 — MarkdownRenderer.renderNode has cognitive complexity 62 (threshold 15). Drivers by points: if/else 58, boolean chains 3, match/switch 1 (nesting depth added 30). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · APIV1Service.ListAllUserStats (cognitive 59) · ×1
  • APIV1Service.ListAllUserStats (cognitive 59) server/router/api/v1/user_service_stats.go:56 — APIV1Service.ListAllUserStats has cognitive complexity 59 (threshold 15). Drivers by points: if/else 52, loops 7 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.UpdateMemo (cognitive 54) · ×1
  • APIV1Service.UpdateMemo (cognitive 54) server/router/api/v1/memo_service.go:401 — APIV1Service.UpdateMemo has cognitive complexity 54 (threshold 15). Drivers by points: if/else 51, boolean chains 2, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.UpdateUser (cognitive 48) · ×1
  • APIV1Service.UpdateUser (cognitive 48) server/router/api/v1/user_service.go:280 — APIV1Service.UpdateUser has cognitive complexity 48 (threshold 15). Drivers by points: if/else 43, boolean chains 2, match/switch 2, loops 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.
D2 · Cognitive Complexity · APIV1Service.CreateUser (cognitive 43) · ×1
  • APIV1Service.CreateUser (cognitive 43) server/router/api/v1/user_service.go:182 — APIV1Service.CreateUser has cognitive complexity 43 (threshold 15). Drivers by points: if/else 41, 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.
D2 · Cognitive Complexity · APIV1Service.GetUserStats (cognitive 42) · ×1
  • APIV1Service.GetUserStats (cognitive 42) server/router/api/v1/user_service_stats.go:191 — APIV1Service.GetUserStats has cognitive complexity 42 (threshold 15). Drivers by points: if/else 39, loops 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.UpdateUserWebhook (cognitive 42) · ×1
  • APIV1Service.UpdateUserWebhook (cognitive 42) server/router/api/v1/user_service_webhooks.go:106 — APIV1Service.UpdateUserWebhook has cognitive complexity 42 (threshold 15). Drivers by points: if/else 35, loops 3, match/switch 3, boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.ListMemos (cognitive 41) · ×1
  • APIV1Service.ListMemos (cognitive 41) server/router/api/v1/memo_service.go:178 — APIV1Service.ListMemos has cognitive complexity 41 (threshold 15). Drivers by points: if/else 35, loops 6 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · store.validateAndNormalizeDeploymentInstanceSetting (cognitive 41) · ×1
  • store.validateAndNormalizeDeploymentInstanceSetting (cognitive 41) store/deployment_config.go:222 — store.validateAndNormalizeDeploymentInstanceSetting has cognitive complexity 41 (threshold 15). Drivers by points: if/else 33, boolean chains 4, loops 3, match/switch 1 (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · APIV1Service.CreateAttachment (cognitive 40) · ×1
  • APIV1Service.CreateAttachment (cognitive 40) server/router/api/v1/attachment_service.go:55 — APIV1Service.CreateAttachment has cognitive complexity 40 (threshold 15). Drivers by points: if/else 38, boolean chains 2 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · APIV1Service.normalizeMemoAttachmentRequest (cognitive 37) · ×1
  • APIV1Service.normalizeMemoAttachmentRequest (cognitive 37) server/router/api/v1/memo_attachment_service.go:102 — APIV1Service.normalizeMemoAttachmentRequest has cognitive complexity 37 (threshold 15). Drivers by points: if/else 26, loops 6, boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.batchConvertMemoRelations (cognitive 36) · ×1
  • APIV1Service.batchConvertMemoRelations (cognitive 36) server/router/api/v1/memo_service_converter.go:173 — APIV1Service.batchConvertMemoRelations has cognitive complexity 36 (threshold 15). Drivers by points: if/else 27, loops 8, boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RSSService.generateRSSFromMemoList (cognitive 36) · ×1
  • RSSService.generateRSSFromMemoList (cognitive 36) server/router/rss/rss.go:170 — RSSService.generateRSSFromMemoList has cognitive complexity 36 (threshold 15). Drivers by points: if/else 27, loops 7, 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.
D2 · Cognitive Complexity · APIV1Service.prepareInstanceAISettingForUpdate (cognitive 35) · ×1
  • APIV1Service.prepareInstanceAISettingForUpdate (cognitive 35) server/router/api/v1/instance_service_validation.go:28 — APIV1Service.prepareInstanceAISettingForUpdate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 28, boolean chains 4, loops 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DB.ListMemoRelations (cognitive 35) · ×1
  • DB.ListMemoRelations (cognitive 35) store/db/postgres/memo_relation.go:41 — DB.ListMemoRelations has cognitive complexity 35 (threshold 15). Drivers by points: if/else 26, loops 9 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.UpdateInstanceSetting (cognitive 34) · ×1
  • APIV1Service.UpdateInstanceSetting (cognitive 34) server/router/api/v1/instance_service.go:180 — APIV1Service.UpdateInstanceSetting has cognitive complexity 34 (threshold 15). Drivers by points: if/else 28, boolean chains 5, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.ListMemoComments (cognitive 33) · ×1
  • APIV1Service.ListMemoComments (cognitive 33) server/router/api/v1/memo_service_comments.go:136 — APIV1Service.ListMemoComments has cognitive complexity 33 (threshold 15). Drivers by points: if/else 26, loops 7 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Runner.CheckAndPresign (cognitive 33) · ×1
  • Runner.CheckAndPresign (cognitive 33) server/runner/s3presign/runner.go:47 — Runner.CheckAndPresign has cognitive complexity 33 (threshold 15). Drivers by points: if/else 30, loops 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DB.ListMemos (cognitive 33) · ×1
  • DB.ListMemos (cognitive 33) store/db/postgres/memo.go:51 — DB.ListMemos has cognitive complexity 33 (threshold 15). Drivers by points: if/else 26, loops 7 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · APIV1Service.UpdateShortcut (cognitive 31) · ×1
  • APIV1Service.UpdateShortcut (cognitive 31) server/router/api/v1/shortcut_service.go:211 — APIV1Service.UpdateShortcut has cognitive complexity 31 (threshold 15). Drivers by points: if/else 25, loops 4, boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DB.ListAttachments (cognitive 31) · ×1
  • DB.ListAttachments (cognitive 31) store/db/postgres/attachment.go:40 — DB.ListAttachments has cognitive complexity 31 (threshold 15). Drivers by points: if/else 28, loops 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Store.deleteAttachmentStorageImpl (cognitive 31) · ×1
  • Store.deleteAttachmentStorageImpl (cognitive 31) store/attachment.go:202 — Store.deleteAttachmentStorageImpl has cognitive complexity 31 (threshold 15). Drivers by points: if/else 30, boolean chains 1 (nesting depth added 15). Most of this is not in the body itself: 8 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 225, 211). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · APIV1Service.UpdateUserSetting (cognitive 30) · ×1
  • APIV1Service.UpdateUserSetting (cognitive 30) server/router/api/v1/user_service_settings.go:53 — APIV1Service.UpdateUserSetting has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18, match/switch 7, loops 4, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · httpgetter.extractHTMLMeta (cognitive 29) · ×1
  • httpgetter.extractHTMLMeta (cognitive 29) internal/httpgetter/html_meta.go:160 — httpgetter.extractHTMLMeta has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Store.LoadDeploymentConfigurationDir (cognitive 29) · ×1
  • Store.LoadDeploymentConfigurationDir (cognitive 29) store/deployment_config.go:43 — Store.LoadDeploymentConfigurationDir has cognitive complexity 29 (threshold 15). Drivers by points: if/else 26, match/switch 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filter.buildValueExpr (cognitive 28) · ×1
  • filter.buildValueExpr (cognitive 28) internal/filter/parser.go:378 — filter.buildValueExpr has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, match/switch 2, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.scanTagSegment (cognitive 28) · ×1
  • parser.scanTagSegment (cognitive 28) internal/markdown/parser/tag.go:97 — parser.scanTagSegment has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13, boolean chains 8, match/switch 4, loops 2, jumps 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · v1.SaveAttachmentBlob (cognitive 28) · ×1
  • v1.SaveAttachmentBlob (cognitive 28) server/router/api/v1/attachment_service_storage.go:47 — v1.SaveAttachmentBlob has cognitive complexity 28 (threshold 15). Drivers by points: if/else 28 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.CreateMemo (cognitive 28) · ×1
  • APIV1Service.CreateMemo (cognitive 28) server/router/api/v1/memo_service.go:70 — APIV1Service.CreateMemo has cognitive complexity 28 (threshold 15). Drivers by points: if/else 25, boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · APIV1Service.bindSSOIdentityToUser (cognitive 27) · ×1
  • APIV1Service.bindSSOIdentityToUser (cognitive 27) server/router/api/v1/auth_service_sso.go:207 — APIV1Service.bindSSOIdentityToUser has cognitive complexity 27 (threshold 15). Drivers by points: if/else 27 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filter.evaluateNumeric (cognitive 26) · ×1
  • filter.evaluateNumeric (cognitive 26) internal/filter/parser.go:517 — filter.evaluateNumeric has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, match/switch 5 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · renderer.renderJSONBoolComparison (cognitive 26) · ×1
  • renderer.renderJSONBoolComparison (cognitive 26) internal/filter/render.go:357 — renderer.renderJSONBoolComparison has cognitive complexity 26 (threshold 15). Drivers by points: if/else 23, match/switch 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · v1.handleSSE (cognitive 26) · ×1
  • v1.handleSSE (cognitive 26) server/router/api/v1/sse_handler.go:36 — v1.handleSSE has cognitive complexity 26 (threshold 15). Drivers by points: if/else 21, match/switch 4, 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.
D2 · Cognitive Complexity · store.normalizeDeploymentAISetting (cognitive 25) · ×1
  • store.normalizeDeploymentAISetting (cognitive 25) store/deployment_config.go:290 — store.normalizeDeploymentAISetting has cognitive complexity 25 (threshold 15). Drivers by points: if/else 20, boolean chains 2, match/switch 2, 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.
D2 · Cognitive Complexity · audio.WebMOpusToWAV (cognitive 24) · ×1
  • audio.WebMOpusToWAV (cognitive 24) internal/ai/audio/webm.go:40 — audio.WebMOpusToWAV has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16, loops 6, boolean chains 2 (nesting depth added 8). Of this number, 18 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filter.buildComparisonCondition (cognitive 23) · ×1
  • filter.buildComparisonCondition (cognitive 23) internal/filter/parser.go:119 — filter.buildComparisonCondition has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filter.buildInCondition (cognitive 23) · ×1
  • filter.buildInCondition (cognitive 23) internal/filter/parser.go:262 — filter.buildInCondition has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19, loops 3, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parser.characterReferenceLength (cognitive 23) · ×1
  • parser.characterReferenceLength (cognitive 23) internal/markdown/parser/tag.go:189 — parser.characterReferenceLength has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 8, loops 3 (nesting depth added 3). Of this number, 18 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · APIV1Service.GetAttachmentBlob (cognitive 23) · ×1
  • APIV1Service.GetAttachmentBlob (cognitive 23) server/router/api/v1/attachment_service_storage.go:133 — APIV1Service.GetAttachmentBlob has cognitive complexity 23 (threshold 15). Drivers by points: if/else 23 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DB.ListUsers (cognitive 23) · ×1
  • DB.ListUsers (cognitive 23) store/db/postgres/user.go:77 — DB.ListUsers has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17, loops 5, boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · service.GenerateSnippet (cognitive 22) · ×1
  • service.GenerateSnippet (cognitive 22) internal/markdown/markdown.go:295 — service.GenerateSnippet has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14, match/switch 7, boolean chains 1 (nesting depth added 7). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 304). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · Profile.Validate (cognitive 22) · ×1
  • Profile.Validate (cognitive 22) internal/profile/profile.go:70 — Profile.Validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · store.validateDeploymentIdentityProvider (cognitive 22) · ×1
  • store.validateDeploymentIdentityProvider (cognitive 22) store/deployment_config.go:158 — store.validateDeploymentIdentityProvider has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16, boolean chains 3, loops 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · filter.buildCallCondition (cognitive 21) · ×1
  • filter.buildCallCondition (cognitive 21) internal/filter/parser.go:48 — filter.buildCallCondition has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · APIV1Service.getInstanceSettingByName (cognitive 21) · ×1
  • APIV1Service.getInstanceSettingByName (cognitive 21) server/router/api/v1/instance_service.go:94 — APIV1Service.getInstanceSettingByName has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17, boolean chains 3, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.CreateMemoComment (cognitive 21) · ×1
  • APIV1Service.CreateMemoComment (cognitive 21) server/router/api/v1/memo_service_comments.go:20 — APIV1Service.CreateMemoComment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19, boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · APIV1Service.DeleteUser (cognitive 21) · ×1
  • APIV1Service.DeleteUser (cognitive 21) server/router/api/v1/user_service.go:395 — APIV1Service.DeleteUser has cognitive complexity 21 (threshold 15). Drivers by points: if/else 18, boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IdentityProvider.UserInfo (cognitive 20) · ×1
  • IdentityProvider.UserInfo (cognitive 20) internal/idp/oauth2/oauth2.go:83 — IdentityProvider.UserInfo has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · scheduler.parseField (cognitive 20) · ×1
  • scheduler.parseField (cognitive 20) internal/scheduler/parser.go:130 — scheduler.parseField has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14, boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.SignIn (cognitive 20) · ×1
  • APIV1Service.SignIn (cognitive 20) server/router/api/v1/auth_service.go:51 — APIV1Service.SignIn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 19, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.UpdateIdentityProvider (cognitive 20) · ×1
  • APIV1Service.UpdateIdentityProvider (cognitive 20) server/router/api/v1/idp_service.go:80 — APIV1Service.UpdateIdentityProvider has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 2, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · APIV1Service.parseMemoOrderBy (cognitive 20) · ×1
  • APIV1Service.parseMemoOrderBy (cognitive 20) server/router/api/v1/memo_service_query.go:11 — APIV1Service.parseMemoOrderBy has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileServerService.checkAttachmentPermission (cognitive 20) · ×1
  • FileServerService.checkAttachmentPermission (cognitive 20) server/router/fileserver/fileserver.go:650 — FileServerService.checkAttachmentPermission has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Store.validateAuthenticationMutationState (cognitive 20) · ×1
  • Store.validateAuthenticationMutationState (cognitive 20) store/auth_config.go:88 — Store.validateAuthenticationMutationState has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, loops 5, 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.
D2 · Cognitive Complexity · v1.canonicalGatewayPattern (cognitive 19) · ×1
  • v1.canonicalGatewayPattern (cognitive 19) server/router/api/v1/gateway_route_resolver.go:152 — v1.canonicalGatewayPattern has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13, boolean chains 3, match/switch 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.BatchDeleteAttachments (cognitive 19) · ×1
  • APIV1Service.BatchDeleteAttachments (cognitive 19) server/router/api/v1/attachment_service.go:343 — APIV1Service.BatchDeleteAttachments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17, 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.
D2 · Cognitive Complexity · mcp.buildAPIRequest (cognitive 19) · ×1
  • mcp.buildAPIRequest (cognitive 19) server/router/mcp/adapter.go:46 — mcp.buildAPIRequest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Store.validateDeploymentAuthenticationState (cognitive 19) · ×1
  • Store.validateDeploymentAuthenticationState (cognitive 19) store/deployment_config.go:336 — Store.validateDeploymentAuthenticationState has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 3, 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.
D2 · Cognitive Complexity · Store.applyMigrations (cognitive 19) · ×1
  • Store.applyMigrations (cognitive 19) store/migrator.go:140 — Store.applyMigrations has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.convertInboxToUserNotificationWithUsersAndMemos (cognitive 18) · ×1
  • APIV1Service.convertInboxToUserNotificationWithUsersAndMemos (cognitive 18) server/router/api/v1/user_service_notifications.go:242 — APIV1Service.convertInboxToUserNotificationWithUsersAndMemos has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Store.DeleteAttachments (cognitive 18) · ×1
  • Store.DeleteAttachments (cognitive 18) store/attachment.go:151 — Store.DeleteAttachments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, 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.
D2 · Cognitive Complexity · filter.buildSetCondition (cognitive 17) · ×1
  • filter.buildSetCondition (cognitive 17) internal/filter/parser.go:707 — filter.buildSetCondition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, 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.
D2 · Cognitive Complexity · APIV1Service.Transcribe (cognitive 17) · ×1
  • APIV1Service.Transcribe (cognitive 17) server/router/api/v1/ai_service.go:48 — APIV1Service.Transcribe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · APIV1Service.GetMemo (cognitive 17) · ×1
  • APIV1Service.GetMemo (cognitive 17) server/router/api/v1/memo_service.go:341 — APIV1Service.GetMemo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · APIV1Service.DeleteMemo (cognitive 17) · ×1
  • APIV1Service.DeleteMemo (cognitive 17) server/router/api/v1/memo_service.go:518 — APIV1Service.DeleteMemo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 15, boolean chains 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · APIV1Service.ListUsers (cognitive 17) · ×1
  • APIV1Service.ListUsers (cognitive 17) server/router/api/v1/user_service.go:55 — APIV1Service.ListUsers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mcp.validateObjectSchema (cognitive 17) · ×1
  • mcp.validateObjectSchema (cognitive 17) server/router/mcp/validation.go:75 — mcp.validateObjectSchema has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11, loops 4, boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mysql.listDeleteUserMemoTreeIterative (cognitive 17) · ×1
  • mysql.listDeleteUserMemoTreeIterative (cognitive 17) store/db/mysql/user_delete.go:133 — mysql.listDeleteUserMemoTreeIterative has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, loops 7 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · email.init (cognitive 16) · ×1
  • email.init (cognitive 16) internal/email/email.go:16 — email.init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 1 (nesting depth added 10). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 18). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · extensions.replaceUnparsedGFMURLs (cognitive 16) · ×1
  • extensions.replaceUnparsedGFMURLs (cognitive 16) internal/markdown/extensions/gfm.go:170 — extensions.replaceUnparsedGFMURLs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 3, boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · service.ExtractAll (cognitive 16) · ×1
  • service.ExtractAll (cognitive 16) internal/markdown/markdown.go:398 — service.ExtractAll has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 412). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · APIV1Service.UpdateAttachment (cognitive 16) · ×1
  • APIV1Service.UpdateAttachment (cognitive 16) server/router/api/v1/attachment_service.go:263 — APIV1Service.UpdateAttachment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13, boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · APIV1Service.setMemoAttachmentsInternal (cognitive 16) · ×1
  • APIV1Service.setMemoAttachmentsInternal (cognitive 16) server/router/api/v1/memo_attachment_service.go:53 — APIV1Service.setMemoAttachmentsInternal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · APIV1Service.ListUserNotifications (cognitive 16) · ×1
  • APIV1Service.ListUserNotifications (cognitive 16) server/router/api/v1/user_service_notifications.go:20 — APIV1Service.ListUserNotifications has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, 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.
D2 · Cognitive Complexity · APIV1Service.UpdateUserNotification (cognitive 16) · ×1
  • APIV1Service.UpdateUserNotification (cognitive 16) server/router/api/v1/user_service_notifications.go:88 — APIV1Service.UpdateUserNotification has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, match/switch 5, loops 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · mcp.buildOperationRegistry (cognitive 16) · ×1
  • mcp.buildOperationRegistry (cognitive 16) server/router/mcp/openapi.go:73 — mcp.buildOperationRegistry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 3, boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DB.ListReactions (cognitive 16) · ×1
  • DB.ListReactions (cognitive 16) store/db/sqlite/reaction.go:28 — DB.ListReactions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 6 (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.
D36 · Supply-chain Provenance & Signing · Unpinned build actions · ×1
  • Unpinned build actions — CI references GitHub Actions by a floating ref (@main / @tag) rather than a pinned commit SHA, weakening build integrity. 66 floating ref(s) across 7 workflow file(s). Each floating ref is itemized at file:line by the SAST (D29) lens.
D36 · Supply-chain Provenance & Signing · PR-triggered workflow without a permissions block · ×1
  • PR-triggered workflow without a permissions block — 4 workflow(s) triggered by pull_request declare no `permissions:` block (upgrade-smoke.yml, proto-linter.yml, frontend-tests.yml …) and so run with the repository's default GITHUB_TOKEN scope, while 3 sibling workflows in the same repository are already scoped. Pull-request runs build the least-trusted code in the repository; give each of these workflows its own least-privilege block — `permissions: {contents: read}` at the top of the workflow, widened per job only where a job genuinely writes.
D36 · Supply-chain Provenance & Signing · Secret passed as a command-line argument · ×1
  • Secret passed as a command-line argument — 1 CI command(s) pass a credential as a bare command-line argument, where it is visible in the runner's process table to any other process on the host (and to anything that logs a command line): demo-deploy.yml: curl -X POST "${{ secrets.RENDER_DEPLOY_HOOK }}" -H "Content-Type: application/json" -d '{"trigger": "github_action"}'. Pass the credential through the environment instead (an `env:` mapping on the step, read by the tool from its own variable) or on stdin, so it never appears in an argument vector.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) store/db/postgres/user_delete.go:134 — store/db/postgres/user_delete.go:134-156 | store/db/sqlite/user_delete.go:134-156 — `store/db/postgres/user_delete.go` and `store/db/sqlite/user_delete.go` are the same file name in two sibling directories, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 199 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/postgres/user_delete.go:134` 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 register a scope-exit action (a `defer`-style statement) that runs when the function holding them returns: moved into a called unit it would run when THAT unit returns instead — before the caller uses what it releases — so keep the registration at the call site and extract only the work around it, or have the extracted unit hand the resource back for the caller to register.
D4 · Code Duplication · Duplicated block (21 lines × 3) · ×1
  • Duplicated block (21 lines × 3) store/db/mysql/user_delete.go:219 — store/db/mysql/user_delete.go:219-239 | store/db/postgres/user_delete.go:182-202 | store/db/sqlite/user_delete.go:182-202 — 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 `store/db/mysql/user_delete.go:219` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) store/db/mysql/user_identity.go:75 — store/db/mysql/user_identity.go:75-86 | store/db/mysql/user.go:159-170 | store/db/postgres/user.go:59-70 | store/db/postgres/user.go:163-174 | store/db/sqlite/user.go:59-70 | store/db/sqlite/user.go:172-183 — there are 6 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `store/db/mysql/user_identity.go:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11 lines × 4) · ×1
  • Duplicated block (11 lines × 4) store/db/mysql/inbox.go:30 — store/db/mysql/inbox.go:30-41 | store/db/mysql/memo.go:42-52 | store/db/mysql/memo_share.go:24-34 | store/db/mysql/reaction.go:17-27 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once.
D4 · Code Duplication · Duplicated block (10 lines × 6) · ×1
  • Duplicated block (10 lines × 6) store/db/mysql/attachment.go:35 — store/db/mysql/attachment.go:35-45 | store/db/mysql/idp.go:19-29 | store/db/mysql/inbox.go:30-40 | store/db/mysql/memo.go:42-51 | store/db/mysql/memo_share.go:24-33 | store/db/mysql/reaction.go:17-26 — the copies sit in sibling files of one directory: extract the block into a single shared function in that directory and call it from each site, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) server/router/api/v1/attachment_service.go:248 — server/router/api/v1/attachment_service.go:248-256 | server/router/api/v1/attachment_service.go:279-286 | server/router/api/v1/attachment_service.go:374-380 — 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 `server/router/api/v1/attachment_service.go:248` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (6 lines × 13) · ×1
  • Duplicated block (6 lines × 13) server/router/api/v1/attachment_service.go:132 — server/router/api/v1/attachment_service.go:132-137 | server/router/api/v1/memo_attachment_service.go:25-30 | server/router/api/v1/memo_attachment_service.go:202-207 | server/router/api/v1/memo_relation_service.go:25-30 | server/router/api/v1/memo_relation_service.go:95-100 | server/router/api/v1/memo_service_comments.go:22-27 | server/router/api/v1/memo_service_comments.go:64-69 | server/router/api/v1/memo_service_comments.go:138-143 | server/router/api/v1/memo_share_service.go:33-38 | server/router/api/v1/memo_share_service.go:82-87 | server/router/api/v1/reaction_service.go:18-23 | server/router/api/v1/reaction_service.go:71-76 | server/router/api/v1/reaction_service.go:148-153 — there are 13 copies across 6 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 13 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `server/router/api/v1/attachment_service.go:132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) store/db/postgres/memo_share.go:32 — store/db/postgres/memo_share.go:32-37 | store/db/postgres/memo_share.go:88-93 | store/db/postgres/memo_share.go:133-137 — 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 `store/db/postgres/memo_share.go:32` 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.
Recommendation — 12 finding(s)
D38 · OSV Dependency Vulnerabilities · Low CVE · ×2
  • Low CVE: [GHSA redacted] web/pnpm-lock.yaml — @babel/core 7.29.0: [GHSA redacted] — upgrade to 7.29.6
  • Low CVE: [GHSA redacted] go.mod — github.com/disintegration/imaging 1.6.2: [GHSA redacted] — no fixed version has been published yet. Track the advisory, and remove or replace github.com/disintegration/imaging if the exposure is not acceptable until one lands.
D11 · Test Reliability · Test reliability not included · ×1
  • Test reliability not included — Test source is present (.go, .ts, .tsx) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 19 significant file(s) lose their only recent owner: internal/filter/parser.go, internal/filter/schema.go, web/src/components/MemoEditor/hooks/useAudioRecorder.ts, web/src/components/Settings/LinkedIdentitySection.tsx, server/router/api/v1/connect_interceptors.go, web/src/utils/media-item.ts, web/src/components/MemoActionMenu/MemoShareImageDialog.tsx, internal/filter/ir.go (+11 more). Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 2 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (21 single-owned of 309 analysed files in total, counted over production source files of roughly 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first). They are anonymized user #2 (1 file(s)), anonymized user #3 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • Rotate the exposed credentials — git history can't be un-committed — Some of these secrets are in git HISTORY: deleting the file does not remove them (the commit persists on every clone, fork and backup). The remediation is to ROTATE each historically-exposed credential and treat it as compromised — not to delete the file. Rewriting history is disruptive and unreliable across existing forks. (Working-tree-only secrets — no commit — can instead be removed from the file and moved to a secret store.)
D31 · IaC & Container Security · Low IaC · ×1
  • Low IaC: DS-0026 scripts/Dockerfile — No HEALTHCHECK defined Without one the runtime only knows whether the process is alive, not whether it is serving, so a wedged container is restarted by nobody. The step: add a `HEALTHCHECK` to the image that probes the service the way a client would — this image already declares `EXPOSE 5230`, so a request to `localhost:5230` on the service's own health or root route, exiting non-zero when it does not answer, is the probe — and give it an `--interval`, a `--timeout` and a `--start-period` long enough to cover startup. If the image ships no HTTP client, probe with whatever the runtime already has, or declare the check in the orchestrator instead and say so here.
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 6 of 309 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 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first). 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 — largest first: web/src/components/Inbox/MemoMentionMessage.tsx, server/router/api/v1/memo_mention_helpers.go, store/db/postgres/memo_share.go (and 3 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · No build provenance · ×1
  • No build provenance — No SLSA provenance generation or build attestation found in CI — nothing binds a released artifact to the build that produced it, so a consumer cannot tell your artifact from a substituted one. On GitHub Actions, `actions/attest-build-provenance` (or slsa-github-generator) emits one from the job's own OIDC identity; elsewhere, run `cosign attest` over the released artifact from the release pipeline and publish the attestation beside it.
D36 · Supply-chain Provenance & Signing · No artifact signing · ×1
  • No artifact signing — No artifact signing found in CI — sign your released artifacts with whatever your ecosystem ships (a GPG/minisign detached signature — or `cosign sign-blob` — over the release archives, or over a checksum file published alongside them) so consumers can verify what you built.
D36 · Supply-chain Provenance & Signing · No SBOM · ×1
  • No SBOM — No SBOM generation or committed SBOM found — produce one with what your ecosystem ships (`cyclonedx-gomod` over the module graph — or Go's own build info, which already records the module set in the binary, `syft` (or `anchore/sbom-action` in CI) over the source tree or released image). Publish it as a release asset (`*.spdx.json` / `*.cdx.json`) so consumers can see what they are installing.
D8 · Code Coverage · Coverage not included · ×1
  • Coverage not included — suite not readable by the collector — Coverage NOT READ here — but this repository measures it: a coverage step in CI (`go test -v -coverprofile=coverage.out -covermode`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.go, .ts, .tsx), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (`go test -coverprofile=coverage.out ./...`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored.
Info — 2 finding(s)
D12 · Dependency Hygiene · Dependency hygiene not measured · ×1
  • Dependency hygiene not measured — dependency manifest found but not parsed for hygiene — This repository's dependency manifests (a Go module (go.mod/go.sum) and package.json) were found, but this pass cannot parse them for hygiene, so no package was assessed. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. This row is about dependency HYGIENE — outdated, deprecated or unmaintained direct dependencies; known CVEs in the same dependency graph are a separate question, reported under D38 wherever the manifest is OSV-readable.
D22 · Internal API Consistency · No exposed public API · ×1
  • No exposed public API — No intentionally-exposed types (IsPackable or .Contracts) to evaluate.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaksgitleaks detect --no-banner --report-format json --report-path /dev/stdout --exit-code 0 --source .6artifacts/raw/gitleaks-history.json
D29 · Static Analysis (SAST)semgrepsemgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --json --quiet --timeout 0 --metrics off .0
D30 · Dependency Vulnerabilitiesnone (no readable dependency manifest)none (no readable dependency manifest): not present in this environment0
D31 · IaC & Container Securitytrivytrivy config --format json --quiet .3artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrepsemgrep: not applicable — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.0
D33 · JS/npm Dependency Vulnerabilitiestrivytrivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0
D38 · OSV Dependency Vulnerabilitiesosv-scannerosv-scanner --format json --recursive .19artifacts/raw/osv-scanner.json
D40 · Network Egress Confinementruntime-hardeningruntime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0
D41 · Kernel & Syscall Confinementruntime-hardeningruntime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0
D42 · Runtime Threat Enforcementruntime-hardeningruntime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0

Run 019fd57f-9227-7afd-9cd1-31394699836e · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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