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

MODSetter/SurfSense

Measured 17 November 2026, 11:41 UTC, at code version b764f28

First survey, so nothing to compare with yet Code coverage: not measured

Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureTestRunFailed).

CAI score 48.0out of 100 At risk

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

A large codebase: 184,525 lines of product code in 13 projects, tests not counted · Estimated rebuild effort: about 2.3 person-years · Weakest lens: Production Readiness, 28.3

Findings by how serious they are

690 critical 990 serious 148 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 11:41 UTC

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

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

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

87of 87 dimensions measured by tools.
1299of 1828 findings point to an exact file and line, so you can open each one in the code. The other 529 concern the repository as a whole, such as missing documentation.
87dimensions across 8 lenses, read from 184,525 lines of product code in 13 projects.
Chapters

Executive summary

MODSetter/SurfSense is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back in part because it has tests that passed on some runs and failed on others. It scores 48.0 out of 100, which the At risk rating leaves unchanged.

Production Readiness, at 28.3, is the weakest lens and counts most in the score. The best first step for the work it takes is fixing the password or key in the code, worth about 11.3 points. Fixing the 507 tests that passed on some runs and failed on others would lift Production Readiness itself, worth about 16.2 points. Raising Production Readiness to 70 would lift the score to about 63.8.

108 pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Thirty-five known security holes in the packages the code depends on can be used by attackers, and eleven passwords or keys in the code's history and one in the code are open to anyone who can read the repository. Replacing each exposed password or key, pinning each tool to an exact version and updating the vulnerable packages would close these risks. Fixing the weaknesses the scanner points to would fix the nine security weaknesses in the code, and passing outside input through environment variables would deal with the six pipeline steps that put outside input straight into a shell command. The loop of files that import each other needs breaking.

The product code is 184,525 lines, about €340,000 to rebuild.

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

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

If Production Readiness rose from 28.3 to 70, the lowest score rated Strong, the score would rise from 48.0 to about 63.8.

Code composition: what the lines of code are
Product code 55%Tests 45%
Rebuild cost: about €340,000 · Estimate
Cost to rebuild€110,000 to €570,000, for 1,876 to 5,951 hours of work, about 2.3 person-years for 1 to 5 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 48. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 184,525 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Raises the score by about 11.3 points · Low effort · REDACTED Scanning
2
Resolve the 507 Flaky test finding(s) in Test Reliability.
Raises the score by about 16.2 points · High effort · Test Reliability
3
Resolve the 1 finding(s) in DR & Backup.
Raises the score by about 4.5 points · Medium effort · DR & Backup

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €340,000 to build again, about 2.3 person-years of work. Its weakest lens is Production Readiness, at 28.3 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 11.3 points for low effort, because it clears the 1 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort

Architecture — module dependency graph

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

arch surfsense-backend surfsense-backend surfsense-local-backend surfsense-local-backend surfsense-plugin-manifest surfsense-plugin-manifest surfsense-local-backend->surfsense-plugin-manifest surfsense-local-electron surfsense-local-electron surfsense-local-frontend surfsense-local-frontend surfsense-plugin-cli surfsense-plugin-cli surfsense-plugin-cli->surfsense-plugin-manifest surfsense-plugin-sdk surfsense-plugin-sdk surfsense-registry-check surfsense-registry-check

Architecture: which parts of the code depend on which

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

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

The table shows the 40 modules with the most connections; 1074 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 backend.plugins.proprietary.scraping.http2 surfsense_local.backend.modules.agent.agent_threads.turn3 surfsense_local.backend.modules.agent.tool_exposure4 surfsense_local.backend.modules.artifacts.revised_copies.engines5 surfsense_local.backend.modules.embedding.spec6 surfsense_local.backend.modules.llm.catalog.local.build7 surfsense_local.backend.modules.llm.fit.budget8 surfsense_local.backend.modules.llm.profile.types9 surfsense_local.backend.modules.llm.providers.protocols10 surfsense_local.backend.modules.llm.providers.types11 surfsense_local.backend.shared.db12 surfsense_local.backend.worker.studio.shared.artifact13 backend.plugins.proprietary.web_crawl14 surfsense_local.backend.modules.artifacts.models15 surfsense_local.backend.modules.chat.models16 surfsense_local.backend.modules.documents.models17 surfsense_local.backend.modules.embedding18 surfsense_local.backend.modules.llm.catalog.local.install.plan19 surfsense_local.backend.modules.llm.catalog.local.manifest.schema20 surfsense_local.backend.modules.llm.fit21 surfsense_local.backend.modules.llm.models22 surfsense_local.backend.modules.plugins.installed.models23 surfsense_local.backend.api24 surfsense_local.backend.modules.agent25 surfsense_local.backend.modules.agent.previews26 surfsense_local.backend.modules.agent.tool_endpoint27 surfsense_local.backend.modules.chat.schemas28 surfsense_local.backend.modules.llm.catalog.local.engines.llamacpp.rows29 surfsense_local.backend.modules.llm.catalog.local.service30 surfsense_local.backend.modules.llm.resolution31 surfsense_local.backend.modules.llm.subscriptions.claude32 surfsense_local.backend.modules.plugins.remote.sign_in.oauth33 surfsense_local.backend.worker.ingestion.audio34 surfsense_local.backend.worker.ingestion.figures35 surfsense_local.backend.worker.studio36 surfsense_local.backend.modules.agent.agent_threads37 surfsense_local.backend.modules.agent.engines.claude_code38 surfsense_local.backend.modules.chat39 surfsense_local.backend.modules.llm40 surfsense_local.backend.modules.llm.transcription
1 backend.plugins.proprietary.scraping.http
2 surfsense_local.backend.modules.agent.agent_threads.turn
3 surfsense_local.backend.modules.agent.tool_exposure
4 surfsense_local.backend.modules.artifacts.revised_copies.engines
5 surfsense_local.backend.modules.embedding.spec
6 surfsense_local.backend.modules.llm.catalog.local.build
7 surfsense_local.backend.modules.llm.fit.budget
8 surfsense_local.backend.modules.llm.profile.types
9 surfsense_local.backend.modules.llm.providers.protocols
10 surfsense_local.backend.modules.llm.providers.types
11 surfsense_local.backend.shared.db
12 surfsense_local.backend.worker.studio.shared.artifact
13 backend.plugins.proprietary.web_crawl2
14 surfsense_local.backend.modules.artifacts.models2
15 surfsense_local.backend.modules.chat.models2
16 surfsense_local.backend.modules.documents.models1
17 surfsense_local.backend.modules.embedding6
18 surfsense_local.backend.modules.llm.catalog.local.install.plan1
19 surfsense_local.backend.modules.llm.catalog.local.manifest.schema2
20 surfsense_local.backend.modules.llm.fit5
21 surfsense_local.backend.modules.llm.models23
22 surfsense_local.backend.modules.plugins.installed.models3
23 surfsense_local.backend.api1
24 surfsense_local.backend.modules.agent1
25 surfsense_local.backend.modules.agent.previews1
26 surfsense_local.backend.modules.agent.tool_endpoint6
27 surfsense_local.backend.modules.chat.schemas1
28 surfsense_local.backend.modules.llm.catalog.local.engines.llamacpp.rows111
29 surfsense_local.backend.modules.llm.catalog.local.service11211
30 surfsense_local.backend.modules.llm.resolution134
31 surfsense_local.backend.modules.llm.subscriptions.claude11
32 surfsense_local.backend.modules.plugins.remote.sign_in.oauth3
33 surfsense_local.backend.worker.ingestion.audio1
34 surfsense_local.backend.worker.ingestion.figures3
35 surfsense_local.backend.worker.studio111
36 surfsense_local.backend.modules.agent.agent_threads3152
37 surfsense_local.backend.modules.agent.engines.claude_code121
38 surfsense_local.backend.modules.chat1243
39 surfsense_local.backend.modules.llm12514
40 surfsense_local.backend.modules.llm.transcription411
Uses a module listed above itPart of a loopThe module itself
1 backend.plugins.proprietary.scraping.http2 surfsense_local.backend.modules.agent.agent_threads.turn3 surfsense_local.backend.modules.agent.tool_exposure4 surfsense_local.backend.modules.artifacts.revised_copies.engines5 surfsense_local.backend.modules.embedding.spec6 surfsense_local.backend.modules.llm.catalog.local.build7 surfsense_local.backend.modules.llm.fit.budget8 surfsense_local.backend.modules.llm.profile.types9 surfsense_local.backend.modules.llm.providers.protocols10 surfsense_local.backend.modules.llm.providers.types11 surfsense_local.backend.shared.db12 surfsense_local.backend.worker.studio.shared.artifact13 backend.plugins.proprietary.web_crawl14 surfsense_local.backend.modules.artifacts.models15 surfsense_local.backend.modules.chat.models16 surfsense_local.backend.modules.documents.models17 surfsense_local.backend.modules.embedding18 surfsense_local.backend.modules.llm.catalog.local.install.plan19 surfsense_local.backend.modules.llm.catalog.local.manifest.schema20 surfsense_local.backend.modules.llm.fit21 surfsense_local.backend.modules.llm.models22 surfsense_local.backend.modules.plugins.installed.models23 surfsense_local.backend.api24 surfsense_local.backend.modules.agent25 surfsense_local.backend.modules.agent.previews26 surfsense_local.backend.modules.agent.tool_endpoint27 surfsense_local.backend.modules.chat.schemas28 surfsense_local.backend.modules.llm.catalog.local.engines.llamacpp.rows29 surfsense_local.backend.modules.llm.catalog.local.service30 surfsense_local.backend.modules.llm.resolution31 surfsense_local.backend.modules.llm.subscriptions.claude32 surfsense_local.backend.modules.plugins.remote.sign_in.oauth33 surfsense_local.backend.worker.ingestion.audio34 surfsense_local.backend.worker.ingestion.figures35 surfsense_local.backend.worker.studio36 surfsense_local.backend.modules.agent.agent_threads37 surfsense_local.backend.modules.agent.engines.claude_code38 surfsense_local.backend.modules.chat39 surfsense_local.backend.modules.llm40 surfsense_local.backend.modules.llm.transcriptionbackend.plugins.proprietary.scraping.http1surfsense_local.backend.modules.agent.agent_threads.turn2surfsense_local.backend.modules.agent.tool_exposure3surfsense_local.backend.modules.artifacts.revised_copies.engines4surfsense_local.backend.modules.embedding.spec5surfsense_local.backend.modules.llm.catalog.local.build6surfsense_local.backend.modules.llm.fit.budget7surfsense_local.backend.modules.llm.profile.types8surfsense_local.backend.modules.llm.providers.protocols9surfsense_local.backend.modules.llm.providers.types10surfsense_local.backend.shared.db11surfsense_local.backend.worker.studio.shared.artifact12backend.plugins.proprietary.web_crawl13surfsense_local.backend.modules.artifacts.models14surfsense_local.backend.modules.chat.models15surfsense_local.backend.modules.documents.models16surfsense_local.backend.modules.embedding17surfsense_local.backend.modules.llm.catalog.local.install.plan18surfsense_local.backend.modules.llm.catalog.local.manifest.schema19surfsense_local.backend.modules.llm.fit20surfsense_local.backend.modules.llm.models21surfsense_local.backend.modules.plugins.installed.models22surfsense_local.backend.api23surfsense_local.backend.modules.agent24surfsense_local.backend.modules.agent.previews25surfsense_local.backend.modules.agent.tool_endpoint26surfsense_local.backend.modules.chat.schemas27surfsense_local.backend.modules.llm.catalog.local.engines.llamacpp.rows28surfsense_local.backend.modules.llm.catalog.local.service29surfsense_local.backend.modules.llm.resolution30surfsense_local.backend.modules.llm.subscriptions.claude31surfsense_local.backend.modules.plugins.remote.sign_in.oauth32surfsense_local.backend.worker.ingestion.audio33surfsense_local.backend.worker.ingestion.figures34surfsense_local.backend.worker.studio35surfsense_local.backend.modules.agent.agent_threads36surfsense_local.backend.modules.agent.engines.claude_code37surfsense_local.backend.modules.chat38surfsense_local.backend.modules.llm39surfsense_local.backend.modules.llm.transcription40222161252331116111111211134113131113152121124312514411+1074 more modules (most-connected shown)

At a glance — Code Health · 72.1 · Strong ·

At a glance — Architecture · 63.6 · Adequate · gated by D26, AX7 ·

At a glance — Maturity · 91.7 · Exemplary ·

At a glance — Readiness · 28.3 · Weak · gated by D11, D12, P3, P5, P7 ·

At a glance — Security · 64.4 · Adequate · gated by D28, D29, D36 ·

At a glance — Domain Modelling · 100.0 · Exemplary ·

At a glance — Accessibility · 77.5 · Strong ·

At a glance — Performance · 60.0 · Adequate ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection171High / Critical
A03:2025 — Software Supply Chain Failures62High / Critical
A07:2025 — Authentication Failures13High / Critical
A02:2025 — Security Misconfiguration11High / Critical

Roadmap

Top priorities: Resolve the 507 Flaky test finding(s) in Test Reliability; Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED; Resolve the 1 finding(s) in DR & Backup.

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

Do thisHelpsEffortDimension
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.+11.3 ptsLowREDACTED Scanning
Resolve the 507 Flaky test finding(s) in Test Reliability.+16.2 ptsHighTest Reliability
Resolve the 1 finding(s) in DR & Backup.+4.5 ptsMediumDR & Backup
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.+2.2 ptsMediumAsync & latency hygiene
Trigger your SAST workflow on pull requests — a scan that only runs on a cron reports history, it does not gate.+1.7 ptsMediumSecurity & performance tooling
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.+1.7 ptsMediumOutbound HTTP resilience
Resolve the 4 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED (2), package.json (2).+0.8 ptsLowProject Cohesion
Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.+1.1 ptsMediumSlice cohesion

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.1SlopDependency Vulnerabilities: Critical vulnerability: REDACTED
REDACTED0.6SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.8SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.5SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED2.9SlopREDACTED Scanning: Leaked secret: REDACTED
REDACTED3.0SlopDependency Vulnerabilities: Critical vulnerability: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.5MixedSecrets (history): REDACTED: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED

How the grades work

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

Critical — 690

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 990

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 148

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

Could not be resolved — 6

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 87 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

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

What we checked — 87 dimensions across the health lenses
D1D2D3D4D5D6D7D10D11D12D13D14D15D16D17D19D20D21D24D25D26D27D28D29D30D31D34D35D36D37D43D44AC1AC2AC3AC4AC5AC6AX10AX2AX3AX5AX6AX7C2DM6M1M2M3M4P1P10P2P3P4P5P6P7P8PF3R1R10R11R2R3R4R6R7R8R9S1X1X12X13X17X19X2X21X23X24X25X27X28X3X30X4X5

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, 1299 of 1828 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic

Every finding is locatable in findings.md. Run 01a1e950-0c44-7202-9e2a-188753ab8c07.

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.

  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 1,899 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 865 test source file(s) (.py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Test reliability for the node:test suite in surfsense_local/electron/ was NOT MEASURED: the dependency install for surfsense_local/electron/ could not reach github.com, which the analyzer sandbox's egress allowlist does not carry (Error: Error when performing the request to https://registry.npmjs.org/pnpm/-/pnpm-11.27.1.tgz; for troubleshooting help, see https://github.com/nodejs/corepack…), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its Python distribution dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D25 ADR Conformance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The code index reads C#, Razor, TypeScript, JavaScript and Vue. A rule whose scope holds production code in another language is not called honoured, because its uses could sit in that code.
  • D27 Navigability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Tracing effort is measured over resolved call sites, and all 864 sampled here came from .py files. This repository's .tsx, .ts source is a material share of its production lines and contributed none, so the score above is a verdict about the part that was read. Not a finding that the unread half navigates well — it is unmeasured.
  • D31 IaC & Container Security — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Checkov ran but its report could not be read (checkov produced no output — not a clean result). Every misconfiguration only checkov reports — most of its Terraform, CloudFormation, Bicep and Ansible policies — is absent from this card, so its absence here is not evidence those resources are configured correctly.
  • D31 IaC & Container Security — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Backend/server/Dockerfile.dockerignore, REDACTED.dockerignore carries no `FROM` instruction, so it declares no build stage and every REDACTED rule this engine owns — the runtime-hardening, key-material, mutable-clone, no-op-shim, build-context, trust-anchor, install-guard, setuid and world-writable-path rules — is outside its own premise there and returned nothing. That silence is deliberate and correct: with no base image there is no image to reason about. It is reported here because it is NOT the same fact as a clean file, and coverage is stated as 7 of 9 Infrastructure-as-Code manifest(s) fully judged rather than as 100%. The vendor scanners (trivy, checkov) do read these files and their findings above stand; only this engine's own stage-keyed rules are absent. No owner action: a build file with no FROM is a legitimate include fragment.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `backend/plugins/bundles/core/manifest/surfsense_plugin_manifest/rules/duplicate_names.py`, `backend/plugins/bundles/core/sdk/surfsense_plugin_sdk/action.py`, `backend/plugins/bundles/core/sdk/surfsense_plugin_sdk/http/sending.py`, `backend/plugins/proprietary/google_maps/fetch.py`, `backend/plugins/proprietary/scraping/browser_pool.py`, … (+19 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AX7 Slice cohesion — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 317 further occurrence(s) are not listed individually; the score already reflects all 357.
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java source only, and this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby, Scala and Rust source only, and this repository's Python is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 121 further occurrence(s) are not listed individually; the score already reflects all 161.
  • R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 65 further occurrence(s) are not listed individually; the score already reflects all 105.
  • R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 119 further occurrence(s) are not listed individually; the score already reflects all 159.
  • X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 27 further occurrence(s) are not listed individually; the score already reflects all 67.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X27 Collection changed while being enumerated — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
  • X29 Per-element action decided by a fixed element — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 31 further occurrence(s) are not listed individually; the score already reflects all 71.

Repo exclusion declarations: 3 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • 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.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D25 ADR Conformance: ADR conformance checks only decisions stated in a checkable form (a ruled-out element, package or dependency, an adr-rules block, a declared delivery status): a decision written only as prose is unverifiable, and decisions never written down are not checked.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • 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. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • 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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

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

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

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

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

115 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was gradient-ascii.GradientAscii at 68. 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 problem-text.problemText at 17 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: surfsense_local/frontend/src/features/dictation/strip/problem-text.ts (problem-text.problemText at 17). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

gradient-ascii.GradientAscii (cyclomatic 68)surfsense_local/frontend/src/features/onboarding/welcome-backdrop/gradient-ascii.tsx:63
add-from-web-dialog.AddFromWebDialog (cyclomatic 60)surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx:54
scraper._product_flow (cyclomatic 56)backend/plugins/proprietary/amazon/scraper.py:151
use-chat-runtime.useChatRuntime (cyclomatic 50)surfsense_local/frontend/src/features/chat/use-chat-runtime.ts:220
sources-panel.SourcesPanel (cyclomatic 50)surfsense_local/frontend/src/features/sources/sources-panel.tsx:79

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

What to do

  1. Bring the 1 body over 60 down to 60 or less in Cyclomatic Complexity — start with gradient-ascii.GradientAscii (cyclomatic 68). — Refactoring it lifts Cyclomatic Complexity from 6.4 to about 6.5/10.

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

D2 · Cognitive Complexity6.1 / 10Adequate✓ Tool-verified

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

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

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

207 method(s) exceeded the cognitive complexity threshold of 15; the worst was add-from-web-dialog.AddFromWebDialog at 88.

add-from-web-dialog.AddFromWebDialog (cognitive 88)surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx:54
scraper._product_flow (cognitive 75)backend/plugins/proprietary/amazon/scraper.py:151
WebCrawlerConnector._build_result (cognitive 61)backend/plugins/proprietary/web_crawl/connector.py:1042
sources-panel.SourcesPanel (cognitive 61)surfsense_local/frontend/src/features/sources/sources-panel.tsx:79
gradient-ascii.GradientAscii (cognitive 59)surfsense_local/frontend/src/features/onboarding/welcome-backdrop/gradient-ascii.tsx:63

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

What to do

  1. Bring the 4 bodies over 60 down to 60 or less in Cognitive Complexity — start with add-from-web-dialog.AddFromWebDialog (cognitive 88), scraper._product_flow (cognitive 75), WebCrawlerConnector._build_result (cognitive 61). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 4 together lifts Cognitive Complexity from 6.1 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes8.0 / 10Strong✓ Tool-verified

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

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

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

86 over-large unit(s) detected — types, modules or files that carry too much.

FunctionTooLong: use-chat-runtime.useChatRuntime · ×71surfsense_local/frontend/src/features/chat/use-chat-runtime.ts:220
FileTooLong: data/parse.py · ×15plans/community-local/seo/data/parse.py

What to do

  1. Resolve the 71 FunctionTooLong finding(s) in God Classes — start with page.tsx (6), use-chat-runtime.ts (2), use-sources.ts (2). — One of this dimension's main actionable groups (71 warning-level).
  2. Resolve the 15 FileTooLong finding(s) in God Classes — start with fetch.py (3), parsers.py (2), parse.py. — One of this dimension's main actionable groups (15 warning-level).

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

D4 · Code Duplication9.3 / 10Stronggated by 132 serious findings✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

63 duplicated block group(s) detected. 1.8 % of the production lines (3,297 of 184,525) are in a reported copy. A further 69 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. Measured on part of this repository only: .tsx (28% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Edited copy of a member (4 corresponding lines) · ×10surfsense_local/backend/modules/artifacts/revised_copies/engines/package.py:81
Edited copy of a member (7 corresponding lines) · ×6backend/plugins/proprietary/google_search/parsers.py:403
Duplicated block (7 lines × 2) · ×5backend/plugins/proprietary/google_maps/server.py:119
Edited copy of a member (8 corresponding lines) · ×4plans/community-local/seo/data/b2b-oct/rollup.py:59
Edited copy of a member (11 corresponding lines) · ×4surfsense_local/backend/modules/embedding/fp32_upcast.py:71

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

What to do

  1. Resolve the 10 Edited copy of a member (4 corresponding lines) finding(s) in Code Duplication — start with REDACTED (2), package.py, tickets.py. — One of this dimension's main actionable groups (10 warning-level).
  2. Resolve the 6 Edited copy of a member (7 corresponding lines) finding(s) in Code Duplication — start with parsers.py, convert.py, rollup.py. — One of this dimension's main actionable groups (6 warning-level).
  3. Resolve the 5 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with REDACTED (2), parsers.py, package.py. — One of this dimension's main actionable groups (5 warning-level).

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

D5 · Coupling9.0 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

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

8 production modules (npm+Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence.

Off the main sequence: surfsense-plugin-manifest

What to do

  1. Resolve the 1 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).

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

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

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

1 of 122 classes have LCOM4 above 3.

Low cohesion: ClaudeCodeEngine (LCOM4 4)surfsense_local/backend/modules/agent/engines/claude_code/engine.py:48

What to do

  1. Resolve the 1 Low cohesion finding(s) in Cohesion (LCOM4) — start with engine.py. — One of this dimension's main actionable groups (1 warning-level).

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

D7 · Architectural Integrity6.0 / 10Adequate✓ 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: Documented → Verified → Prevented · effective 6.0 / 10 · rule-coverage 100% · ceiling Prevented

No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).

Detailed fixes: d7_recommendation.md.

D10 · Test Quality10.0 / 10Stronggated by 6 serious findings✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

10 skipped (10 with a documented reason), 3 zero-assertion, 3 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1899 tests. Measured on the JavaScript/TypeScript suite only — at least 865 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.

No assertions: keeps restarting crashes spread wider than 5 minutes · ×3surfsense_local/sidecars/watch-transcription-models.test.ts:249
Fixed-sleep synchronisation: a second signal while stopping waits for every child instead of leaving them running · ×3surfsense_local/headless/main.test.ts:204
Mock-dominated test: sends the ticked folders as the job's source scope · ×5surfsense_local/frontend/src/features/studio/studio-panel.test.tsx:119
Skipped (documented): (unnamed test) · ×10surfsense_local/frontend/src/features/models/local/chat/download-chat-models.test.tsx:42

What to do

  1. Resolve the 5 Mock-dominated test finding(s) in Test Quality — start with source-upload.test.tsx (2), studio-panel.test.tsx, inline-citation.test.tsx. — One of this dimension's main actionable groups (5 recommendation-level).
  2. Resolve the 3 No assertions finding(s) in Test Quality — start with watch-transcription-models.test.ts, mac-dmg.test.mjs, after-sign.test.mjs. — One of this dimension's main actionable groups (3 warning-level).
  3. Resolve the 3 Fixed-sleep synchronisation finding(s) in Test Quality — start with main.test.ts, add-from-web.test.tsx, run-store.test.ts. — One of this dimension's main actionable groups (3 warning-level).

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

D11 · Test Reliability0.0 / 10Critical✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

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

507 flaky across 2 measured tier(s). JavaScript/TypeScript (node:test via `pnpm install --frozen-lockfile --ignore-scripts` in surfsense_local/electron/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in surfsense_local/frontend/ (2420 tests); node:test via `pnpm install --frozen-lockfile --ignore-scripts` in surfsense_local/headless/ (6 tests)): measured (507 flaky); Python (7 distributions): measured (0 flaky).

Flaky test: surfsense_local/frontend/src/app/app-bootstrap.test.tsx::app bootstrap clears the notice once the key is fixed in Settings, without a reload · ×507

What to do

  1. Resolve the 507 Flaky test finding(s) in Test Reliability. — One of this dimension's main actionable groups (507 issue-level).

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

D12 · Dependency Hygiene10.0 0.6 / 10Critical✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 0.6 / 10 · rule-coverage 6% · ceiling Verified

0 outdated, 0 yanked pinned Python distributions. 2 of 36 shipped distributions were graded against pypi.org (0 not published there, 34 declared without an exact pin, which installs the newest release the declaration admits and so cannot be behind one). Only EXACT pins are graded for currency: a floor or a range already installs the newest release it admits, so reporting one would report this repository for being current. Whether a deliberate upper cap has itself gone stale is a different and weaker question, and is not asked. Whether any distribution is UNMAINTAINED is not graded — PyPI publishes no maintenance status, and release age does not stand in for one. Lockfiles are not read (poetry.lock, REDACTED, Pipfile.lock, pdm.lock), so a lock-resolved install is outside this verdict. Known CVEs in this dependency graph are D30's question.

Detailed fixes: d12_recommendation.md.

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

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

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

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

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

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

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

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

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

0 of 125 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 36 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (90 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 15 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's Python distribution dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.8 / 10Stronggated by 78 serious findings✓ Tool-verified

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

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

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

Top hotspots: surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx (109×29=3161); surfsense_local/frontend/src/features/sources/sources-panel.tsx (48×50=2400); surfsense_local/frontend/src/features/chat/use-chat-runtime.ts (48×50=2400) Repeated repair below the complexity floor: surfsense_local/backend/modules/llm/providers/audiocpp/speech.py (7 of 12 changes were fixes); surfsense_local/electron/src/main/updater.ts (5 of 9 changes were fixes); surfsense_local/backend/modules/artifacts/script_documents/service.py (5 of 8 changes were fixes)

Hotspot: surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx · ×59surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx:94
Repeated repair: surfsense_local/backend/modules/llm/providers/audiocpp/speech.py · ×19surfsense_local/backend/modules/llm/providers/audiocpp/speech.py:113

What to do

  1. Resolve the 59 Hotspot finding(s) in Churn × Complexity Hotspots — start with fetch.py (4), turn.py (2), scraper.py (2). — One of this dimension's main actionable groups (59 warning-level).
  2. Resolve the 19 Repeated repair finding(s) in Churn × Complexity Hotspots — start with service.py (3), speech.py, updater.ts. — One of this dimension's main actionable groups (19 warning-level).

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

D16 · Bus Factor7.4 / 10Strong✓ Tool-verified

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

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

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

229 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is plans/community-local/seo/data/parse.py. Counted over 893 of the 2429 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

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

What to do

  1. Resolve the 5 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (5 recommendation-level).
  2. Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

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

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

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

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

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

0 deducted task-comment markers across 184525 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

2 of 2 documentation facets pass in full. 154 document(s) read across 12 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality9.9 / 10Exemplary✓ Tool-verified

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

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

2 of 70 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.

ADR superseded but its status says otherwise · ×2docs/adr/0020-two-update-channels.md:1detected by adr-integrity

✓ On the Gold path — maintain.

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

D21 · Naming Consistency3.9 / 10Weak✓ Tool-verified

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

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

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

2 naming inconsistencies among 33 declarations measured against a convention their peers follow.

`do_GET` spells `GET` where 31 names in the project spell it `get` · ×2surfsense_local/backend/tests/integration/llm/transcription_stand_in.py:37

What to do

  1. Resolve the 2 `do_GET` spells `GET` where 31 names in the project spell it `get` finding(s) in Naming Consistency — start with transcription_stand_in.py, speech_api_stand_in.py. — One of this dimension's main actionable groups (2 recommendation-level).

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

D24 · Comment Value10.0 9.9 / 10Exemplary○ Nothing flagged

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

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

0 of 1794 judged comments only repeat the code they sit on (0.0 %). 33 comment(s) in another language or script were not judged.

doc comments repeat the names · ×2surfsense_local/frontend/src/features/sources/tree/folder-name-dialog.tsx:18

✓ On the Gold path — maintain.

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

D25 · ADR Conformance8.0 / 10Strong✓ Tool-verified

What it measures: Whether the code actually follows the decisions recorded in the project's ADRs.

Method: Each binding ADR read for checkable forms: a backticked element its Decision section rules out, a ruled-out package the manifests declare, a forbidden module dependency, an opt-in adr-rules block, and a declared delivery status the code does not yet carry. A prose decision with no checkable form is unverifiable, neither a finding nor a pass. Deterministic, no model. Advisory.

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

1 of 5 checkable records are broken by the code or by their own declared delivery (5 of 51 binding records state a rule in checkable form or declare their delivery; prose decisions are unverifiable).

ADR not followed: ADR 0029: Interface text lives in ICU MessageFormat catalogs, one flat JSON file per languagedocs/adr/0029-icu-translation-catalogs.md:13detected by adr-prohibition

What to do

  1. Resolve the 1 ADR not followed finding(s) in ADR Conformance — start with 0029-icu-translation-catalogs.md. — One of this dimension's main actionable groups (1 recommendation-level).

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

D26 · Project Cohesion3.8 / 10Weak✓ Tool-verified

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

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

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

4 of 13 build units (Python, checkout, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×4REDACTED:1

What to do

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

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

D27 · Navigability10.0 / 10Exemplary✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

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

96 % of calls cross a namespace and 0 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated. Measured over the .py source only — this repository's .tsx, .ts was not sampled for call sites, so this score covers part of the tree, not all of it.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)0.0 / 10Critical✓ Tool-verified

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

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

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

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

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 10 REDACTED finding(s) in Secrets (history) — start with REDACTED (6), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (10 issue-level).
  2. Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. 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)0.0 / 10Critical✓ Tool-verified

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

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

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

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

171 finding(s): 0 critical, 132 high, 25 medium, 14 low. 108 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 29 file(s) — `backend/plugins/bundles/core/manifest/surfsense_plugin_manifest/rules/duplicate_names.py` (line 19), `backend/plugins/bundles/core/sdk/surfsense_plugin_sdk/action.py` (line 8, line 13), `backend/plugins/bundles/core/sdk/surfsense_plugin_sdk/http/sending.py` (line 19), `backend/plugins/proprietary/google_maps/fetch.py` (line 142, line 143, line 144, …), `backend/plugins/proprietary/scraping/browser_pool.py` (line 705, lines 706–709, line 709, …), … (+24 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 5 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (6 issue-level).
  2. Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 issue-level).
  3. No action in Static Analysis (SAST) — all 108 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (108 issue-level, 0 of them charged here).

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

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

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

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

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

53 finding(s): 8 critical, 27 high, 16 medium, 2 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 27 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (20), REDACTED (7). — One of this dimension's main actionable groups (27 issue-level).
  2. Resolve the 4 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  3. Resolve the 4 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 issue-level).

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

D31 · IaC & Container Security8.4 6.6 / 10Adequate✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 6.6 / 10 · rule-coverage 78% · ceiling Documented

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

REDACTED
REDACTED

What to do

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

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

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

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

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

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

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 893 of the 2429 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling10.0 / 10Stronggated by 10 serious findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: REDACTED↔REDACTED 85%; page.tsx↔page.tsx 64%; sources-panel.tsx↔use-sources.ts 61%

Change coupling: REDACTED ↔ REDACTED · ×10REDACTED:1

What to do

  1. Resolve the 10 Change coupling finding(s) in Change Coupling — start with REDACTED (2), sources-panel.tsx (2), api.ts (2). — One of this dimension's main actionable groups (10 warning-level).

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

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

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — 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: Documented → Verified → Prevented · 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.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

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

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

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

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

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 36 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged

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

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

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

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

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

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

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

AC3 · Page structure7.8 / 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.

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

  • A page with no <title> gives no name in the tab, history or screen-reader page list. Declare it the way this router does — Next App Router `export const metadata = { title }`, React Router/Remix `export function meta`, TanStack Start `head`, or a Helmet/Head component. — www/app/global-error.tsx:20
  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — www/app/global-error.tsx:20

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

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, 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.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

AC6 · Visual & motion safety4.3 / 10Weak✓ Tool-verified

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

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

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

  • <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — surfsense_local/frontend/src/components/ui/resize-handle.tsx:94
  • <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — surfsense_local/frontend/src/components/ui/select.tsx:11
  • <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — surfsense_local/frontend/src/components/ui/textarea.tsx:6
  • <span> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×2) — surfsense_local/frontend/src/features/models/local/chat/build-action.tsx:81, surfsense_local/frontend/src/features/models/local/chat/install-progress.tsx:43
  • <output> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — www/components/ui/spinner.tsx:22
  • <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — www/features/license/license-forms.tsx:74
  • `.ss-home-nav-drawer` moves (`transition: opacity 150ms ease-out, translate 150ms ease-out, visibility 0s linear 150ms`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — www/app/(home)/home.css:330
  • `.ss-home-nav-drawer[data-state="open"]` moves (`transition: opacity 220ms cubic-bezier(0.2, 0, 0, 1), translate 220ms cubic-bezier(0.2, 0, 0, 1), visibility 0s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — www/app/(home)/home.css:349
  • `.ss-home-faq::details-content` moves (`transition: height 260ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease-out, content-visibility 260ms allow-discrete`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — www/app/(home)/home.css:422
  • `.ss-home-faq-marker` moves (`transition: transform 150ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — www/app/(home)/home.css:447
  • `[data-dio="obj"]` moves (`transition: opacity 300ms ease-out, transform 300ms cubic-bezier(0.2, 0, 0, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — www/app/(home)/home.css:499
  • `.ss-thinking-dot-a` moves (`animation-name: ss-thinking-pair-a`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — surfsense_local/frontend/src/index.css:544
  • `.ss-thinking-dot-b` moves (`animation-name: ss-thinking-pair-b`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — surfsense_local/frontend/src/index.css:548
  • `.ss-thinking-dot-c` moves (`animation-name: ss-thinking-pair-c`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — surfsense_local/frontend/src/index.css:552

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AX10 · Code composition9.6 / 10Exemplary✓ Tool-verified

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

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

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

AX2 · Stateful singletons10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.

Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.

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

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

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

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

AX7 · Slice cohesion1.0 / 10Critical✓ Tool-verified

Other · Architecture — Whether feature slices stay independent (no direct cross-slice references) — the discipline that makes vertical-slice architecture pay off.

Method: Roslyn scan (vertical-slice gated): feature slices resolved from namespaces (.Features.*, .Slices.*) or project names; cross-slice type references detected. Deterministic, traceable.

  • `docsUrl` (slice 'about') depends on `siteVisitUrl` from slice 'external-links'. — surfsense_local/frontend/src/features/about/about-links.ts:13
  • `AboutSettings` (slice 'about') depends on `SettingsSection` from slice 'settings'. — surfsense_local/frontend/src/features/about/about-settings.tsx:59
  • `AboutSettings` (slice 'about') depends on `UpdateSettings` from slice 'updates'. — surfsense_local/frontend/src/features/about/about-settings.tsx:72
  • `AboutSettings` (slice 'about') depends on `UsageStatisticsSettings` from slice 'privacy-choices'. — surfsense_local/frontend/src/features/about/about-settings.tsx:73
  • `DataFolder` (slice 'about') depends on `errorToast` from slice 'feedback'. — surfsense_local/frontend/src/features/about/data-folder.tsx:24
  • `AccessSettings` (slice 'access') depends on `SettingsSection` from slice 'settings'. — surfsense_local/frontend/src/features/access/access-settings.tsx:179
  • `StepLine` (slice 'agent') depends on `useOpenArtifact` from slice 'studio'. — surfsense_local/frontend/src/features/agent/agent-steps.tsx:64
  • `StepLine` (slice 'agent') depends on `mayBePluginStep` from slice 'plugins'. — surfsense_local/frontend/src/features/agent/agent-steps.tsx:65
  • `StepLine` (slice 'agent') depends on `PluginStepLine` from slice 'plugins'. — surfsense_local/frontend/src/features/agent/agent-steps.tsx:67
  • `stepLabel` (slice 'agent') depends on `formatLabel` from slice 'studio'. — REDACTED:114
  • `MessageContent` (slice 'chat') depends on `AgentStep` from slice 'agent'. — surfsense_local/frontend/src/features/chat/api.ts:68
  • `MessageContent` (slice 'chat') depends on `TurnSources` from slice 'agent'. — surfsense_local/frontend/src/features/chat/api.ts:70
  • `MessageContent` (slice 'chat') depends on `UnavailablePlugin` from slice 'agent'. — surfsense_local/frontend/src/features/chat/api.ts:81
  • `streamMessage` (slice 'chat') depends on `SourceScope` from slice 'sources'. — surfsense_local/frontend/src/features/chat/api.ts:161
  • `ModelControl` (slice 'chat') depends on `ModelSelection` from slice 'models'. — surfsense_local/frontend/src/features/chat/chat-composer.tsx:32
  • `ChatComposer` (slice 'chat') depends on `ChatMode` from slice 'models'. — surfsense_local/frontend/src/features/chat/chat-composer.tsx:193
  • `ChatComposer` (slice 'chat') depends on `PluginsStart` from slice 'plugins'. — surfsense_local/frontend/src/features/chat/chat-composer.tsx:197
  • `ChatComposer` (slice 'chat') depends on `Dictation` from slice 'dictation'. — surfsense_local/frontend/src/features/chat/chat-composer.tsx:199
  • `ChatComposer` (slice 'chat') depends on `useDictationKeys` from slice 'dictation'. — surfsense_local/frontend/src/features/chat/chat-composer.tsx:212
  • `ChatComposer` (slice 'chat') depends on `useDictationStarted` from slice 'dictation'. — surfsense_local/frontend/src/features/chat/chat-composer.tsx:214
  • `ChatComposer` (slice 'chat') depends on `MicButton` from slice 'dictation'. — surfsense_local/frontend/src/features/chat/chat-composer.tsx:221
  • `ChatComposer` (slice 'chat') depends on `DictationStrip` from slice 'dictation'. — surfsense_local/frontend/src/features/chat/chat-composer.tsx:230
  • `ChatComposer` (slice 'chat') depends on `PluginMentions` from slice 'plugins'. — surfsense_local/frontend/src/features/chat/chat-composer.tsx:282
  • `CitationPanel` (slice 'chat') depends on `getDocumentByChunk` from slice 'sources'. — surfsense_local/frontend/src/features/chat/citation-panel.tsx:23
  • `ComposerAddMenu` (slice 'chat') depends on `PluginsStart` from slice 'plugins'. — surfsense_local/frontend/src/features/chat/composer-add-menu.tsx:55
  • `ComposerAddMenu` (slice 'chat') depends on `SOURCE_FILE_ACCEPT` from slice 'sources'. — surfsense_local/frontend/src/features/chat/composer-add-menu.tsx:116
  • `ComposerAddMenu` (slice 'chat') depends on `PluginsMenu` from slice 'plugins'. — surfsense_local/frontend/src/features/chat/composer-add-menu.tsx:181
  • `useSelectedOnClaudePlan` (slice 'chat') depends on `ModelSelection` from slice 'models'. — surfsense_local/frontend/src/features/chat/extra-usage/use-selected-on-claude-plan.ts:5
  • `useSelectedOnClaudePlan` (slice 'chat') depends on `useConnections` from slice 'models'. — surfsense_local/frontend/src/features/chat/extra-usage/use-selected-on-claude-plan.ts:6
  • `MarkdownText` (slice 'chat') depends on `streamingStreamdownPlugins` from slice 'studio'. — surfsense_local/frontend/src/features/chat/message.tsx:90
  • `MarkdownText` (slice 'chat') depends on `streamdownPlugins` from slice 'studio'. — surfsense_local/frontend/src/features/chat/message.tsx:90
  • `MarkdownText` (slice 'chat') depends on `STREAMDOWN_LINK_SAFETY` from slice 'studio'. — surfsense_local/frontend/src/features/chat/message.tsx:92
  • `NO_STEPS` (slice 'chat') depends on `AgentStep` from slice 'agent'. — surfsense_local/frontend/src/features/chat/message.tsx:176
  • `unavailablePluginsFrom` (slice 'chat') depends on `UnavailablePlugin` from slice 'agent'. — surfsense_local/frontend/src/features/chat/message.tsx:190
  • `MessagePluginsUnavailable` (slice 'chat') depends on `PluginsUnavailable` from slice 'agent'. — surfsense_local/frontend/src/features/chat/message.tsx:205
  • `MessageSteps` (slice 'chat') depends on `AgentSteps` from slice 'agent'. — surfsense_local/frontend/src/features/chat/message.tsx:232
  • `latestOfficeReplies` (slice 'chat') depends on `OfficeOffer` from slice 'office-support'. — surfsense_local/frontend/src/features/chat/message.tsx:246
  • `MessageOfficeOffer` (slice 'chat') depends on `useOfficeOffer` from slice 'office-support'. — surfsense_local/frontend/src/features/chat/message.tsx:277
  • `MessageOfficeOffer` (slice 'chat') depends on `OfficeOfferBanner` from slice 'office-support'. — surfsense_local/frontend/src/features/chat/message.tsx:283
  • `scopeFrom` (slice 'chat') depends on `TurnSources` from slice 'agent'. — surfsense_local/frontend/src/features/chat/message.tsx:286

What to do

  • Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.
C2 · Access Controls7.0 / 10Strong✓ Tool-verified

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

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

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

What to do

  • Name the access rules — DRF permission classes, django-guardian or django-rules permissions, a casbin or oso policy, or roles and permissions declared once — and consult them where access is checked (permission_classes, @permission_required, Depends), so the rule set is reviewable and testable on its own.
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 (Django/SQLAlchemy) 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)8.5 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation10.0 / 10Exemplary✓ 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.

M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

M4 · Documentation accuracy9.4 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

  • surfsense_local/packaging/README.md links to `../../surfsense_web/lib/install-script-redirects.ts`, but `surfsense_web/lib/install-script-redirects.ts` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — surfsense_local/packaging/README.md:153

What to do

  • Reconcile the README with reality: surfsense_local/packaging/README.md links to `../../surfsense_web/lib/install-script-redirects.ts`, but `surfsense_web/lib/install-script-redirects.ts` does not exist.
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.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability5.9 / 10Adequate✓ Tool-verified

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

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

  • Only 3/10 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `backend/plugins/bundles/core/cli`, `backend/plugins/bundles/core/sdk`, `surfsense_local/headless` and 2 more.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling3.0 / 10Weak✓ 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.

  • `REDACTED` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.
  • `surfsense_local/electron/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — surfsense_local/electron/package.json:35

What to do

  • Trigger your SAST workflow on pull requests — a scan that only runs on a cron reports history, it does not gate.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback8.0 / 10Strong✓ Tool-verified

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

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

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

What to do

  • Add an approval/environment gate (required reviewers / protection rules) before production promotion.
P5 · DR & Backup0.0 / 10Critical✓ Tool-verified

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

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

  • A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
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.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

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

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

  • `httpx.AsyncClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — surfsense_local/backend/modules/llm/catalog/local/engines/llamacpp/engine.py:143, surfsense_local/backend/modules/llm/catalog/local/engines/llamacpp/engine.py:202, surfsense_local/backend/modules/llm/catalog/local/engines/llamacpp/engine.py:209

What to do

  • Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
P8 · Schema migrations10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.

Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.

PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

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

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

  • `writeFileSync` in `loadOutput` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — surfsense_local/runtimes/audiocpp/built-families.mjs:44
  • `mkdtempSync` in `unprovenFamilies` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — surfsense_local/runtimes/audiocpp/built-families.mjs:75
  • `writeFileSync` in `unprovenFamilies` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — surfsense_local/runtimes/audiocpp/built-families.mjs:77
  • `rmSync` in `unprovenFamilies` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — surfsense_local/runtimes/audiocpp/built-families.mjs:86

What to do

  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
R1 · Type Safety9.2 / 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 Duplication6.0 / 10Adequate✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • 77 duplicated blocks under surfsense_local/frontend/src/features/ have copies in at least two of the sibling directories about, access, chat, dashboard, dictation, egress (+15 more sibling(s) not listed) — 31 of them are reported below, and 46 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 77 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 77 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 77 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — surfsense_local/frontend/src/features/file-viewers/pdf-viewer.tsx:1
  • 25 duplicated blocks under www/app/(home)/ have copies in at least two of the sibling directories _home, announcements, blog, changelog, contact, downloads (+9 more sibling(s) not listed) — 16 of them are reported below, and 9 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 25 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 25 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 25 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — www/app/(home)/external-mcp-connectors/page.tsx:203
  • 14 duplicated blocks under surfsense_local/frontend/src/features/plugins/ have copies in at least two of the sibling directories add-custom, browse, connection, details, in-thread, public-page (+3 more sibling(s) not listed) — 11 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 14 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — surfsense_local/frontend/src/features/plugins/connection/edit-connection-button.tsx:49
  • 8 of the duplicated blocks reported below have copies in at least two of the sibling directories home-compare, home-confidential, home-features, home-formats, home-pillars under www/app/(home)/_home/. That concentration is one structural fact, not 8 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 8 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — www/app/(home)/_home/home-compare/home-compare.tsx:13
  • 7 duplicated blocks under surfsense_local/frontend/src/features/models/local/ have copies in at least two of the sibling directories audio, chat, image, transcription — 5 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — surfsense_local/frontend/src/features/models/local/audio/download-audio-models.tsx:1
  • 6 of the duplicated blocks reported below have copies in at least two of the sibling directories audiocpp, opencode, sdcpp under surfsense_local/runtimes/. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — surfsense_local/runtimes/audiocpp/stage.mjs:25
  • surfsense_local/frontend/src/components/ui/context-menu.tsx:36 · surfsense_local/frontend/src/components/ui/dropdown-menu.tsx:27 — the two spans are one implementation copied and then locally edited — 708 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/components/ui/context-menu.tsx:36
  • surfsense_local/frontend/src/features/file-viewers/pdf-viewer.tsx:1 · surfsense_local/frontend/src/features/studio/viewers/pdf-viewer.tsx:1 — these 2 files are line-for-line copies of one another — 181 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — surfsense_local/frontend/src/features/file-viewers/pdf-viewer.tsx:1
  • surfsense_local/frontend/src/features/sources/tree/document-row.tsx:202 · surfsense_local/frontend/src/features/studio/artifact-list.tsx:188 — the two spans are one implementation copied and then locally edited — 598 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/sources/tree/document-row.tsx:202
  • surfsense_local/frontend/src/features/plugins/connection/edit-connection-button.tsx:49 · surfsense_local/frontend/src/features/plugins/details/edit-headers-button.tsx:36 — the two spans are one implementation copied and then locally edited — 659 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/plugins/connection/edit-connection-button.tsx:49
  • surfsense_local/frontend/src/features/models/local/audio/download-audio-models.tsx:1 · surfsense_local/frontend/src/features/models/local/transcription/download-speech-models.tsx:1 — these 2 files are line-for-line copies of one another — 123 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — surfsense_local/frontend/src/features/models/local/audio/download-audio-models.tsx:1
  • surfsense_local/frontend/src/features/models/local/chat/download-chat-models.tsx:23 · surfsense_local/frontend/src/features/models/local/image/download-image-models.tsx:37 — the two spans are one implementation copied and then locally edited — 590 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/models/local/chat/download-chat-models.tsx:23
  • surfsense_local/frontend/src/features/plugins/browse/registry-headers-dialog.tsx:26 · surfsense_local/frontend/src/features/plugins/browse/registry-key-dialog.tsx:21 — the two spans are one implementation copied and then locally edited — 430 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/plugins/browse/registry-headers-dialog.tsx:26
  • www/app/(home)/pricing/individual/individual-sections.tsx:30 · www/app/(home)/pricing/pricing-sections.tsx:51 — the two spans are one implementation copied and then locally edited — 517 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — www/app/(home)/pricing/individual/individual-sections.tsx:30
  • surfsense_local/frontend/src/features/models/local/chat/model-card.tsx:27 · surfsense_local/frontend/src/features/onboarding/model-step/local/local-model-list.tsx:16 — the two spans are one implementation copied and then locally edited — 386 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/models/local/chat/model-card.tsx:27
  • surfsense_local/frontend/src/features/studio/viewers/pdf-viewer.tsx:61 · surfsense_local/frontend/src/features/studio/viewers/pptx-viewer.tsx:26 — the two spans are one implementation copied and then locally edited — 364 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/studio/viewers/pdf-viewer.tsx:61
  • surfsense_local/frontend/src/features/plugins/browse/registry-key-dialog.tsx:21 · surfsense_local/frontend/src/features/plugins/details/replace-key-button.tsx:23 — the two spans are one implementation copied and then locally edited — 395 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/plugins/browse/registry-key-dialog.tsx:21
  • surfsense_local/frontend/src/features/models/remote/connections/chatgpt/chatgpt-option.tsx:21 · surfsense_local/frontend/src/features/models/remote/connections/claude/claude-option.tsx:22 — the two spans are one implementation copied and then locally edited — 307 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/models/remote/connections/chatgpt/chatgpt-option.tsx:21
  • surfsense_local/frontend/src/features/studio/viewers/flashcards/flashcards-viewer.tsx:58 · surfsense_local/frontend/src/features/studio/viewers/quiz/quiz-viewer.tsx:50 — the two spans are one implementation copied and then locally edited — 355 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/studio/viewers/flashcards/flashcards-viewer.tsx:58
  • surfsense_local/runtimes/audiocpp/stage.mjs:25 · surfsense_local/runtimes/sdcpp/stage.mjs:22 — the two spans are one implementation copied and then locally edited — 535 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/runtimes/audiocpp/stage.mjs:25
  • surfsense_local/frontend/src/features/sources/rename-source-dialog.tsx:26 · surfsense_local/frontend/src/features/sources/tree/folder-name-dialog.tsx:30 — the two spans are one implementation copied and then locally edited — 357 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/sources/rename-source-dialog.tsx:26
  • www/app/(home)/license/page.tsx:37 · www/app/(home)/license/success/page.tsx:19 — the two spans are one implementation copied and then locally edited — 357 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — www/app/(home)/license/page.tsx:37
  • www/app/(home)/external-mcp-connectors/page.tsx:203 · www/app/(home)/mcp-server/page.tsx:238 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — www/app/(home)/external-mcp-connectors/page.tsx:203
  • surfsense_local/frontend/src/features/studio/viewers/html-viewer.tsx:12 · surfsense_local/frontend/src/features/studio/viewers/xlsx-viewer.tsx:94 — the two spans are one implementation copied and then locally edited — 226 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/studio/viewers/html-viewer.tsx:12
  • surfsense_local/frontend/src/features/access/setup-screen.tsx:52 · surfsense_local/frontend/src/features/access/sign-in-screen.tsx:57 — the two spans are one implementation copied and then locally edited — 228 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/access/setup-screen.tsx:52
  • surfsense_local/frontend/src/features/plugins/add-custom/add-plugin-dialog.tsx:147 · surfsense_local/frontend/src/features/plugins/sign-in/own-app/own-app-fields.tsx:111 — the two spans are one implementation copied and then locally edited — 187 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/plugins/add-custom/add-plugin-dialog.tsx:147
  • www/app/(home)/external-mcp-connectors/page.tsx:310 · www/app/(home)/mcp-server/page.tsx:358 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — www/app/(home)/external-mcp-connectors/page.tsx:310
  • surfsense_local/sidecars/audiocpp-transcription.ts:18 · surfsense_local/sidecars/audiocpp.ts:51 — 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. — surfsense_local/sidecars/audiocpp-transcription.ts:18
  • surfsense_local/frontend/src/features/plugins/details/disconnect-plugin-button.tsx:55 · surfsense_local/frontend/src/features/plugins/details/remove-plugin-dialog.tsx:36 — 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. — surfsense_local/frontend/src/features/plugins/details/disconnect-plugin-button.tsx:55
  • surfsense_local/frontend/src/features/chat/chats-dialog.tsx:116 · surfsense_local/frontend/src/features/workspaces/workspace-rail.tsx:112 — 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. — surfsense_local/frontend/src/features/chat/chats-dialog.tsx:116
  • surfsense_local/frontend/src/features/models/remote/connections/chatgpt/api.ts:24 · surfsense_local/frontend/src/features/models/remote/connections/claude/api.ts:35 — 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. — surfsense_local/frontend/src/features/models/remote/connections/chatgpt/api.ts:24
  • surfsense_local/frontend/src/features/models/your-models/use-audio-models.ts:11 · surfsense_local/frontend/src/features/models/your-models/use-speech-models.ts:10 — the two spans are one implementation copied and then locally edited — 135 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — surfsense_local/frontend/src/features/models/your-models/use-audio-models.ts:11
  • surfsense_local/frontend/src/features/settings/models/audio-models-settings.tsx:15 · surfsense_local/frontend/src/features/settings/models/image-models-settings.tsx:15 — 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. — surfsense_local/frontend/src/features/settings/models/audio-models-settings.tsx:15
  • surfsense_local/frontend/src/features/settings/models/image-edit-models-settings.tsx:17 · surfsense_local/frontend/src/features/settings/models/video-models-settings.tsx:17 — 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. — surfsense_local/frontend/src/features/settings/models/image-edit-models-settings.tsx:17
  • surfsense_local/frontend/src/features/file-viewers/pdf-viewer.tsx:242 · surfsense_local/frontend/src/features/studio/viewers/docx-viewer.tsx:271 · surfsense_local/frontend/src/features/studio/viewers/pdf-viewer.tsx:255 — 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. — surfsense_local/frontend/src/features/file-viewers/pdf-viewer.tsx:242
  • www/features/license/license-forms.tsx:157 · www/features/license/license-forms.tsx:212 — the two spans are one implementation copied and then locally edited — 240 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — www/features/license/license-forms.tsx:157
  • surfsense_local/sidecars/watch-audio-models.ts:15 · surfsense_local/sidecars/watch-generation-preset.ts:21 — 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. — surfsense_local/sidecars/watch-audio-models.ts:15
  • surfsense_local/frontend/src/features/plugins/connection/edit-connection-button.tsx:59 · surfsense_local/frontend/src/features/plugins/details/edit-headers-button.tsx:49 · surfsense_local/frontend/src/features/plugins/details/replace-key-button.tsx:35 — the 3 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — surfsense_local/frontend/src/features/plugins/connection/edit-connection-button.tsx:59
  • surfsense_local/electron/src/main/i18n/locale-prefs.ts:17 · surfsense_local/electron/src/main/theme-prefs.ts:20 — 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. — surfsense_local/electron/src/main/i18n/locale-prefs.ts:17
  • www/app/(home)/external-mcp-connectors/page.tsx:136 · www/app/(home)/mcp-server/page.tsx:171 — 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. — www/app/(home)/external-mcp-connectors/page.tsx:136

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R11 · Import Boundaries7.2 / 10Strong✓ Tool-verified

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

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

  • surfsense_local/electron/scripts/notices/native-components.mjs:13 reaches into another package with a relative path (../../node_modules/electron/package.json) — import the package by name instead. — surfsense_local/electron/scripts/notices/native-components.mjs:13
  • surfsense_local/electron/src/main/i18n/locale-prefs.ts:8 reaches into another package with a relative path (../../../../sidecars/session-log/main-warn.ts) — import the package by name instead. — surfsense_local/electron/src/main/i18n/locale-prefs.ts:8
  • surfsense_local/electron/src/main/i18n/locale-prefs.ts:9 reaches into another package with a relative path (../../../../sidecars/session-log/session-log.ts) — import the package by name instead. — surfsense_local/electron/src/main/i18n/locale-prefs.ts:9
  • REDACTED:29 reaches into another package with a relative path (../../../sidecars/boot.ts) — import the package by name instead. — REDACTED:29
  • REDACTED:30 reaches into another package with a relative path (../../../sidecars/stop-once.ts) — import the package by name instead. — REDACTED:30
  • REDACTED:31 reaches into another package with a relative path (../../../sidecars/supervisor.ts) — import the package by name instead. — REDACTED:31
  • REDACTED:32 reaches into another package with a relative path (../../../sidecars/types.ts) — import the package by name instead. — REDACTED:32
  • REDACTED:40 reaches into another package with a relative path (../../../sidecars/api-url/announce-api-url.ts) — import the package by name instead. — REDACTED:40
  • REDACTED:46 reaches into another package with a relative path (../../../sidecars/session-log/session-log.ts) — import the package by name instead. — REDACTED:46
  • REDACTED:47 reaches into another package with a relative path (../../../sidecars/session-log/main-warn.ts) — import the package by name instead. — REDACTED:47
  • surfsense_local/electron/src/main/privacy-choices/start-privacy-choices.ts:14 reaches into another package with a relative path (../../../../sidecars/session-log/main-warn.ts) — import the package by name instead. — surfsense_local/electron/src/main/privacy-choices/start-privacy-choices.ts:14
  • surfsense_local/electron/src/main/privacy-choices/start-privacy-choices.ts:15 reaches into another package with a relative path (../../../../sidecars/session-log/session-log.ts) — import the package by name instead. — surfsense_local/electron/src/main/privacy-choices/start-privacy-choices.ts:15
  • surfsense_local/electron/src/main/session-log/session-log-ipc.ts:3 reaches into another package with a relative path (../../../../sidecars/session-log/session-log.ts) — import the package by name instead. — surfsense_local/electron/src/main/session-log/session-log-ipc.ts:3
  • surfsense_local/electron/src/main/session-log/updater-log.ts:1 reaches into another package with a relative path (../../../../sidecars/session-log/session-log.ts) — import the package by name instead. — surfsense_local/electron/src/main/session-log/updater-log.ts:1
  • surfsense_local/electron/src/main/theme-prefs.ts:6 reaches into another package with a relative path (../../../sidecars/session-log/main-warn.ts) — import the package by name instead. — surfsense_local/electron/src/main/theme-prefs.ts:6
  • surfsense_local/electron/src/main/theme-prefs.ts:7 reaches into another package with a relative path (../../../sidecars/session-log/session-log.ts) — import the package by name instead. — surfsense_local/electron/src/main/theme-prefs.ts:7
  • surfsense_local/electron/src/main/update-feed/latest-manifest.ts:2 imports electron-updater/out/providers/Provider.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — surfsense_local/electron/src/main/update-feed/latest-manifest.ts:2
  • surfsense_local/electron/src/main/update-feed/surfsense-feed-provider.ts:2 imports electron-updater/out/providers/Provider.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — surfsense_local/electron/src/main/update-feed/surfsense-feed-provider.ts:2
  • surfsense_local/electron/src/main/window-state.ts:6 reaches into another package with a relative path (../../../sidecars/session-log/main-warn.ts) — import the package by name instead. — surfsense_local/electron/src/main/window-state.ts:6
  • surfsense_local/electron/src/main/window-state.ts:7 reaches into another package with a relative path (../../../sidecars/session-log/session-log.ts) — import the package by name instead. — surfsense_local/electron/src/main/window-state.ts:7
  • surfsense_local/headless/caddy.ts:5 reaches into another package with a relative path (../sidecars/types.ts) — import the package by name instead. — surfsense_local/headless/caddy.ts:5
  • surfsense_local/headless/context-from-env.ts:9 reaches into another package with a relative path (../sidecars/boot.ts) — import the package by name instead. — surfsense_local/headless/context-from-env.ts:9
  • surfsense_local/headless/main.ts:12 reaches into another package with a relative path (../sidecars/api-url/announce-api-url.ts) — import the package by name instead. — surfsense_local/headless/main.ts:12
  • surfsense_local/headless/main.ts:13 reaches into another package with a relative path (../sidecars/boot.ts) — import the package by name instead. — surfsense_local/headless/main.ts:13
  • surfsense_local/headless/main.ts:14 reaches into another package with a relative path (../sidecars/stop-once.ts) — import the package by name instead. — surfsense_local/headless/main.ts:14
  • surfsense_local/headless/main.ts:15 reaches into another package with a relative path (../sidecars/net.ts) — import the package by name instead. — surfsense_local/headless/main.ts:15
  • surfsense_local/headless/main.ts:16 reaches into another package with a relative path (../sidecars/supervisor.ts) — import the package by name instead. — surfsense_local/headless/main.ts:16
  • surfsense_local/headless/main.ts:17 reaches into another package with a relative path (../sidecars/types.ts) — import the package by name instead. — surfsense_local/headless/main.ts:17

What to do

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

  • stepLabel has cyclomatic complexity 59 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:44
  • (anonymous) has cyclomatic complexity 48 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/plugins/plugins-settings.test.tsx:181
  • (anonymous) has cyclomatic complexity 47 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/onboarding/onboarding-page.test.tsx:170
  • DocumentRow has cyclomatic complexity 42 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/sources/tree/document-row.tsx:53
  • (anonymous) has cyclomatic complexity 35 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/chat/use-chat-runtime.ts:590
  • ArtifactPanel has cyclomatic complexity 33 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/studio/artifact-panel.tsx:70
  • ArtifactRow has cyclomatic complexity 32 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/studio/artifact-list.tsx:129
  • SourcesPanel has cyclomatic complexity 30 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/sources/sources-panel.tsx:79
  • ChatComposer has cyclomatic complexity 30 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/chat/chat-composer.tsx:154
  • ConnectionForm has cyclomatic complexity 29 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx:96
  • PluginSearchResults has cyclomatic complexity 27 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/plugins/search/plugin-search-results.tsx:51
  • FileCard has cyclomatic complexity 24 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — www/app/(home)/_home/home-formats/file-card-collections.tsx:94
  • parseStudyText has cyclomatic complexity 22 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/studio/viewers/parse-study-text.ts:34
  • onRowKeyDown has cyclomatic complexity 22 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/sources/tree/source-tree.tsx:143
  • listingFromEntry has cyclomatic complexity 22 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — www/app/(home)/plugins/plugin-listing.ts:71
  • PluginActionsMenu has cyclomatic complexity 22 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/plugins/details/plugin-actions-menu.tsx:40
  • (anonymous) has cyclomatic complexity 21 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/sources/use-sources.ts:395
  • main has cyclomatic complexity 21 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/runtimes/audiocpp/stage.mjs:69
  • (anonymous) has cyclomatic complexity 21 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/sources/tree/source-tree.test.tsx:69
  • ReplyHeader has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/chat/reply-thinking.tsx:160
  • ServerModels has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/models/remote/models/server-models.tsx:77
  • cellText has cyclomatic complexity 20 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/studio/viewers/parse-workbook.ts:36
  • toRuntimeMessage has cyclomatic complexity 20 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/chat/thread-messages.ts:85
  • LicenseSettings has cyclomatic complexity 20 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/license/license-settings.tsx:264
  • RefineBox has cyclomatic complexity 20 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/studio/refine-box.tsx:37
  • readPolicy has cyclomatic complexity 19 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/electron/src/main/admin-policy/read-policy.ts:52
  • AddSourcesMenu has cyclomatic complexity 19 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/sources/add-sources-menu.tsx:39
  • WorkspaceDashboard has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx:94
  • SettingsDialog has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/settings/settings-dialog.tsx:329
  • AddFromWebDialog has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx:54
  • (anonymous) has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/chat/chats-dialog.tsx:415
  • ModelSlotSettings has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/settings/models/model-slot-settings.tsx:67
  • Composer has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/studio/studio-panel.tsx:137
  • pluginStatus has cyclomatic complexity 18 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/plugins/yours/plugin-status.ts:15
  • (anonymous) has cyclomatic complexity 17 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/headless/access/server.ts:135
  • UpdateSettings has cyclomatic complexity 17 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/updates/update-settings.tsx:55
  • shadePassages has cyclomatic complexity 16 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/studio/viewers/docx-comments.ts:114
  • (anonymous) has cyclomatic complexity 16 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/chat/use-chat-runtime.test.tsx:104
  • walk has cyclomatic complexity 16 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/sources/tree/scope-state.ts:161
  • ModelCard has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — surfsense_local/frontend/src/features/models/local/chat/model-card.tsx:34
R3 · Large Files9.0 / 10Strong✓ 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.

  • surfsense_local/frontend/src/features/chat/use-chat-runtime.ts has 959 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/chat/use-chat-runtime.ts:1
  • surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx has 839 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx:1
  • surfsense_local/frontend/src/features/studio/artifact-list.tsx has 808 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/studio/artifact-list.tsx:1
  • surfsense_local/frontend/src/features/sources/use-sources.ts has 679 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/sources/use-sources.ts:1
  • surfsense_local/frontend/src/features/sources/sources-panel.tsx has 608 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/sources/sources-panel.tsx:1
  • surfsense_local/frontend/src/features/chat/chats-dialog.tsx has 605 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/chat/chats-dialog.tsx:1
  • www/app/(home)/privacy/page.tsx has 537 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — www/app/(home)/privacy/page.tsx:1
  • REDACTED has 531 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx has 520 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx:1
  • surfsense_local/frontend/src/features/studio/studio-panel.tsx has 520 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/studio/studio-panel.tsx:1
  • surfsense_local/frontend/src/features/models/remote/models/server-models.tsx has 505 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/models/remote/models/server-models.tsx:1
  • surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx has 495 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx:1
  • surfsense_local/frontend/src/features/onboarding/welcome-backdrop/gradient-ascii.tsx has 476 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/onboarding/welcome-backdrop/gradient-ascii.tsx:1
  • surfsense_local/frontend/src/features/studio/podcast-brief-form.tsx has 475 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/studio/podcast-brief-form.tsx:1
  • surfsense_local/frontend/src/features/models/local/chat/model-search.tsx has 466 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/models/local/chat/model-search.tsx:1
  • surfsense_local/frontend/src/features/studio/viewers/flashcards/flashcards-viewer.tsx has 465 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/studio/viewers/flashcards/flashcards-viewer.tsx:1
  • surfsense_local/frontend/src/features/license/license-settings.tsx has 461 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/license/license-settings.tsx:1
  • surfsense_local/frontend/src/features/settings/settings-dialog.tsx has 461 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/settings/settings-dialog.tsx:1
  • surfsense_local/frontend/src/features/sources/tree/document-row.tsx has 457 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/sources/tree/document-row.tsx:1
  • surfsense_local/frontend/src/features/chat/thread-panel.tsx has 440 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/chat/thread-panel.tsx:1
  • surfsense_local/frontend/src/features/chat/chat-composer.tsx has 416 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/chat/chat-composer.tsx:1
  • www/app/(home)/mcp-server/page.tsx has 415 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — www/app/(home)/mcp-server/page.tsx:1
  • surfsense_local/frontend/src/features/chat/message.tsx has 412 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — surfsense_local/frontend/src/features/chat/message.tsx:1
  • www/app/(home)/terms/page.tsx has 405 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — www/app/(home)/terms/page.tsx:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage8.2 / 10Strong✓ 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. (×40) — www/app/(home)/privacy/page.tsx:1, www/app/(home)/terms/page.tsx:1, www/app/(home)/mcp-server/page.tsx:1, …

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 Code9.8 / 10Exemplary✓ Tool-verified

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

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

  • Unreachable from the 248 application, 19 tooling and 255 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (248 application, 19 tooling, 255 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×2) — surfsense_local/frontend/src/components/ui/stepper.tsx, surfsense_local/electron/scripts/electron-dev.mjs
  • Nothing imports this binding — it is safe to review for removal. (×3) — surfsense_local/frontend/src/features/models/local/installs/api.ts:37, surfsense_local/frontend/src/features/sources/api.ts:120, surfsense_local/frontend/src/features/sources/folder-upload/upload-plan.ts:23

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 Hygiene7.5 / 10Strong✓ 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.

  • Declared in www/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3) — www/package.json:42, www/package.json:45, www/package.json:52
  • Only test files import it (first: surfsense_local/frontend/src/features/studio/viewers/code-highlighter.test.ts:3) — move it to devDependencies. — surfsense_local/frontend/package.json:34

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports8.2 / 10Strong✓ 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.

  • surfsense_local/frontend/src/features/sources/web/web-list-panel.tsx → surfsense_local/frontend/src/features/sources/web/web-result-rows.tsx → surfsense_local/frontend/src/features/sources/web/web-result-row.tsx → surfsense_local/frontend/src/features/sources/web/web-list-panel.tsx — surfsense_local/frontend/src/features/sources/web/web-list-panel.tsx:8

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture8.5 / 10Strong✓ Tool-verified

Other · Security — Only what this repository's own non-C# files could be read for was assessed — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.

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

  • Set: Content-Security-Policy. Missing: Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each. (−1.5 on this card.) — REDACTED:11

What to do

  • Add Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options beside the headers already set; Content-Security-Policy is the one that pays for itself first, then Strict-Transport-Security, then nosniff and a frame policy.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

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

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

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

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

X17 · Uncapped recursion over a caller-supplied document1.6 / 10Critical✓ Tool-verified

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

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

  • `inline_text` is public, takes a document from its caller (line 56) and hands it to `_content`, which calls itself at line 98 (`_content`) with a piece of `container` (and at line 102, line 106) — and nowhere in `_content` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_content` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — surfsense_local/backend/worker/ingestion/word_markdown/inline.py:98
  • `inline_text` is public, takes a document from its caller (line 56) and hands it to `_base_runs`, which calls itself at line 142 (`_base_runs`) with a piece of `base` — and nowhere in `_base_runs` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_base_runs` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — surfsense_local/backend/worker/ingestion/word_markdown/inline.py:142
  • `rows_of` is public, takes a document from its caller (line 30) and hands it to `_wrapped`, which calls itself at line 78 (`_wrapped`) with a piece of `parent` (and at line 80) — and nowhere in `_wrapped` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_wrapped` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — surfsense_local/backend/worker/ingestion/word_markdown/tables.py:78
  • `put` is public and takes `value: object` from its caller, and it calls itself at line 57 (`put`) with a piece of `value` — and nowhere in `put` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `put` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — surfsense_local/backend/scripts/opencv/record_calls.py:57
  • `step_of` is public, takes a document from its caller (line 40) and hands it to `_shown`, which calls itself at line 92 (`_shown`) with a piece of `value` (and at line 97) — and nowhere in `_shown` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_shown` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — surfsense_local/backend/modules/agent/agent_threads/steps.py:92
  • `find_all` is public, takes a document from its caller (line 24) and hands it to `_walk`, which calls itself at line 33 (`_walk`) with a piece of `node` (and at line 36) — and nowhere in `_walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — backend/plugins/proprietary/youtube/parsers.py:33
  • `find_first` is public, takes a document from its caller (line 61) and hands it to `_first`, which calls itself at line 50 (`_first`) with a piece of `node` (and at line 55) — and nowhere in `_first` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_first` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — backend/plugins/proprietary/youtube/parsers.py:50

What to do

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

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

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

X2 · Cancellation propagation7.5 / 10Strong✓ Tool-verified

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

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

  • Only 18/31 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `postJson` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — www/features/license/license-forms.tsx:46
  • `getReleaseAssets` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — www/features/downloads/release-assets.ts:33
  • `getStarCount` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — www/components/site/github-stars.ts:32
  • `registryPlugins` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — www/app/(home)/plugins/registry-plugins.ts:13
  • `getPublishedInstallers` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — www/app/(home)/downloads/[platform]/published-installers.ts:29
  • `reconcile` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:24
  • `download` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×2) — surfsense_local/runtimes/fetch-llamacpp.mjs:111, surfsense_local/runtimes/pinned-download.mjs:13
  • `queryFn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. (×2) — surfsense_local/frontend/src/features/studio/viewers/html-viewer.tsx:26, surfsense_local/frontend/src/features/studio/viewers/xlsx-viewer.tsx:108
  • `layOutSnapshot` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — surfsense_local/frontend/src/features/docx-snapshot/snapshot-page.ts:26
  • `getAccessState` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — surfsense_local/frontend/src/features/access/api.ts:36
  • `captureWebPage` holds an AbortSignal but calls `wait(…)` without it, so its caller's cancellation never reaches that call and it runs to its end after whatever wanted it has given up. Hand the signal on: `wait(…, { signal })`. — surfsense_local/electron/src/main/docx-snapshot/capture-web-page.ts:18

What to do

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

X28 · Index access outside its own emptiness guard6.9 / 10Adequate✓ Tool-verified

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

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

  • This condition tests `segments` for emptiness and then indexes it on a branch that test does not reach. `segments[0]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `segments` being empty — so an empty `segments` indexes position 0 of nothing and throws. This same condition already shows the intended bracketing: `segments[1]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `segments` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `segments`. — backend/plugins/proprietary/tiktok/targets/resolver.py:35

What to do

  • Each finding names the index access that escapes the guard and the line of the correctly bracketed access beside it. Compare the two: they differ only in where one parenthesis sits. Move it so the emptiness test brackets every access to that symbol — and if the value provably cannot be empty at this point, delete the test rather than leave a condition that guards one access and not its neighbour.
X3 · Exception handling6.5 / 10Adequate✓ Tool-verified

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

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

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×25) — www/instrumentation-client.ts:63, www/instrumentation.ts:26, www/instrumentation.ts:33, …
  • `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×12) — www/features/celebration/confetti-burst.ts:29, www/app/error.tsx:18, REDACTED:254, …
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. (×2) — REDACTED:35, surfsense_local/frontend/src/features/plugins/license-verdict.ts:20
  • `.then(…, () => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. — surfsense_local/frontend/src/features/onboarding/welcome-backdrop/gradient-ascii.tsx:196

What to do

  • Swallowed exception (empty catch)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

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

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

X4 · Structured logging7.9 / 10Strong✓ Tool-verified

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

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

  • `info` at line 1162 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — backend/plugins/proprietary/web_crawl/connector.py:1162

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types8.4 / 10Strong✓ Tool-verified

Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • 4/5 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
  • ~0.2 `!` null assertions per 1k TypeScript source lines — 13 assertion(s) across the 84310 source line(s) of the 898 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: surfsense_local/frontend/src/features/about/data-folder.tsx (4), surfsense_local/electron/src/main/system-labels.ts (3), surfsense_local/frontend/src/features/studio/viewers/docx-comments.ts (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.

What to do

  • The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).

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

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 Health72.1StrongSolid.
Architecture63.6Adequate — gated by D26, AX7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity91.7ExemplarySolid.
Readiness28.3Weak — gated by D11, D12, P3, P5, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security64.4Adequate — gated by D28, D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling100.0ExemplaryStrongest area.
Accessibility77.5StrongSolid.
Performance60.0AdequateAcceptable, with room to improve.
Unscored — 3 check(s) recorded observations but carry no score

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

  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 11 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 30 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 39 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 — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX4 Dependency direction — not applicable to a vertical-slice architecture (the inward-dependency rule is for layered/clean styles)
  • AX8 Test isolation — no test/production split to check
  • 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.
  • AXR1 Runtime accessibility — compose up failed (exit 17 — an image could not be built) — failed to solve: process "/bin/sh -c pnpm --version" did not complete successfully: exit code: 1; likely cause (the repository): a RUN step of the repository's REDACTED exited with code 1 (`/bin/sh -c pnpm --version`): the build's own command failed, for example a compile or test error; runtime evidence skipped The cause is in the repository, not in our sandbox: a RUN step of the repository's REDACTED exited with code 1 (`/bin/sh -c pnpm --version`): the build's own command failed, for example a compile or test error. Nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or MongoEngine model, a migration or a SQL schema — and no database or data-store client (Django ORM, SQLAlchemy, psycopg, PyMongo, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • 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 — API consistency is measured on C#, TypeScript, Go only; the exposed Python surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Aggregate roots were found in only one source directory (surfsense_local), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D32 Data Compliance (PII/GDPR) — 24 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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.
  • D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the node:test suite in surfsense_local/headless/ ran and not one test passed (throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath);), so the coverage would describe the failed run, not the code. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens 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 lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby, Scala, Rust and Java, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a pytest-benchmark or pytest-codspeed dependency with tests taking the `benchmark` fixture, an asv.conf.json with its `time_`/`mem_`/`peakmem_` benchmarks, or a pyperf Runner, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R5 Dependency Freshness — uses a pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — X16 reached only 44% of this repository's production lines — python (105,681 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — X29 reached only 44% of this repository's production lines — python (105,681 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 690 finding(s)
D11 · Test Reliability · Flaky test · ×507
  • Flaky test: surfsense_local/frontend/src/app/app-bootstrap.test.tsx::app bootstrap clears the notice once the key is fixed in Settings, without a reload — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/app/app-bootstrap.test.tsx::app bootstrap keeps completed users in the dashboard without a model — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/app/app-bootstrap.test.tsx::app bootstrap keeps the model when sending to its host is off, and asks before any send — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/app/app-bootstrap.test.tsx::app bootstrap keeps the saved model, holds the composer and says why when its check fails with provider_unreachable — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/app/app-bootstrap.test.tsx::app bootstrap keeps the saved model, holds the composer and says why when its check fails with unreadable_secret — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/app/app-bootstrap.test.tsx::app bootstrap sends the user to Network, not the model list, when egress is off — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/app/app-bootstrap.test.tsx::app bootstrap shows onboarding only before it has been completed — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/about/about-settings.test.tsx::AboutSettings in the Docker image shows the image's version and its release notes — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/access/access-gate.test.tsx::the access gate in the Docker image returns to the sign-in when the API says the session ended — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread adds a plugin refused mid-turn for more access to the ones named before — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread asks in the reply for a request that names no step, and says denying one denies the others — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread denies the command when the user says no — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread keeps one copy of a reply once opencode has stored it — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread leaves a paid plugin out of @ once its license was refused — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread names SurfSense's own tools in words, not by their tool names — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread names the plugins a turn could not reach, and why — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread names the source a reply looked at the pages of on every source — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread names the source a reply looks at the pages of as it streams — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread names the source a stored reply looked at the pages of — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread offers no thinking switch, which the agent never reads — Passed 2×, failed 4× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread offers the ready plugins after @, and sends the one picked — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread opens the document a render made in Studio from its step — Passed 2×, failed 4× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread runs a shell command only once the user allows it, asked on its step — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread says a render created a document whose earlier versions all failed — Passed 3×, failed 3× across repeated runs.
  • Flaky test: surfsense_local/frontend/src/features/agent/agent-thread.test.tsx::an agent thread says how many sources it prepares before the turn begins — Passed 3×, failed 3× across repeated runs.
  • + 482 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 83 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · High CVE · ×27
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 2 more in this group — see findings.md.
D28 · Secrets (history) · REDACTED · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical vulnerability · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×2
  • REDACTED
  • REDACTED
AC3 · Page structure · Document without a <title> · ×1
  • Document without a <title> www/app/global-error.tsx:20 — A page with no <title> gives no name in the tab, history or screen-reader page list. Declare it the way this router does — Next App Router `export const metadata = { title }`, React Router/Remix `export function meta`, TanStack Start `head`, or a Helmet/Head component.
D13 · REDACTED Scanning · Leaked secret · ×1
  • REDACTED
D28 · Secrets (history) · High secret · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
R9 · Circular Imports · Import cycle (3 files) · ×1
  • Import cycle (3 files) surfsense_local/frontend/src/features/sources/web/web-list-panel.tsx:8 — surfsense_local/frontend/src/features/sources/web/web-list-panel.tsx → surfsense_local/frontend/src/features/sources/web/web-result-rows.tsx → surfsense_local/frontend/src/features/sources/web/web-result-row.tsx → surfsense_local/frontend/src/features/sources/web/web-list-panel.tsx
Serious — 990 finding(s)
D3 · God Classes · FunctionTooLong · ×71
  • FunctionTooLong: use-chat-runtime.useChatRuntime surfsense_local/frontend/src/features/chat/use-chat-runtime.ts:220 — FunctionTooLong — useChatRuntime runs 559 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 459 over it, 5.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: page.PrivacyPolicy www/app/(home)/privacy/page.tsx:71 — FunctionTooLong — PrivacyPolicy runs 472 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 372 over it, 4.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: sources-panel.SourcesPanel surfsense_local/frontend/src/features/sources/sources-panel.tsx:79 — FunctionTooLong — SourcesPanel runs 446 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 346 over it, 4.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: use-sources.useSources surfsense_local/frontend/src/features/sources/use-sources.ts:76 — FunctionTooLong — useSources runs 438 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 338 over it, 4.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: dashboard-page.WorkspaceDashboard surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx:94 — FunctionTooLong — WorkspaceDashboard runs 409 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 309 over it, 4.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: gradient-ascii.GradientAscii surfsense_local/frontend/src/features/onboarding/welcome-backdrop/gradient-ascii.tsx:63 — FunctionTooLong — GradientAscii runs 372 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 272 over it, 3.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: connection-form.ConnectionForm surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx:96 — FunctionTooLong — ConnectionForm runs 357 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 257 over it, 3.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: server-models.ServerModels surfsense_local/frontend/src/features/models/remote/models/server-models.tsx:77 — FunctionTooLong — ServerModels runs 356 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 256 over it, 3.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: document-row.DocumentRow surfsense_local/frontend/src/features/sources/tree/document-row.tsx:53 — FunctionTooLong — DocumentRow runs 335 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 235 over it, 3.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: page.TermsOfService www/app/(home)/terms/page.tsx:82 — FunctionTooLong — TermsOfService runs 331 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 231 over it, 3.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: flashcards-viewer.FlashcardRunner surfsense_local/frontend/src/features/studio/viewers/flashcards/flashcards-viewer.tsx:101 — FunctionTooLong — FlashcardRunner runs 309 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 209 over it, 3.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: model-step.ModelStep surfsense_local/frontend/src/features/onboarding/model-step/model-step.tsx:52 — FunctionTooLong — ModelStep runs 273 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 173 over it, 2.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: file-card-collections.FileCard www/app/(home)/_home/home-formats/file-card-collections.tsx:94 — FunctionTooLong — FileCard runs 255 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 155 over it, 2.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: artifact-list.ArtifactRow surfsense_local/frontend/src/features/studio/artifact-list.tsx:129 — FunctionTooLong — ArtifactRow runs 248 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: podcast-brief-form.PodcastBriefForm surfsense_local/frontend/src/features/studio/podcast-brief-form.tsx:134 — FunctionTooLong — PodcastBriefForm runs 244 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: quiz-viewer.QuizRunner surfsense_local/frontend/src/features/studio/viewers/quiz/quiz-viewer.tsx:86 — FunctionTooLong — QuizRunner runs 238 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 138 over it, 2.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: page.McpServerPage www/app/(home)/mcp-server/page.tsx:184 — FunctionTooLong — McpServerPage runs 232 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 132 over it, 2.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: chats-dialog.ChatList surfsense_local/frontend/src/features/chat/chats-dialog.tsx:342 — FunctionTooLong — ChatList runs 231 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: chat-composer.ChatComposer surfsense_local/frontend/src/features/chat/chat-composer.tsx:154 — FunctionTooLong — ChatComposer runs 223 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 123 over it, 2.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: page.ExternalMcpConnectorsPage www/app/(home)/external-mcp-connectors/page.tsx:149 — FunctionTooLong — ExternalMcpConnectorsPage runs 218 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 118 over it, 2.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: workspace-rail.WorkspaceRail surfsense_local/frontend/src/features/workspaces/workspace-rail.tsx:151 — FunctionTooLong — WorkspaceRail runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: score-screen.QuizScoreScreen surfsense_local/frontend/src/features/studio/viewers/quiz/score-screen.tsx:81 — FunctionTooLong — QuizScoreScreen runs 214 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 114 over it, 2.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: step-label.stepLabel REDACTED:44 — FunctionTooLong — stepLabel runs 213 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: studio-panel.Composer surfsense_local/frontend/src/features/studio/studio-panel.tsx:137 — FunctionTooLong — Composer runs 203 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 103 over it, 2.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: source-tree.SourceTree surfsense_local/frontend/src/features/sources/tree/source-tree.tsx:52 — FunctionTooLong — SourceTree runs 199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 99 over it, 1.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 46 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×59
  • Hotspot: surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx:94 — surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx changed 109 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in dashboard-page.WorkspaceDashboard at line 94. 14 of those changes were fix/bug commits, and the other 95 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/sources/sources-panel.tsx surfsense_local/frontend/src/features/sources/sources-panel.tsx:79 — surfsense_local/frontend/src/features/sources/sources-panel.tsx changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in sources-panel.SourcesPanel at line 79. 4 of those changes were fix/bug commits, and the other 44 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/sources/sources-panel.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/chat/use-chat-runtime.ts surfsense_local/frontend/src/features/chat/use-chat-runtime.ts:220 — surfsense_local/frontend/src/features/chat/use-chat-runtime.ts changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in use-chat-runtime.useChatRuntime at line 220. 15 of those changes were fix/bug commits, and the other 33 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/chat/use-chat-runtime.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:168 — REDACTED changed 61 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in index.registerDocumentHandlers at line 168. 11 of those changes were fix/bug commits, and the other 50 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/chat/thread-panel.tsx surfsense_local/frontend/src/features/chat/thread-panel.tsx:159 — surfsense_local/frontend/src/features/chat/thread-panel.tsx changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in thread-panel.ThreadPanel at line 159. 12 of those changes were fix/bug commits, and the other 38 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/chat/thread-panel.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/chat/chats-dialog.tsx surfsense_local/frontend/src/features/chat/chats-dialog.tsx:342 — surfsense_local/frontend/src/features/chat/chats-dialog.tsx changed 45 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in chats-dialog.ChatList at line 342. 4 of those changes were fix/bug commits, and the other 41 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/chat/chats-dialog.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/chat/chat-composer.tsx surfsense_local/frontend/src/features/chat/chat-composer.tsx:154 — surfsense_local/frontend/src/features/chat/chat-composer.tsx changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in chat-composer.ChatComposer at line 154. 13 of those changes were fix/bug commits, and the other 22 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/chat/chat-composer.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/backend/modules/agent/agent_threads/turn.py surfsense_local/backend/modules/agent/agent_threads/turn.py:192 — surfsense_local/backend/modules/agent/agent_threads/turn.py changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in turn._stream at line 192. 10 of those changes were fix/bug commits, and the other 20 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/modules/agent/agent_threads/turn.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/settings/settings-dialog.tsx surfsense_local/frontend/src/features/settings/settings-dialog.tsx:329 — surfsense_local/frontend/src/features/settings/settings-dialog.tsx changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in settings-dialog.SettingsDialog at line 329. 5 of those changes were fix/bug commits, and the other 41 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/settings/settings-dialog.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/studio/artifact-list.tsx surfsense_local/frontend/src/features/studio/artifact-list.tsx:129 — surfsense_local/frontend/src/features/studio/artifact-list.tsx changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in artifact-list.ArtifactRow at line 129. 7 of those changes were fix/bug commits, and the other 25 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, 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. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/studio/artifact-list.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/backend/worker/studio/job.py surfsense_local/backend/worker/studio/job.py:97 — surfsense_local/backend/worker/studio/job.py changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in job._generate at line 97. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/worker/studio/job.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/studio/studio-panel.tsx surfsense_local/frontend/src/features/studio/studio-panel.tsx:137 — surfsense_local/frontend/src/features/studio/studio-panel.tsx changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in studio-panel.Composer at line 137. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/studio/studio-panel.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/onboarding/model-step/model-step.tsx surfsense_local/frontend/src/features/onboarding/model-step/model-step.tsx:52 — surfsense_local/frontend/src/features/onboarding/model-step/model-step.tsx changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in model-step.ModelStep at line 52. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/onboarding/model-step/model-step.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx:54 — surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in add-from-web-dialog.AddFromWebDialog at line 54. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/studio/artifact-panel.tsx surfsense_local/frontend/src/features/studio/artifact-panel.tsx:70 — surfsense_local/frontend/src/features/studio/artifact-panel.tsx changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in artifact-panel.ArtifactPanel at line 70. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/studio/artifact-panel.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: REDACTED REDACTED:44 — REDACTED changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in step-label.stepLabel at line 44. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/sources/use-sources.ts surfsense_local/frontend/src/features/sources/use-sources.ts:395 — surfsense_local/frontend/src/features/sources/use-sources.ts changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in use-sources.useSources.uploadEntries at line 395. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/sources/use-sources.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/backend/modules/agent/engines/claude_code/turn.py surfsense_local/backend/modules/agent/engines/claude_code/turn.py:210 — surfsense_local/backend/modules/agent/engines/claude_code/turn.py changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in turn._stream at line 210. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/modules/agent/engines/claude_code/turn.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/models/remote/models/server-models.tsx surfsense_local/frontend/src/features/models/remote/models/server-models.tsx:77 — surfsense_local/frontend/src/features/models/remote/models/server-models.tsx changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in server-models.ServerModels at line 77. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/models/remote/models/server-models.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/studio/viewers/docx-viewer.tsx surfsense_local/frontend/src/features/studio/viewers/docx-viewer.tsx:71 — surfsense_local/frontend/src/features/studio/viewers/docx-viewer.tsx changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in docx-viewer.DocxViewer at line 71. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/studio/viewers/docx-viewer.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/chat/reply-thinking.tsx surfsense_local/frontend/src/features/chat/reply-thinking.tsx:160 — surfsense_local/frontend/src/features/chat/reply-thinking.tsx changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in reply-thinking.ReplyHeader at line 160. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/chat/reply-thinking.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/studio/viewers/quiz/quiz-viewer.tsx surfsense_local/frontend/src/features/studio/viewers/quiz/quiz-viewer.tsx:86 — surfsense_local/frontend/src/features/studio/viewers/quiz/quiz-viewer.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in quiz-viewer.QuizRunner at line 86. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/studio/viewers/quiz/quiz-viewer.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/updates/update-settings.tsx surfsense_local/frontend/src/features/updates/update-settings.tsx:55 — surfsense_local/frontend/src/features/updates/update-settings.tsx changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in update-settings.UpdateSettings at line 55. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/updates/update-settings.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/sources/tree/document-row.tsx surfsense_local/frontend/src/features/sources/tree/document-row.tsx:53 — surfsense_local/frontend/src/features/sources/tree/document-row.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in document-row.DocumentRow at line 53. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/sources/tree/document-row.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx:96 — surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in connection-form.ConnectionForm at line 96. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 34 more in this group — see findings.md.
AX7 · Slice cohesion · Cross-slice coupling · ×40
  • Cross-slice coupling: about → external-links surfsense_local/frontend/src/features/about/about-links.ts:13 — `docsUrl` (slice 'about') depends on `siteVisitUrl` from slice 'external-links'.
  • Cross-slice coupling: about → settings surfsense_local/frontend/src/features/about/about-settings.tsx:59 — `AboutSettings` (slice 'about') depends on `SettingsSection` from slice 'settings'.
  • Cross-slice coupling: about → updates surfsense_local/frontend/src/features/about/about-settings.tsx:72 — `AboutSettings` (slice 'about') depends on `UpdateSettings` from slice 'updates'.
  • Cross-slice coupling: about → privacy-choices surfsense_local/frontend/src/features/about/about-settings.tsx:73 — `AboutSettings` (slice 'about') depends on `UsageStatisticsSettings` from slice 'privacy-choices'.
  • Cross-slice coupling: about → feedback surfsense_local/frontend/src/features/about/data-folder.tsx:24 — `DataFolder` (slice 'about') depends on `errorToast` from slice 'feedback'.
  • Cross-slice coupling: access → settings surfsense_local/frontend/src/features/access/access-settings.tsx:179 — `AccessSettings` (slice 'access') depends on `SettingsSection` from slice 'settings'.
  • Cross-slice coupling: agent → studio surfsense_local/frontend/src/features/agent/agent-steps.tsx:64 — `StepLine` (slice 'agent') depends on `useOpenArtifact` from slice 'studio'.
  • Cross-slice coupling: agent → plugins surfsense_local/frontend/src/features/agent/agent-steps.tsx:65 — `StepLine` (slice 'agent') depends on `mayBePluginStep` from slice 'plugins'.
  • Cross-slice coupling: agent → plugins surfsense_local/frontend/src/features/agent/agent-steps.tsx:67 — `StepLine` (slice 'agent') depends on `PluginStepLine` from slice 'plugins'.
  • Cross-slice coupling: agent → studio REDACTED:114 — `stepLabel` (slice 'agent') depends on `formatLabel` from slice 'studio'.
  • Cross-slice coupling: chat → agent surfsense_local/frontend/src/features/chat/api.ts:68 — `MessageContent` (slice 'chat') depends on `AgentStep` from slice 'agent'.
  • Cross-slice coupling: chat → agent surfsense_local/frontend/src/features/chat/api.ts:70 — `MessageContent` (slice 'chat') depends on `TurnSources` from slice 'agent'.
  • Cross-slice coupling: chat → agent surfsense_local/frontend/src/features/chat/api.ts:81 — `MessageContent` (slice 'chat') depends on `UnavailablePlugin` from slice 'agent'.
  • Cross-slice coupling: chat → sources surfsense_local/frontend/src/features/chat/api.ts:161 — `streamMessage` (slice 'chat') depends on `SourceScope` from slice 'sources'.
  • Cross-slice coupling: chat → models surfsense_local/frontend/src/features/chat/chat-composer.tsx:32 — `ModelControl` (slice 'chat') depends on `ModelSelection` from slice 'models'.
  • Cross-slice coupling: chat → models surfsense_local/frontend/src/features/chat/chat-composer.tsx:193 — `ChatComposer` (slice 'chat') depends on `ChatMode` from slice 'models'.
  • Cross-slice coupling: chat → plugins surfsense_local/frontend/src/features/chat/chat-composer.tsx:197 — `ChatComposer` (slice 'chat') depends on `PluginsStart` from slice 'plugins'.
  • Cross-slice coupling: chat → dictation surfsense_local/frontend/src/features/chat/chat-composer.tsx:199 — `ChatComposer` (slice 'chat') depends on `Dictation` from slice 'dictation'.
  • Cross-slice coupling: chat → dictation surfsense_local/frontend/src/features/chat/chat-composer.tsx:212 — `ChatComposer` (slice 'chat') depends on `useDictationKeys` from slice 'dictation'.
  • Cross-slice coupling: chat → dictation surfsense_local/frontend/src/features/chat/chat-composer.tsx:214 — `ChatComposer` (slice 'chat') depends on `useDictationStarted` from slice 'dictation'.
  • Cross-slice coupling: chat → dictation surfsense_local/frontend/src/features/chat/chat-composer.tsx:221 — `ChatComposer` (slice 'chat') depends on `MicButton` from slice 'dictation'.
  • Cross-slice coupling: chat → dictation surfsense_local/frontend/src/features/chat/chat-composer.tsx:230 — `ChatComposer` (slice 'chat') depends on `DictationStrip` from slice 'dictation'.
  • Cross-slice coupling: chat → plugins surfsense_local/frontend/src/features/chat/chat-composer.tsx:282 — `ChatComposer` (slice 'chat') depends on `PluginMentions` from slice 'plugins'.
  • Cross-slice coupling: chat → sources surfsense_local/frontend/src/features/chat/citation-panel.tsx:23 — `CitationPanel` (slice 'chat') depends on `getDocumentByChunk` from slice 'sources'.
  • Cross-slice coupling: chat → plugins surfsense_local/frontend/src/features/chat/composer-add-menu.tsx:55 — `ComposerAddMenu` (slice 'chat') depends on `PluginsStart` from slice 'plugins'.
  • + 15 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×40
  • No test reaches this file www/app/(home)/privacy/page.tsx:1 — 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.
  • No test reaches this file www/app/(home)/terms/page.tsx:1 — 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.
  • No test reaches this file www/app/(home)/mcp-server/page.tsx:1 — 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.
  • No test reaches this file www/app/(home)/free/[model_slug]/page.tsx:1 — 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.
  • No test reaches this file www/app/(home)/_home/home-formats/file-card-collections.tsx:1 — 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.
  • No test reaches this file www/app/(home)/external-mcp-connectors/page.tsx:1 — 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.
  • No test reaches this file www/app/(home)/free/page.tsx:1 — 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.
  • No test reaches this file www/app/(home)/mcp-server/clients.ts:1 — 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.
  • No test reaches this file www/app/(home)/private-ai-for-business/page.tsx:1 — 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.
  • No test reaches this file www/app/(home)/_home/home-pillars/previews/mac-os-dock.tsx:1 — 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.
  • No test reaches this file www/app/(home)/_home/home-content.ts:1 — 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.
  • No test reaches this file www/features/license/license-forms.tsx:1 — 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.
  • No test reaches this file surfsense_local/frontend/src/components/ui/stepper.tsx:1 — 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.
  • No test reaches this file www/app/(home)/pricing/individual/individual-sections.tsx:1 — 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.
  • No test reaches this file www/app/(home)/pricing/pricing-content.ts:1 — 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.
  • No test reaches this file www/app/(home)/free/free-models.ts:1 — 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.
  • No test reaches this file www/app/(home)/license/activate/page.tsx:1 — 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.
  • No test reaches this file www/app/(home)/pricing/pricing-sections.tsx:1 — 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.
  • No test reaches this file www/app/(home)/contact/contact-sections.tsx:1 — 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.
  • No test reaches this file surfsense_local/electron/src/preload/index.ts:1 — 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.
  • No test reaches this file www/app/(home)/blog/[slug]/page.tsx:1 — 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.
  • No test reaches this file www/app/(home)/plugins/plugin-browser.tsx:1 — 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.
  • No test reaches this file surfsense_local/runtimes/audiocpp/stage.mjs:1 — 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.
  • No test reaches this file www/app/(home)/announcements/[slug]/page.tsx:1 — 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.
  • No test reaches this file www/components/ui/icons.tsx:1 — 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.
  • + 15 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×38
  • Swallowed exception (empty catch) www/instrumentation-client.ts:63 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) www/instrumentation.ts:26 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) www/instrumentation.ts:33 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) www/features/funnel-attribution/funnel-events.ts:30 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) www/features/celebration/celebrate-once.ts:24 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) www/features/celebration/confetti-burst.ts:29 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) www/features/analytics/referral-landing.ts:12 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) www/features/analytics/PostHogReferral.tsx:26 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) www/app/error.tsx:18 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) www/app/(home)/mcp-server/agent-setup-tabs.tsx:24 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) www/app/(home)/downloads/[platform]/installer-redirect.ts:51 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) www/app/(home)/downloads/[platform]/record-installer-download.ts:43 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:254 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) REDACTED:82 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) surfsense_local/sidecars/supervisor.ts:205 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) surfsense_local/sidecars/watch-audio-models.ts:34 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) surfsense_local/sidecars/watch-generation-preset.ts:40 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) REDACTED:40 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) surfsense_local/sidecars/watch-transcription-models.ts:97 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) surfsense_local/headless/access/host-request.ts:33 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) surfsense_local/headless/access/server.ts:109 — `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
  • Swallowed exception (empty catch) surfsense_local/frontend/src/lib/api.ts:230 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) surfsense_local/frontend/src/features/workspaces/use-workspaces.ts:21 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) surfsense_local/frontend/src/features/workspaces/use-workspaces.ts:31 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) surfsense_local/frontend/src/features/workspaces/workspace-changes.ts:73 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • + 13 more in this group — see findings.md.
R11 · Import Boundaries · Boundary violation [package · ×28
  • Boundary violation [package:relative-cross-package] surfsense_local/electron/scripts/notices/native-components.mjs:13 — surfsense_local/electron/scripts/notices/native-components.mjs:13 reaches into another package with a relative path (../../node_modules/electron/package.json) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/electron/src/main/i18n/locale-prefs.ts:8 — surfsense_local/electron/src/main/i18n/locale-prefs.ts:8 reaches into another package with a relative path (../../../../sidecars/session-log/main-warn.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/electron/src/main/i18n/locale-prefs.ts:9 — surfsense_local/electron/src/main/i18n/locale-prefs.ts:9 reaches into another package with a relative path (../../../../sidecars/session-log/session-log.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] REDACTED:29 — REDACTED:29 reaches into another package with a relative path (../../../sidecars/boot.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] REDACTED:30 — REDACTED:30 reaches into another package with a relative path (../../../sidecars/stop-once.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] REDACTED:31 — REDACTED:31 reaches into another package with a relative path (../../../sidecars/supervisor.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] REDACTED:32 — REDACTED:32 reaches into another package with a relative path (../../../sidecars/types.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] REDACTED:40 — REDACTED:40 reaches into another package with a relative path (../../../sidecars/api-url/announce-api-url.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] REDACTED:46 — REDACTED:46 reaches into another package with a relative path (../../../sidecars/session-log/session-log.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] REDACTED:47 — REDACTED:47 reaches into another package with a relative path (../../../sidecars/session-log/main-warn.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/electron/src/main/privacy-choices/start-privacy-choices.ts:14 — surfsense_local/electron/src/main/privacy-choices/start-privacy-choices.ts:14 reaches into another package with a relative path (../../../../sidecars/session-log/main-warn.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/electron/src/main/privacy-choices/start-privacy-choices.ts:15 — surfsense_local/electron/src/main/privacy-choices/start-privacy-choices.ts:15 reaches into another package with a relative path (../../../../sidecars/session-log/session-log.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/electron/src/main/session-log/session-log-ipc.ts:3 — surfsense_local/electron/src/main/session-log/session-log-ipc.ts:3 reaches into another package with a relative path (../../../../sidecars/session-log/session-log.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/electron/src/main/session-log/updater-log.ts:1 — surfsense_local/electron/src/main/session-log/updater-log.ts:1 reaches into another package with a relative path (../../../../sidecars/session-log/session-log.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/electron/src/main/theme-prefs.ts:6 — surfsense_local/electron/src/main/theme-prefs.ts:6 reaches into another package with a relative path (../../../sidecars/session-log/main-warn.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/electron/src/main/theme-prefs.ts:7 — surfsense_local/electron/src/main/theme-prefs.ts:7 reaches into another package with a relative path (../../../sidecars/session-log/session-log.ts) — import the package by name instead.
  • Boundary violation [package:third-party-deep-import] surfsense_local/electron/src/main/update-feed/latest-manifest.ts:2 — surfsense_local/electron/src/main/update-feed/latest-manifest.ts:2 imports electron-updater/out/providers/Provider.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] surfsense_local/electron/src/main/update-feed/surfsense-feed-provider.ts:2 — surfsense_local/electron/src/main/update-feed/surfsense-feed-provider.ts:2 imports electron-updater/out/providers/Provider.js, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/electron/src/main/window-state.ts:6 — surfsense_local/electron/src/main/window-state.ts:6 reaches into another package with a relative path (../../../sidecars/session-log/main-warn.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/electron/src/main/window-state.ts:7 — surfsense_local/electron/src/main/window-state.ts:7 reaches into another package with a relative path (../../../sidecars/session-log/session-log.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/headless/caddy.ts:5 — surfsense_local/headless/caddy.ts:5 reaches into another package with a relative path (../sidecars/types.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/headless/context-from-env.ts:9 — surfsense_local/headless/context-from-env.ts:9 reaches into another package with a relative path (../sidecars/boot.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/headless/main.ts:12 — surfsense_local/headless/main.ts:12 reaches into another package with a relative path (../sidecars/api-url/announce-api-url.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/headless/main.ts:13 — surfsense_local/headless/main.ts:13 reaches into another package with a relative path (../sidecars/boot.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] surfsense_local/headless/main.ts:14 — surfsense_local/headless/main.ts:14 reaches into another package with a relative path (../sidecars/stop-once.ts) — import the package by name instead.
  • + 3 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×19
  • Repeated repair: surfsense_local/backend/modules/llm/providers/audiocpp/speech.py surfsense_local/backend/modules/llm/providers/audiocpp/speech.py:113 — surfsense_local/backend/modules/llm/providers/audiocpp/speech.py changed 12 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is AudioCppSpeech._wait_for_memory at line 113), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(local): encode the episode in the podcast pipeline, keeping each voice's WAV”; “fix(local): ship lameenc's and LAME's licences with the worker, and encode remote episodes too”; “fix(local): check the packaged voicing as MP3 and encode off the event loop”; “fix(local): stop podcast voicing at the next turn after a cancel”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/modules/llm/providers/audiocpp/speech.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/electron/src/main/updater.ts surfsense_local/electron/src/main/updater.ts:66 — surfsense_local/electron/src/main/updater.ts changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is updater.parseUpdatePrefs at line 66), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(desktop): settle an update check the updater could not run”; “fix(desktop): keep the installed version's own update blockmap on Windows”; “fix(updates): retry a day's automatic check that read no manifest”; “fix(updates): stop sending electron-updater's install ID and install on quit on purpose”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/electron/src/main/updater.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/backend/modules/artifacts/script_documents/service.py surfsense_local/backend/modules/artifacts/script_documents/service.py:49 — surfsense_local/backend/modules/artifacts/script_documents/service.py changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is service.create_script_document at line 49), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(studio): a version whose job cannot be queued fails instead of waiting”; “fix(agent): point a render onto a revised copy or converted PDF at the tool that changes it”; “fix(agent): refuse a same-title render without artifact_id, end the stream on any error, refuse a session lost after a turn, and keep a deleted thread off the instance list”; “fix(studio): leave Studio's Word and PDF to Studio, and let Huey retry a Studio script that fails”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/modules/artifacts/script_documents/service.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/backend/modules/llm/subscriptions/chatgpt/flows.py surfsense_local/backend/modules/llm/subscriptions/chatgpt/flows.py:228 — surfsense_local/backend/modules/llm/subscriptions/chatgpt/flows.py changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is flows._tokens at line 228), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(local): ChatGPT sign-ins take the container's port one at a time”; “fix(local): a new ChatGPT sign-in in the container replaces one waiting”; “fix(local): revoke only another client's tokens on signing in again, after signed_in”; “fix(local): revoke the grant a ChatGPT sign-in replaces”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/modules/llm/subscriptions/chatgpt/flows.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/frontend/src/features/sources/web/web-result-row.tsx surfsense_local/frontend/src/features/sources/web/web-result-row.tsx:93 — surfsense_local/frontend/src/features/sources/web/web-result-row.tsx changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is web-result-row.RowAction at line 93), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(local): open a web result's link through the link popup”; “fix(local): lead a web result with its site badge, and set its details apart with dots”; “fix(local): show each web result's whole link, and open it in the browser”; “fix(local): show each list as its own panel and keep Show more in reach”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/features/sources/web/web-result-row.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/backend/modules/artifacts/studio_documents/service.py surfsense_local/backend/modules/artifacts/studio_documents/service.py:36 — surfsense_local/backend/modules/artifacts/studio_documents/service.py changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is service.refinable_spec at line 36), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(studio): a version whose job cannot be queued fails instead of waiting”; “fix(studio): let a refine place only the figures its draft was grounded on”; “fix(studio): keep Refine to Studio's own Word and PDF, count a model on this computer as small, and check a refine's Retry against the window”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/modules/artifacts/studio_documents/service.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/backend/modules/agent/agent_threads/scope_note.py surfsense_local/backend/modules/agent/agent_threads/scope_note.py:46 — surfsense_local/backend/modules/agent/agent_threads/scope_note.py changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is scope_note.scope_note at line 46), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): quote a named source's path with double quotes”; “fix(agent): name a few ticked sources' files in the turn's note”; “fix(agent): tell the agent a ticked folder is still being read, not that nothing is selected”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/modules/agent/agent_threads/scope_note.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/backend/modules/migration/service.py surfsense_local/backend/modules/migration/service.py:160 — surfsense_local/backend/modules/migration/service.py changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is service._import_thread at line 160), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(local): figures passes behind notes and uploads, and no figures for a deleted source”; “fix(import): recognize continued legacy threads”; “fix(import): resume missing chat threads”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/modules/migration/service.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/backend/worker/studio/media/audio/podcast/draft.py surfsense_local/backend/worker/studio/media/audio/podcast/draft.py:102 — surfsense_local/backend/worker/studio/media/audio/podcast/draft.py changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is draft.parse at line 102), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(local): send a podcast segment's whole prompt after the sources”; “fix(local): cap each podcast segment's reply”; “fix(local): show a model the reply it is asked to repair”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/worker/studio/media/audio/podcast/draft.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/headless/access/verify.ts surfsense_local/headless/access/verify.ts:35 — surfsense_local/headless/access/verify.ts changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is verify.verify at line 35), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(docker): sign-in reads paths as Caddy routes them, and counts each guess before checking it”; “fix(docker): the workers' internal routes are refused to every browser”; “fix(docker): a sign-in's callback needs no session”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/headless/access/verify.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/electron/src/main/usage-statistics/usage-reporter.ts surfsense_local/electron/src/main/usage-statistics/usage-reporter.ts:132 — surfsense_local/electron/src/main/usage-statistics/usage-reporter.ts changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is usage-reporter.createUsageReporter.post at line 132), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(usage): resend first-week hardware only when it changed, and stop setup checks once setup is done”; “fix(usage): cap the setup report's tries”; “fix(usage): ask again for consent just before a usage report is posted”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/electron/src/main/usage-statistics/usage-reporter.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/backend/scripts/build_binaries.py surfsense_local/backend/scripts/build_binaries.py:55 — surfsense_local/backend/scripts/build_binaries.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is build_binaries.main at line 55), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(desktop): keep a Linux library unstripped when strip would misalign it”; “fix(desktop): strip Linux symbols around the libraries auditwheel rewrote”; “fix(local): fail Mac freezes that cannot load sqlite-vec”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/scripts/build_binaries.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/backend/modules/llm/subscriptions/claude/run.py surfsense_local/backend/modules/llm/subscriptions/claude/run.py:53 — surfsense_local/backend/modules/llm/subscriptions/claude/run.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is _SdkRun.send at line 53), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(local): close more Claude plan gaps and say above the composer when the plan is on extra usage”; “fix(local): close three Claude plan gaps and delete every engine's session with its thread”; “fix(local): a Claude plan turn names a plugin unavailable only once Claude Code has tried it”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/modules/llm/subscriptions/claude/run.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/backend/modules/artifacts/studio_documents/recipe.py surfsense_local/backend/modules/artifacts/studio_documents/recipe.py:40 — surfsense_local/backend/modules/artifacts/studio_documents/recipe.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is recipe.refinement at line 40), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(studio): retry a converted PDF without a chat model or sources”; “fix(studio): let a refine place only the figures its draft was grounded on”; “fix(studio): keep Refine to Studio's own Word and PDF, count a model on this computer as small, and check a refine's Retry against the window”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/modules/artifacts/studio_documents/recipe.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/backend/modules/llm/fit/copy.py surfsense_local/backend/modules/llm/fit/copy.py:53 — surfsense_local/backend/modules/llm/fit/copy.py changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is copy.badge at line 53), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(llm): stop the star and the fit badge from disagreeing”; “fix(llm): make the recommendation star and the badge read one classification”; “fix(fit): split residency from refusal so a CPU-only machine is judged right”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/modules/llm/fit/copy.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/frontend/src/components/ui/sonner.tsx surfsense_local/frontend/src/components/ui/sonner.tsx:6 — surfsense_local/frontend/src/components/ui/sonner.tsx changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is sonner.Toaster at line 6), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(local): a nested dialog blocks the dialog under it”; “fix(local): enable rich toast colors and drop raw errors from artifact-failure toasts”; “fix(toaster): update success icon size in Toaster component”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/frontend/src/components/ui/sonner.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/backend/modules/llm/providers/episode_audio/encoded_episode.py surfsense_local/backend/modules/llm/providers/episode_audio/encoded_episode.py:20 — surfsense_local/backend/modules/llm/providers/episode_audio/encoded_episode.py changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is encoded_episode.encoded_episode at line 20), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(local): encode the episode in the podcast pipeline, keeping each voice's WAV”; “fix(local): keep an episode as WAV when its MP3 encode fails”; “fix(local): ship lameenc's and LAME's licences with the worker, and encode remote episodes too”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/modules/llm/providers/episode_audio/encoded_episode.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/electron/scripts/notices/merge.mjs surfsense_local/electron/scripts/notices/merge.mjs:38 — surfsense_local/electron/scripts/notices/merge.mjs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is merge.mergeNotices at line 38), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(local): write the notices to resources/licenses and carry OpenMP's licence on Windows”; “fix(local): keep Python NOTICE files apart from licence text and pin each exception to its version”; “fix(local): require real licence text from NOTICE files, native runtimes and CPython”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/electron/scripts/notices/merge.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: surfsense_local/backend/modules/agent/tool_endpoint/read_workbook.py surfsense_local/backend/modules/agent/tool_endpoint/read_workbook.py:53 — surfsense_local/backend/modules/agent/tool_endpoint/read_workbook.py changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is read_workbook.workbook_cells at line 53), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(agent): read a revised copy as it reads now, with its changes and comments”; “fix(agent): read a workbook's cells without holding the write lock”; “fix(agent): keep a workbook's cell map within its cap and readable on”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-05..2026-11-03, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-05 21:37:56 +05:30' --until='2026-11-03 21:37:56 +05:30' --full-history --no-merges -- surfsense_local/backend/modules/agent/tool_endpoint/read_workbook.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D30 · Dependency Vulnerabilities · Medium CVE · ×16
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · FileTooLong · ×15
  • FileTooLong: data/parse.py plans/community-local/seo/data/parse.py — FileTooLong — 903 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 403 over it, 1.81× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: web_crawl/connector.py backend/plugins/proprietary/web_crawl/connector.py — FileTooLong — 862 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 362 over it, 1.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: chat/use-chat-runtime.ts surfsense_local/frontend/src/features/chat/use-chat-runtime.ts — FileTooLong — 716 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: useChatRuntime (220-1010). The bar is 500 significant lines; this is 216 over it, 1.43× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: dashboard/dashboard-page.tsx surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx — FileTooLong — 714 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 214 over it, 1.43× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 662 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 162 over it, 1.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: studio/artifact-list.tsx surfsense_local/frontend/src/features/studio/artifact-list.tsx — FileTooLong — 652 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 152 over it, 1.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: youtube/parsers.py backend/plugins/proprietary/youtube/parsers.py — FileTooLong — 618 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 118 over it, 1.24× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: amazon/parsers.py backend/plugins/proprietary/amazon/parsers.py — FileTooLong — 546 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 46 over it, 1.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: amazon/scraper.py backend/plugins/proprietary/amazon/scraper.py — FileTooLong — 545 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 45 over it, 1.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: google_maps/fetch.py backend/plugins/proprietary/google_maps/fetch.py — FileTooLong — 543 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 43 over it, 1.09× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: scraping/browser_pool.py backend/plugins/proprietary/scraping/browser_pool.py — FileTooLong — 541 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 41 over it, 1.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: google_search/fetch.py backend/plugins/proprietary/google_search/fetch.py — FileTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 38 over it, 1.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: chat/chats-dialog.tsx surfsense_local/frontend/src/features/chat/chats-dialog.tsx — FileTooLong — 524 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 24 over it, 1.05× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: sources/sources-panel.tsx surfsense_local/frontend/src/features/sources/sources-panel.tsx — FileTooLong — 519 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: SourcesPanel (79-616). The bar is 500 significant lines; this is 19 over it, 1.04× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: amazon/fetch.py backend/plugins/proprietary/amazon/fetch.py — FileTooLong — 518 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 18 over it, 1.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
X2 · Cancellation propagation · Async function without AbortSignal · ×13
  • Async function without AbortSignal: postJson www/features/license/license-forms.tsx:46 — `postJson` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getReleaseAssets www/features/downloads/release-assets.ts:33 — `getReleaseAssets` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getStarCount www/components/site/github-stars.ts:32 — `getStarCount` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: registryPlugins www/app/(home)/plugins/registry-plugins.ts:13 — `registryPlugins` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getPublishedInstallers www/app/(home)/downloads/[platform]/published-installers.ts:29 — `getPublishedInstallers` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: reconcile REDACTED:24 — `reconcile` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: download surfsense_local/runtimes/fetch-llamacpp.mjs:111 — `download` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: download surfsense_local/runtimes/pinned-download.mjs:13 — `download` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: queryFn surfsense_local/frontend/src/features/studio/viewers/html-viewer.tsx:26 — `queryFn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: queryFn surfsense_local/frontend/src/features/studio/viewers/xlsx-viewer.tsx:108 — `queryFn` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: layOutSnapshot surfsense_local/frontend/src/features/docx-snapshot/snapshot-page.ts:26 — `layOutSnapshot` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getAccessState surfsense_local/frontend/src/features/access/api.ts:36 — `getAccessState` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: captureWebPage surfsense_local/electron/src/main/docx-snapshot/capture-web-page.ts:18 — `captureWebPage` holds an AbortSignal but calls `wait(…)` without it, so its caller's cancellation never reaches that call and it runs to its end after whatever wanted it has given up. Hand the signal on: `wait(…, { signal })`.
D29 · Static Analysis (SAST) · REDACTED · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×11
  • Animation without a prefers-reduced-motion guard surfsense_local/frontend/src/features/models/local/chat/build-action.tsx:81 — <span> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard surfsense_local/frontend/src/features/models/local/chat/install-progress.tsx:43 — <span> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard www/components/ui/spinner.tsx:22 — <output> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard www/app/(home)/home.css:330 — `.ss-home-nav-drawer` moves (`transition: opacity 150ms ease-out, translate 150ms ease-out, visibility 0s linear 150ms`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard www/app/(home)/home.css:349 — `.ss-home-nav-drawer[data-state="open"]` moves (`transition: opacity 220ms cubic-bezier(0.2, 0, 0, 1), translate 220ms cubic-bezier(0.2, 0, 0, 1), visibility 0s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard www/app/(home)/home.css:422 — `.ss-home-faq::details-content` moves (`transition: height 260ms cubic-bezier(0.4, 0, 0.2, 1), opacity 200ms ease-out, content-visibility 260ms allow-discrete`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard www/app/(home)/home.css:447 — `.ss-home-faq-marker` moves (`transition: transform 150ms ease-out`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard www/app/(home)/home.css:499 — `[data-dio="obj"]` moves (`transition: opacity 300ms ease-out, transform 300ms cubic-bezier(0.2, 0, 0, 1)`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard surfsense_local/frontend/src/index.css:544 — `.ss-thinking-dot-a` moves (`animation-name: ss-thinking-pair-a`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard surfsense_local/frontend/src/index.css:548 — `.ss-thinking-dot-b` moves (`animation-name: ss-thinking-pair-b`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard surfsense_local/frontend/src/index.css:552 — `.ss-thinking-dot-c` moves (`animation-name: ss-thinking-pair-c`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D35 · Change Coupling · Change coupling · ×10
  • Change coupling: REDACTED ↔ REDACTED REDACTED:1 — `REDACTED` and `surfsense_local/electron/src/preload/index.ts` change together 85% of the time (11 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `9364fbc9` feat(privacy): wire update checks, usage reports and window.surfsense…; `e5952208` feat(local): show where SurfSense keeps its data in Settings › About; `f8e5ba0a` feat(microphone): grant the mic to the app's own page, and bridge the… — run `git show` on any of them.
  • Change coupling: page.tsx ↔ page.tsx www/app/(home)/free/[model_slug]/page.tsx:1 — `www/app/(home)/free/[model_slug]/page.tsx` and `www/app/(home)/free/page.tsx` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `47d2ab43` fix(www): serve the homepage in the site design before hydration; `61f51e1d` feat(homepage): draw the air gap as a scroll-driven isometric diorama (at that commit the files were still `surfsense_web/app/(home)/free/[model_slug]/page.tsx` and `surfsense_web/app/(home)/free/page.tsx`); `f5d04cf8` refactor(web): support same-origin backend and zero urls (at that commit the files were still `surfsense_web/app/(home)/free/[model_slug]/page.tsx` and `surfsense_web/app/(home)/free/page.tsx`) — run `git show` on any of them.
  • Change coupling: sources-panel.tsx ↔ use-sources.ts surfsense_local/frontend/src/features/sources/sources-panel.tsx:1 — `surfsense_local/frontend/src/features/sources/sources-panel.tsx` and `surfsense_local/frontend/src/features/sources/use-sources.ts` change together 61% of the time (11 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `564a9b33` feat(local): drop files onto the sources panel, newest first; `c92f035b` feat(sources-ui): translate sources, the dashboard and cloud import; `a581105e` feat(ui): cancel running sources and artifacts from the row menu — run `git show` on any of them.
  • Change coupling: api.ts ↔ dashboard-page.tsx surfsense_local/frontend/src/features/chat/api.ts:1 — `surfsense_local/frontend/src/features/chat/api.ts` and `surfsense_local/frontend/src/features/dashboard/dashboard-page.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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `57aa9af3` fix(chat): remember a chat mode only when the user picks it, per model; `dfe9b940` feat(local): add a switch to turn thinking off for chat answers; `1dad2dc0` feat(agent): show the agent's steps and ask before it runs a command — run `git show` on any of them.
  • Change coupling: home-content.ts ↔ home-sections.tsx www/app/(home)/_home/home-content.ts:1 — `www/app/(home)/_home/home-content.ts` and `www/app/(home)/_home/home-sections.tsx` change together 59% of the time (13 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `ae5486ce` feat(homepage): turn "Why it is different" into three preview cards (at that commit the files were still `surfsense_web/components/homepage/home/home-content.ts` and `surfsense_web/components/homepage/home/home-sections.tsx`); `57fd2722` feat(homepage): label the on-your-machine section as how it works (at that commit the files were still `surfsense_web/components/homepage/home/home-content.ts` and `surfsense_web/components/homepage/home/home-sections.tsx`); `56845fa6` feat(homepage): redesign the comparison as a card with a raised SurfS… (at that commit the files were still `surfsense_web/components/homepage/home/home-content.ts` and `surfsense_web/components/homepage/home/home-sections.tsx`) — run `git show` on any of them.
  • Change coupling: REDACTED ↔ python.ts REDACTED:1 — `REDACTED` and `surfsense_local/sidecars/python.ts` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `d180f03b` feat(desktop): point opencode's proxy at the API's plugin proxy (at that commit the file was still `surfsense_local/electron/src/main/sidecars/python.ts`); `0b275401` fix(agent): let only Electron answer Word snapshots, and show Word fi… (at that commit the file was still `surfsense_local/electron/src/main/sidecars/python.ts`); `345ac0ea` feat(local): give the Studio worker audio.cpp's address (at that commit the file was still `surfsense_local/electron/src/main/sidecars/python.ts`) — run `git show` on any of them.
  • Change coupling: artifact-list.tsx ↔ studio-panel.tsx surfsense_local/frontend/src/features/studio/artifact-list.tsx:1 — `surfsense_local/frontend/src/features/studio/artifact-list.tsx` and `surfsense_local/frontend/src/features/studio/studio-panel.tsx` change together 50% of the time (14 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `a7c57dae` refactor(local): every button is the shared Button, with one press mo…; `2f8db1bf` perf(local): render Studio and its artifact rows only when they change; `d6925c46` feat(local): show a cut-off source or artifact name in full on hover — run `git show` on any of them.
  • Change coupling: sources-panel.tsx ↔ artifact-list.tsx surfsense_local/frontend/src/features/sources/sources-panel.tsx:1 — `surfsense_local/frontend/src/features/sources/sources-panel.tsx` and `surfsense_local/frontend/src/features/studio/artifact-list.tsx` change together 50% of the time (14 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `c94a08de` feat(sources): replace the selection count with Select all / Clear; `6a15f59f` refactor(local-ui): replace the JS scroll shadow with shadcn scroll-fade; `66b6cab7` feat(ui): extract podcast form's native select into a shared componen… — run `git show` on any of them.
  • Change coupling: REDACTED ↔ sse.ts REDACTED:1 — `REDACTED` and `surfsense_local/frontend/src/features/chat/sse.ts` 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, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `c1741c82` feat(local): show how far the model has read a long prompt; `e89a1640` Rewrite chat citations as [n] and open the cited chunk in a panel.; `6798dfaf` feat(chat): add completion timestamp to chat messages — run `git show` on any of them.
  • Change coupling: api.ts ↔ main.tsx surfsense_local/frontend/src/lib/api.ts:1 — `surfsense_local/frontend/src/lib/api.ts` and `surfsense_local/frontend/src/main.tsx` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `1a9ad18c` fix(desktop): report sidecar crashes; `fa972030` feat(local): add Help and Check for Updates… to the macOS menu; `ee55a486` frontend: ask before the first call to a destination — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×10
  • Edited copy of a member (4 corresponding lines) surfsense_local/backend/modules/artifacts/revised_copies/engines/package.py:81 — surfsense_local/backend/modules/artifacts/revised_copies/engines/package.py:81-84 | surfsense_local/backend/modules/artifacts/revised_copies/engines/powerpoint_slides.py:286-289 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) surfsense_local/backend/modules/llm/catalog/local/install/tickets.py:60 — surfsense_local/backend/modules/llm/catalog/local/install/tickets.py:60-63 | surfsense_local/backend/modules/llm/catalog/local/search_cache.py:59-62 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) backend/plugins/proprietary/amazon/scraper.py:115 — backend/plugins/proprietary/amazon/scraper.py:115-118 | backend/plugins/proprietary/walmart/scraper.py:91-94 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) surfsense_local/backend/modules/artifacts/image_edits/recipe.py:30 — surfsense_local/backend/modules/artifacts/image_edits/recipe.py:30-33 | surfsense_local/backend/modules/artifacts/studio_documents/recipe.py:41-44 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) backend/plugins/proprietary/google_maps/server.py:226 — backend/plugins/proprietary/google_maps/server.py:226-229 | backend/plugins/proprietary/walmart/server.py:205-211 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) backend/plugins/proprietary/instagram/fetch.py:279 — backend/plugins/proprietary/instagram/fetch.py:279-282 | backend/plugins/proprietary/reddit/fetch.py:282-285 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) surfsense_local/backend/modules/llm/subscriptions/chatgpt/router.py:27 — surfsense_local/backend/modules/llm/subscriptions/chatgpt/router.py:27-30 | surfsense_local/backend/modules/plugins/remote/sign_in/oauth/start_sign_in.py:48-51 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) surfsense_local/backend/worker/ingestion/audio/plan_file.py:23 — surfsense_local/backend/worker/ingestion/audio/plan_file.py:23-35 | surfsense_local/backend/worker/ingestion/docling_batches/checkpoint.py:109-112 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) surfsense_local/backend/worker/studio/content/flashcards/pipeline.py:18 — surfsense_local/backend/worker/studio/content/flashcards/pipeline.py:18-21 | surfsense_local/backend/worker/studio/content/quiz/pipeline.py:18-21 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) surfsense_local/backend/modules/llm/catalog/local/install_jobs/router.py:118 — surfsense_local/backend/modules/llm/catalog/local/install_jobs/router.py:118-121 | surfsense_local/backend/modules/llm/router.py:325-330 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D31 · IaC & Container Security · Medium IaC · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×7
  • Recursive walk over a caller-supplied document has no depth cap surfsense_local/backend/worker/ingestion/word_markdown/inline.py:98 — `inline_text` is public, takes a document from its caller (line 56) and hands it to `_content`, which calls itself at line 98 (`_content`) with a piece of `container` (and at line 102, line 106) — and nowhere in `_content` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_content` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap surfsense_local/backend/worker/ingestion/word_markdown/inline.py:142 — `inline_text` is public, takes a document from its caller (line 56) and hands it to `_base_runs`, which calls itself at line 142 (`_base_runs`) with a piece of `base` — and nowhere in `_base_runs` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_base_runs` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap surfsense_local/backend/worker/ingestion/word_markdown/tables.py:78 — `rows_of` is public, takes a document from its caller (line 30) and hands it to `_wrapped`, which calls itself at line 78 (`_wrapped`) with a piece of `parent` (and at line 80) — and nowhere in `_wrapped` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_wrapped` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap surfsense_local/backend/scripts/opencv/record_calls.py:57 — `put` is public and takes `value: object` from its caller, and it calls itself at line 57 (`put`) with a piece of `value` — and nowhere in `put` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `put` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap surfsense_local/backend/modules/agent/agent_threads/steps.py:92 — `step_of` is public, takes a document from its caller (line 40) and hands it to `_shown`, which calls itself at line 92 (`_shown`) with a piece of `value` (and at line 97) — and nowhere in `_shown` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_shown` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap backend/plugins/proprietary/youtube/parsers.py:33 — `find_all` is public, takes a document from its caller (line 24) and hands it to `_walk`, which calls itself at line 33 (`_walk`) with a piece of `node` (and at line 36) — and nowhere in `_walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap backend/plugins/proprietary/youtube/parsers.py:50 — `find_first` is public, takes a document from its caller (line 61) and hands it to `_first`, which calls itself at line 50 (`_first`) with a piece of `node` (and at line 55) — and nowhere in `_first` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_first` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×6
  • Edited copy of a member (7 corresponding lines) backend/plugins/proprietary/google_search/parsers.py:403 — backend/plugins/proprietary/google_search/parsers.py:403-410 | backend/plugins/proprietary/google_search/parsers.py:647-653 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) surfsense_local/backend/modules/runtime_packs/office/soffice/convert.py:134 — surfsense_local/backend/modules/runtime_packs/office/soffice/convert.py:134-141 | surfsense_local/backend/worker/document_script/run.py:156-162 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) plans/community-local/seo/data/b2b-oct/rollup.py:70 — plans/community-local/seo/data/b2b-oct/rollup.py:70-76 | plans/community-local/seo/data/b2b/rollup.py:43-50 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) surfsense_local/backend/modules/llm/connections/router.py:138 — surfsense_local/backend/modules/llm/connections/router.py:138-144 | surfsense_local/backend/modules/llm/resolution.py:228-236 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) surfsense_local/backend/modules/agent/plugin_tools/changed_tools.py:132 — surfsense_local/backend/modules/agent/plugin_tools/changed_tools.py:132-139 | surfsense_local/backend/modules/plugins/remote/sign_in/oauth/listed_after_refresh.py:17-23 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) surfsense_local/backend/modules/plugins/installed/disconnect.py:15 — surfsense_local/backend/modules/plugins/installed/disconnect.py:15-22 | surfsense_local/backend/modules/plugins/installed/plugin_switch.py:11-17 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×5
  • Duplicated block (7 lines × 2) backend/plugins/proprietary/google_maps/server.py:119 — backend/plugins/proprietary/google_maps/server.py:119-125 | backend/plugins/proprietary/google_maps/server.py:193-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) backend/plugins/proprietary/google_search/parsers.py:404 — backend/plugins/proprietary/google_search/parsers.py:404-410 | backend/plugins/proprietary/google_search/parsers.py:647-653 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 2) backend/plugins/proprietary/walmart/server.py:112 — backend/plugins/proprietary/walmart/server.py:112-118 | backend/plugins/proprietary/walmart/server.py:174-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) surfsense_local/backend/modules/artifacts/revised_copies/engines/package.py:233 — surfsense_local/backend/modules/artifacts/revised_copies/engines/package.py:233-239 | surfsense_local/backend/modules/artifacts/revised_copies/engines/powerpoint_slides.py:191-197 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) surfsense_local/backend/modules/chat/errors.py:200 — surfsense_local/backend/modules/chat/errors.py:200-206 | surfsense_local/backend/modules/llm/providers/llamacpp/router_client.py:145-156 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
AC6 · Visual & motion safety · Focus outline removed inline · ×4
  • Focus outline removed inline surfsense_local/frontend/src/components/ui/resize-handle.tsx:94 — <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline surfsense_local/frontend/src/components/ui/select.tsx:11 — <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline surfsense_local/frontend/src/components/ui/textarea.tsx:6 — <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline www/features/license/license-forms.tsx:74 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×4
  • Edited copy of a member (8 corresponding lines) plans/community-local/seo/data/b2b-oct/rollup.py:59 — plans/community-local/seo/data/b2b-oct/rollup.py:59-66 | plans/community-local/seo/data/b2b/rollup.py:32-39 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) surfsense_local/backend/worker/ingestion/figures/pictures_reading.py:75 — surfsense_local/backend/worker/ingestion/figures/pictures_reading.py:75-82 | surfsense_local/backend/worker/ingestion/figures/pictures_reading.py:85-94 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) backend/plugins/registry/check/registry_check/live/server_contact.py:90 — backend/plugins/registry/check/registry_check/live/server_contact.py:90-97 | surfsense_local/backend/modules/plugins/remote/mcp_client/session.py:124-134 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) surfsense_local/backend/modules/chat/errors.py:200 — surfsense_local/backend/modules/chat/errors.py:200-207 | surfsense_local/backend/modules/llm/providers/llamacpp/router_client.py:145-157 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×4
  • Edited copy of a member (11 corresponding lines) surfsense_local/backend/modules/embedding/fp32_upcast.py:71 — surfsense_local/backend/modules/embedding/fp32_upcast.py:71-83 | surfsense_local/backend/modules/embedding/fp32_upcast.py:170-180 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) backend/plugins/proprietary/tiktok/session/listing.py:437 — backend/plugins/proprietary/tiktok/session/listing.py:437-455 | backend/plugins/proprietary/web_crawl/connector.py:425-435 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) surfsense_local/backend/modules/llm/catalog/local/engines/llamacpp/support.py:39 — surfsense_local/backend/modules/llm/catalog/local/engines/llamacpp/support.py:39-52 | surfsense_local/backend/modules/llm/catalog/local/engines/llamacpp/support.py:58-68 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) surfsense_local/backend/worker/audio_decode/child.py:24 — surfsense_local/backend/worker/audio_decode/child.py:24-34 | surfsense_local/backend/worker/document_script/child.py:33-45 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×4
  • Duplicated block (5 lines × 2) backend/plugins/proprietary/google_search/server.py:131 — backend/plugins/proprietary/google_search/server.py:131-135 | backend/plugins/proprietary/web_crawl/server.py:176-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.
  • Duplicated block (5 lines × 2) plans/community-local/seo/data/b2b-oct/rollup.py:353 — plans/community-local/seo/data/b2b-oct/rollup.py:353-357 | plans/community-local/seo/data/b2b/rollup.py:249-253 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `plans/community-local/seo/data/b2b-oct/rollup.py:352` calls `add_argument` and `plans/community-local/seo/data/b2b/rollup.py:248` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) backend/plugins/proprietary/instagram/fetch.py:293 — backend/plugins/proprietary/instagram/fetch.py:293-297 | backend/plugins/proprietary/reddit/fetch.py:300-304 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) surfsense_local/backend/modules/llm/providers/llamacpp/download.py:84 — surfsense_local/backend/modules/llm/providers/llamacpp/download.py:84-88 | surfsense_local/backend/modules/runtime_packs/office/download.py:120-124 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×4
  • Duplicated block (6 lines × 2) backend/plugins/proprietary/tiktok/extraction/comments.py:27 — backend/plugins/proprietary/tiktok/extraction/comments.py:27-32 | backend/plugins/proprietary/tiktok/extraction/user_search.py:32-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) backend/plugins/proprietary/tiktok/server.py:268 — backend/plugins/proprietary/tiktok/server.py:268-273 | backend/plugins/proprietary/youtube/server.py:192-197 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) surfsense_local/backend/modules/artifacts/flashcard_progress.py:80 — surfsense_local/backend/modules/artifacts/flashcard_progress.py:80-85 | surfsense_local/backend/modules/artifacts/quiz_progress.py:113-118 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) plans/community-local/seo/data/b2b-oct/rollup.py:202 — plans/community-local/seo/data/b2b-oct/rollup.py:202-207 | plans/community-local/seo/data/b2b/rollup.py:159-164 — 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.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×4
  • Sync-over-async blocking surfsense_local/runtimes/audiocpp/built-families.mjs:44 — `writeFileSync` in `loadOutput` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking surfsense_local/runtimes/audiocpp/built-families.mjs:75 — `mkdtempSync` in `unprovenFamilies` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking surfsense_local/runtimes/audiocpp/built-families.mjs:77 — `writeFileSync` in `unprovenFamilies` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking surfsense_local/runtimes/audiocpp/built-families.mjs:86 — `rmSync` in `unprovenFamilies` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
D10 · Test Quality · No assertions · ×3
  • No assertions: keeps restarting crashes spread wider than 5 minutes surfsense_local/sidecars/watch-transcription-models.test.ts:249 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: electron-builder accepts the whole configuration surfsense_local/electron/scripts/mac-dmg.test.mjs:22 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: a build made with opencode off is not checked, since it carries none surfsense_local/electron/scripts/opencode/after-sign.test.mjs:31 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D10 · Test Quality · Fixed-sleep synchronisation · ×3
  • Fixed-sleep synchronisation: a second signal while stopping waits for every child instead of leaving them running surfsense_local/headless/main.test.ts:204 — This test starts work it did not wait for (`run`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 200))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: ignores a page that answers after the links were opened again surfsense_local/frontend/src/features/sources/web/add-from-web.test.tsx:534 — This test starts work it did not wait for (`user`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 50))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: tells a read that follows a quiet spell without waiting surfsense_local/frontend/src/features/chat/runs/run-store.test.ts:110 — This test starts work it did not wait for (`run`, still running when the sleep starts) and then orders itself against it with `wait(5)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×3
  • Edited copy of a member (5 corresponding lines) plans/community-local/seo/data/parse.py:93 — plans/community-local/seo/data/parse.py:93-101 | plans/community-local/seo/data/parse.py:568-572 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) backend/plugins/proprietary/indeed/parsers.py:163 — backend/plugins/proprietary/indeed/parsers.py:163-167 | backend/plugins/proprietary/reddit/parsers.py:34-38 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (5 corresponding lines) surfsense_local/backend/modules/artifacts/revised_copies/engines/package.py:170 — surfsense_local/backend/modules/artifacts/revised_copies/engines/package.py:170-175 | surfsense_local/backend/modules/artifacts/revised_copies/engines/powerpoint_slides.py:175-179 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×3
  • Edited copy of a member (13 corresponding lines) surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/builds/in_repo.py:27 — surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/builds/in_repo.py:27-39 | surfsense_local/backend/modules/llm/catalog/local/engines/sdcpp/builds/in_repo.py:20-34 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) surfsense_local/backend/modules/plugins/installed/first_party_plugin.py:15 — surfsense_local/backend/modules/plugins/installed/first_party_plugin.py:15-27 | surfsense_local/backend/modules/plugins/installed/registry_plugin.py:20-35 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) surfsense_local/backend/modules/llm/providers/openai_compatible/chat.py:228 — surfsense_local/backend/modules/llm/providers/openai_compatible/chat.py:228-243 | surfsense_local/backend/modules/llm/providers/openai_responses/input_items.py:16-28 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (2 corresponding lines) · ×3
  • Edited copy of a member (2 corresponding lines) surfsense_local/backend/modules/plugins/installed/plugin_hosts.py:13 — surfsense_local/backend/modules/plugins/installed/plugin_hosts.py:13-15 | surfsense_local/backend/modules/plugins/remote/sign_in/oauth/start_sign_in.py:178-179 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) surfsense_local/backend/scripts/chat_eval/summary.py:57 — surfsense_local/backend/scripts/chat_eval/summary.py:57-58 | surfsense_local/backend/scripts/retrieval_eval/summary.py:8-9 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) backend/plugins/proprietary/google_maps/parsers.py:96 — backend/plugins/proprietary/google_maps/parsers.py:96-97 | surfsense_local/backend/modules/llm/voices/saved.py:14-19 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×3
  • Duplicated block (12 lines × 2) backend/plugins/proprietary/indeed/server.py:129 — backend/plugins/proprietary/indeed/server.py:129-140 | backend/plugins/proprietary/reddit/server.py:134-145 — 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) backend/plugins/proprietary/google_search/server.py:45 — backend/plugins/proprietary/google_search/server.py:45-56 | backend/plugins/proprietary/tiktok/server.py:44-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `backend/plugins/proprietary/tiktok/server.py:37` calls `getLogger` and `backend/plugins/proprietary/google_search/server.py:38` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) surfsense_local/backend/modules/llm/providers/llamacpp/provider.py:231 — surfsense_local/backend/modules/llm/providers/llamacpp/provider.py:231-242 | surfsense_local/backend/modules/llm/providers/openai_compatible/chat.py:136-147 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×3
  • Duplicated block (10 lines × 2) surfsense_local/backend/alembic/versions/0001_initial_schema.py:104 — surfsense_local/backend/alembic/versions/0001_initial_schema.py:104-113 | surfsense_local/backend/alembic/versions/0001_initial_schema.py:151-160 — both copies are in the same file, so extract the 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 `surfsense_local/backend/alembic/versions/0001_initial_schema.py:104` 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) surfsense_local/backend/modules/agent/tool_endpoint/convert_document.py:130 — surfsense_local/backend/modules/agent/tool_endpoint/convert_document.py:130-139 | surfsense_local/backend/modules/agent/tool_endpoint/revise_document.py:225-234 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/rows/lead_build.py:14 — surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/rows/lead_build.py:14-23 | surfsense_local/backend/modules/llm/catalog/local/engines/sdcpp/rows/lead_build.py:14-23 — before extracting anything, compare `surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/rows/lead_build.py` and `surfsense_local/backend/modules/llm/catalog/local/engines/sdcpp/rows/lead_build.py` as WHOLE FILES: 94% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×3
  • Duplicated block (9 lines × 2) backend/plugins/registry/check/registry_check/live/oauth_findings.py:95 — backend/plugins/registry/check/registry_check/live/oauth_findings.py:95-103 | surfsense_local/backend/modules/plugins/remote/sign_in/oauth/registration_offer.py:40-48 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `backend/plugins/registry/check/registry_check/live/oauth_findings.py:104` calls `_issuer_metadata` and `surfsense_local/backend/modules/plugins/remote/sign_in/oauth/registration_offer.py:49` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) surfsense_local/backend/modules/documents/web_sources/pullers/amazon.py:113 — surfsense_local/backend/modules/documents/web_sources/pullers/amazon.py:113-121 | surfsense_local/backend/modules/documents/web_sources/pullers/walmart.py:111-119 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) surfsense_local/backend/modules/llm/catalog/local/engines/sdcpp/launch.py:44 — surfsense_local/backend/modules/llm/catalog/local/engines/sdcpp/launch.py:44-52 | surfsense_local/backend/modules/llm/catalog/local/engines/sdcpp/launch.py:66-74 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×3
  • Duplicated block (5 lines × 3) surfsense_local/backend/alembic/versions/0001_initial_schema.py:82 — surfsense_local/backend/alembic/versions/0001_initial_schema.py:82-86 | surfsense_local/backend/alembic/versions/0020_plugin_runs.py:24-28 | surfsense_local/backend/alembic/versions/0032_agent_thread_engine.py:38-42 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `surfsense_local/backend/alembic/versions/0001_initial_schema.py:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `surfsense_local/backend/alembic/versions/0020_plugin_runs.py:29` calls `Column`, `String`, `JSON` and `surfsense_local/backend/alembic/versions/0001_initial_schema.py:87` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 3) surfsense_local/backend/modules/artifacts/revised_copies/source_file.py:52 — surfsense_local/backend/modules/artifacts/revised_copies/source_file.py:52-56 | surfsense_local/backend/scripts/fetch_embedding_model.py:42-46 | surfsense_local/backend/scripts/opencv/build_wheel.py:28-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.
  • Duplicated block (5 lines × 3) surfsense_local/backend/modules/llm/providers/audiocpp/speech.py:165 — surfsense_local/backend/modules/llm/providers/audiocpp/speech.py:165-169 | surfsense_local/backend/modules/llm/providers/audiocpp/transcription.py:134-138 | surfsense_local/backend/modules/llm/providers/openai_compatible/speech.py:110-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. 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×3
  • Outbound HTTP without resilience surfsense_local/backend/modules/llm/catalog/local/engines/llamacpp/engine.py:143 — `httpx.AsyncClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience surfsense_local/backend/modules/llm/catalog/local/engines/llamacpp/engine.py:202 — `httpx.AsyncClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience surfsense_local/backend/modules/llm/catalog/local/engines/llamacpp/engine.py:209 — `httpx.AsyncClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×2
  • Edited copy of a member (20 corresponding lines) plans/community-local/seo/data/b2b-oct/rollup.py:190 — plans/community-local/seo/data/b2b-oct/rollup.py:190-215 | plans/community-local/seo/data/b2b/rollup.py:150-169 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) surfsense_local/backend/worker/interrupted_documents.py:13 — surfsense_local/backend/worker/interrupted_documents.py:13-32 | surfsense_local/backend/worker/interrupted_pulls.py:11-33 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×2
  • Edited copy of a member (21 corresponding lines) surfsense_local/backend/modules/plugins/routes.py:345 — surfsense_local/backend/modules/plugins/routes.py:345-365 | surfsense_local/backend/modules/plugins/routes.py:376-405 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (21 corresponding lines) surfsense_local/backend/modules/llm/providers/openai_compatible/image.py:84 — surfsense_local/backend/modules/llm/providers/openai_compatible/image.py:84-104 | surfsense_local/backend/modules/llm/providers/openai_compatible/image_edit.py:60-89 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×2
  • Edited copy of a member (15 corresponding lines) surfsense_local/backend/modules/llm/catalog/local/engines/sdcpp/launch.py:38 — surfsense_local/backend/modules/llm/catalog/local/engines/sdcpp/launch.py:38-52 | surfsense_local/backend/modules/llm/catalog/local/engines/sdcpp/launch.py:56-74 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) surfsense_local/backend/worker/jobs.py:51 — surfsense_local/backend/worker/jobs.py:51-65 | surfsense_local/backend/worker/jobs.py:69-84 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×2
  • Edited copy of a member (6 corresponding lines) plans/community-local/seo/data/b2b-oct/rollup.py:149 — plans/community-local/seo/data/b2b-oct/rollup.py:149-155 | plans/community-local/seo/data/b2b/rollup.py:118-123 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) backend/plugins/proprietary/instagram/fetch.py:285 — backend/plugins/proprietary/instagram/fetch.py:285-290 | backend/plugins/proprietary/reddit/fetch.py:288-297 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×2
  • Edited copy of a member (17 corresponding lines) surfsense_local/backend/modules/llm/catalog/local/install_jobs/router.py:95 — surfsense_local/backend/modules/llm/catalog/local/install_jobs/router.py:95-113 | surfsense_local/backend/modules/runtime_packs/office/router.py:57-73 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) plans/community-local/seo/data/parse.py:146 — plans/community-local/seo/data/parse.py:146-162 | plans/community-local/seo/data/parse.py:277-294 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×2
  • Edited copy of a member (16 corresponding lines) surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/audio_folder/installed.py:37 — surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/audio_folder/installed.py:37-52 | surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/audio_folder/installed_recognisers.py:33-48 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (16 corresponding lines) surfsense_local/backend/worker/studio/office/document/markdown_path.py:27 — surfsense_local/backend/worker/studio/office/document/markdown_path.py:27-42 | surfsense_local/backend/worker/studio/office/document/script_path.py:36-53 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×2
  • Edited copy of a member (9 corresponding lines) surfsense_local/backend/modules/agent/previews/router.py:107 — surfsense_local/backend/modules/agent/previews/router.py:107-115 | surfsense_local/backend/modules/agent/previews/router.py:124-132 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) surfsense_local/backend/modules/llm/catalog/remote/manifest/lookup.py:62 — surfsense_local/backend/modules/llm/catalog/remote/manifest/lookup.py:62-77 | surfsense_local/backend/modules/llm/catalog/remote/manifest/lookup.py:80-88 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) surfsense_local/backend/modules/agent/model_endpoint/responses_relay/router.py:35 — surfsense_local/backend/modules/agent/model_endpoint/responses_relay/router.py:35-54 | surfsense_local/backend/modules/agent/model_endpoint/router.py:36-55 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) backend/plugins/proprietary/tiktok/session/stealth.py:182 — backend/plugins/proprietary/tiktok/session/stealth.py:182-201 | backend/plugins/proprietary/web_crawl/stealth.py:181-204 — before extracting anything, compare `backend/plugins/proprietary/tiktok/session/stealth.py` and `backend/plugins/proprietary/web_crawl/stealth.py` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×2
  • Duplicated block (18 lines × 2) backend/plugins/proprietary/instagram/scraper.py:152 — backend/plugins/proprietary/instagram/scraper.py:152-169 | backend/plugins/proprietary/reddit/scraper.py:96-113 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (18 lines × 2) surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/rows/catalog.py:58 — surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/rows/catalog.py:58-75 | surfsense_local/backend/modules/llm/catalog/local/engines/sdcpp/rows/catalog.py:54-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 `surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/rows/catalog.py: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. Note first that the copies are not typed on the same thing: `ENGINE` names `modules.llm.catalog.local.engines.audiocpp` in one and `modules.llm.catalog.local.engines.sdcpp` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/rows/catalog.py:76` calls `_voicing`, `_transcribing` and `surfsense_local/backend/modules/llm/catalog/local/engines/sdcpp/rows/catalog.py:72` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×2
  • Duplicated block (16 lines × 2) backend/plugins/proprietary/google_maps/server.py:148 — backend/plugins/proprietary/google_maps/server.py:148-163 | backend/plugins/proprietary/walmart/server.py:133-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 `backend/plugins/proprietary/google_maps/server.py:148` 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) REDACTED:38 — REDACTED:38-53 | REDACTED:49-64 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×2
  • Duplicated block (15 lines × 2) REDACTED:46 — REDACTED:46-60 | REDACTED:50-64 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED: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.
  • Duplicated block (15 lines × 2) surfsense_local/backend/modules/artifacts/made_file.py:102 — surfsense_local/backend/modules/artifacts/made_file.py:102-116 | surfsense_local/backend/modules/artifacts/revised_copies/service.py:119-133 — 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 `surfsense_local/backend/modules/artifacts/made_file.py:102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×2
  • Duplicated block (14 lines × 2) backend/plugins/proprietary/tiktok/flows/comments.py:38 — backend/plugins/proprietary/tiktok/flows/comments.py:38-51 | backend/plugins/proprietary/tiktok/flows/listing.py:39-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `backend/plugins/proprietary/tiktok/flows/comments.py: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 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) surfsense_local/backend/modules/artifacts/revised_copies/engines/excel.py:126 — surfsense_local/backend/modules/artifacts/revised_copies/engines/excel.py:126-139 | surfsense_local/backend/modules/artifacts/revised_copies/engines/powerpoint.py:82-95 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
R10 · Code Duplication · Duplicated block with local edits (84 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (84 matched lines × 2 locations) surfsense_local/frontend/src/features/models/local/chat/model-card.tsx:27 — surfsense_local/frontend/src/features/models/local/chat/model-card.tsx:27 · surfsense_local/frontend/src/features/onboarding/model-step/local/local-model-list.tsx:16 — the two spans are one implementation copied and then locally edited — 386 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (84 matched lines × 2 locations) surfsense_local/frontend/src/features/studio/viewers/pdf-viewer.tsx:61 — surfsense_local/frontend/src/features/studio/viewers/pdf-viewer.tsx:61 · surfsense_local/frontend/src/features/studio/viewers/pptx-viewer.tsx:26 — the two spans are one implementation copied and then locally edited — 364 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (31 lines × 2 locations) · ×2
  • Duplicated block (31 lines × 2 locations) surfsense_local/frontend/src/features/chat/chats-dialog.tsx:116 — surfsense_local/frontend/src/features/chat/chats-dialog.tsx:116 · surfsense_local/frontend/src/features/workspaces/workspace-rail.tsx:112 — 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.
  • Duplicated block (31 lines × 2 locations) surfsense_local/frontend/src/features/models/remote/connections/chatgpt/api.ts:24 — surfsense_local/frontend/src/features/models/remote/connections/chatgpt/api.ts:24 · surfsense_local/frontend/src/features/models/remote/connections/claude/api.ts:35 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (30 lines × 2 locations) · ×2
  • Duplicated block (30 lines × 2 locations) surfsense_local/frontend/src/features/settings/models/audio-models-settings.tsx:15 — surfsense_local/frontend/src/features/settings/models/audio-models-settings.tsx:15 · surfsense_local/frontend/src/features/settings/models/image-models-settings.tsx:15 — 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.
  • Duplicated block (30 lines × 2 locations) surfsense_local/frontend/src/features/settings/models/image-edit-models-settings.tsx:17 — surfsense_local/frontend/src/features/settings/models/image-edit-models-settings.tsx:17 · surfsense_local/frontend/src/features/settings/models/video-models-settings.tsx:17 — 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.
R10 · Code Duplication · Duplicated block (24 lines × 2 locations) · ×2
  • Duplicated block (24 lines × 2 locations) surfsense_local/electron/src/main/i18n/locale-prefs.ts:17 — surfsense_local/electron/src/main/i18n/locale-prefs.ts:17 · surfsense_local/electron/src/main/theme-prefs.ts:20 — 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.
  • Duplicated block (24 lines × 2 locations) www/app/(home)/external-mcp-connectors/page.tsx:136 — www/app/(home)/external-mcp-connectors/page.tsx:136 · www/app/(home)/mcp-server/page.tsx:171 — 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.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×2
  • Swallowed exception (caught, then discarded) REDACTED:35 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
  • Swallowed exception (caught, then discarded) surfsense_local/frontend/src/features/plugins/license-verdict.ts:20 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
AC3 · Page structure · Page without a main landmark · ×1
  • Page without a main landmark www/app/global-error.tsx:20 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
D1 · Cyclomatic Complexity · gradient-ascii.GradientAscii (cyclomatic 68) · ×1
  • gradient-ascii.GradientAscii (cyclomatic 68) surfsense_local/frontend/src/features/onboarding/welcome-backdrop/gradient-ascii.tsx:63 — gradient-ascii.GradientAscii has cyclomatic complexity 68 (threshold 15). Most of this is not in the body itself: 3 of the 68 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 373, 124, 341, …). 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 · add-from-web-dialog.AddFromWebDialog (cyclomatic 60) · ×1
  • add-from-web-dialog.AddFromWebDialog (cyclomatic 60) surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx:54 — add-from-web-dialog.AddFromWebDialog has cyclomatic complexity 60 (threshold 15). Of this number, 17 points are the body's own statements and 43 belong to 15 function items inside it that branch. 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 · scraper._product_flow (cyclomatic 56) · ×1
  • scraper._product_flow (cyclomatic 56) backend/plugins/proprietary/amazon/scraper.py:151 — scraper._product_flow has cyclomatic complexity 56 (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 · use-chat-runtime.useChatRuntime (cyclomatic 50) · ×1
  • use-chat-runtime.useChatRuntime (cyclomatic 50) surfsense_local/frontend/src/features/chat/use-chat-runtime.ts:220 — use-chat-runtime.useChatRuntime has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 10 of the 50 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 404, 464, 356, …). 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 · sources-panel.SourcesPanel (cyclomatic 50) · ×1
  • sources-panel.SourcesPanel (cyclomatic 50) surfsense_local/frontend/src/features/sources/sources-panel.tsx:79 — sources-panel.SourcesPanel has cyclomatic complexity 50 (threshold 15). Of this number, 28 points are the body's own statements and 22 belong to 13 function items 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 · step-label.stepLabel (cyclomatic 48) · ×1
  • step-label.stepLabel (cyclomatic 48) REDACTED:44 — step-label.stepLabel has cyclomatic complexity 48 (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 · WebCrawlerConnector._build_result (cyclomatic 45) · ×1
  • WebCrawlerConnector._build_result (cyclomatic 45) backend/plugins/proprietary/web_crawl/connector.py:1042 — WebCrawlerConnector._build_result has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parsers.parse_product (cyclomatic 42) · ×1
  • parsers.parse_product (cyclomatic 42) backend/plugins/proprietary/amazon/parsers.py:302 — parsers.parse_product has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · document-row.DocumentRow (cyclomatic 41) · ×1
  • document-row.DocumentRow (cyclomatic 41) surfsense_local/frontend/src/features/sources/tree/document-row.tsx:53 — document-row.DocumentRow has cyclomatic complexity 41 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · connection-form.ConnectionForm (cyclomatic 39) · ×1
  • connection-form.ConnectionForm (cyclomatic 39) surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx:96 — connection-form.ConnectionForm has cyclomatic complexity 39 (threshold 15). Of this number, 24 points are the body's own statements and 15 belong to 4 function items 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 · quiz-viewer.QuizRunner (cyclomatic 38) · ×1
  • quiz-viewer.QuizRunner (cyclomatic 38) surfsense_local/frontend/src/features/studio/viewers/quiz/quiz-viewer.tsx:86 — quiz-viewer.QuizRunner has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 11 of the 38 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 301, selectAnswer, skipQuestion, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · turn._stream (cyclomatic 36) · ×1
  • turn._stream (cyclomatic 36) surfsense_local/backend/modules/agent/engines/claude_code/turn.py:210 — turn._stream has cyclomatic complexity 36 (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 · turn._stream (cyclomatic 35) · ×1
  • turn._stream (cyclomatic 35) surfsense_local/backend/modules/agent/agent_threads/turn.py:192 — turn._stream has cyclomatic complexity 35 (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 · use-chat-runtime.useChatRuntime.send (cyclomatic 35) · ×1
  • use-chat-runtime.useChatRuntime.send (cyclomatic 35) surfsense_local/frontend/src/features/chat/use-chat-runtime.ts:590 — use-chat-runtime.useChatRuntime.send has cyclomatic complexity 35 (threshold 15). Of this number, 34 points are the body's own statements and 1 belongs 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 · index.registerDocumentHandlers (cyclomatic 34) · ×1
  • index.registerDocumentHandlers (cyclomatic 34) REDACTED:168 — index.registerDocumentHandlers has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to 8 function items inside it that branch (a function literal at line 239, a function literal at line 172, a function literal at line 184, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · chat-composer.ChatComposer (cyclomatic 34) · ×1
  • chat-composer.ChatComposer (cyclomatic 34) surfsense_local/frontend/src/features/chat/chat-composer.tsx:154 — chat-composer.ChatComposer has cyclomatic complexity 34 (threshold 15). Of this number, 29 points are the body's own statements and 5 belong to 3 function items inside it that branch. 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 · refine-box.RefineBox (cyclomatic 34) · ×1
  • refine-box.RefineBox (cyclomatic 34) surfsense_local/frontend/src/features/studio/refine-box.tsx:37 — refine-box.RefineBox has cyclomatic complexity 34 (threshold 15). Of this number, 20 points are the body's own statements and 14 belong to 5 function items 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 · model-step.ModelStep (cyclomatic 33) · ×1
  • model-step.ModelStep (cyclomatic 33) surfsense_local/frontend/src/features/onboarding/model-step/model-step.tsx:52 — model-step.ModelStep has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 13 of the 33 points are its own statements and the rest belongs to 10 function items inside it that branch (body, downloadBuild, use, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · parsers._media_from_relay (cyclomatic 31) · ×1
  • parsers._media_from_relay (cyclomatic 31) backend/plugins/proprietary/instagram/parsers.py:431 — parsers._media_from_relay 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 · thread-panel.ThreadPanel (cyclomatic 31) · ×1
  • thread-panel.ThreadPanel (cyclomatic 31) surfsense_local/frontend/src/features/chat/thread-panel.tsx:159 — thread-panel.ThreadPanel has cyclomatic complexity 31 (threshold 15). Of this number, 16 points are the body's own statements and 15 belong to 6 function items inside it that branch. 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 · pdf-viewer.PdfViewer (cyclomatic 31) · ×1
  • pdf-viewer.PdfViewer (cyclomatic 31) surfsense_local/frontend/src/features/studio/viewers/pdf-viewer.tsx:47 — pdf-viewer.PdfViewer has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 6 of the 31 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 86, 183, 63, …). 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 · docx-viewer.DocxViewer (cyclomatic 30) · ×1
  • docx-viewer.DocxViewer (cyclomatic 30) surfsense_local/frontend/src/features/studio/viewers/docx-viewer.tsx:71 — docx-viewer.DocxViewer has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 7 of the 30 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 104, 90, 224, …). 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 · fetch.fetch_page (cyclomatic 29) · ×1
  • fetch.fetch_page (cyclomatic 29) backend/plugins/proprietary/amazon/fetch.py:215 — fetch.fetch_page 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 · chats-dialog.ChatList (cyclomatic 29) · ×1
  • chats-dialog.ChatList (cyclomatic 29) surfsense_local/frontend/src/features/chat/chats-dialog.tsx:342 — chats-dialog.ChatList has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 6 of the 29 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 415, rowActive, a function literal at line 394, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · dashboard-page.WorkspaceDashboard (cyclomatic 29) · ×1
  • dashboard-page.WorkspaceDashboard (cyclomatic 29) surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx:94 — dashboard-page.WorkspaceDashboard has cyclomatic complexity 29 (threshold 15). Of this number, 18 points are the body's own statements and 11 belong to 7 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 · pdf-viewer.PdfViewer (cyclomatic 29) · ×1
  • pdf-viewer.PdfViewer (cyclomatic 29) surfsense_local/frontend/src/features/file-viewers/pdf-viewer.tsx:46 — pdf-viewer.PdfViewer has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 5 of the 29 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 78, 172, 55, …). 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 · artifact-list.ArtifactRow (cyclomatic 28) · ×1
  • artifact-list.ArtifactRow (cyclomatic 28) surfsense_local/frontend/src/features/studio/artifact-list.tsx:129 — artifact-list.ArtifactRow 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 · mac-os-dock.MacOSDock (cyclomatic 28) · ×1
  • mac-os-dock.MacOSDock (cyclomatic 28) www/app/(home)/_home/home-pillars/previews/mac-os-dock.tsx:81 — mac-os-dock.MacOSDock has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 5 of the 28 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 254, a function literal at line 164, a function literal at line 138, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · artifact-panel.ArtifactPanel (cyclomatic 27) · ×1
  • artifact-panel.ArtifactPanel (cyclomatic 27) surfsense_local/frontend/src/features/studio/artifact-panel.tsx:70 — artifact-panel.ArtifactPanel has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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 · server.startAccess (cyclomatic 27) · ×1
  • server.startAccess (cyclomatic 27) surfsense_local/headless/access/server.ts:75 — server.startAccess has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 135, changeInTurn, signIn, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · job._generate (cyclomatic 26) · ×1
  • job._generate (cyclomatic 26) surfsense_local/backend/worker/studio/job.py:97 — job._generate 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 · parse.main (cyclomatic 26) · ×1
  • parse.main (cyclomatic 26) plans/community-local/seo/data/parse.py:1061 — parse.main 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 · server-models.ServerModels (cyclomatic 26) · ×1
  • server-models.ServerModels (cyclomatic 26) surfsense_local/frontend/src/features/models/remote/models/server-models.tsx:77 — server-models.ServerModels has cyclomatic complexity 26 (threshold 15). Of this number, 19 points are the body's own statements and 7 belong to 5 function items inside it that branch. 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 · fetch.fetch_serp_html (cyclomatic 25) · ×1
  • fetch.fetch_serp_html (cyclomatic 25) backend/plugins/proprietary/google_search/fetch.py:866 — fetch.fetch_serp_html 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 · fetch._fetch_on (cyclomatic 25) · ×1
  • fetch._fetch_on (cyclomatic 25) backend/plugins/proprietary/reddit/fetch.py:406 — fetch._fetch_on 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 · reply-thinking.ReplyHeader (cyclomatic 25) · ×1
  • reply-thinking.ReplyHeader (cyclomatic 25) surfsense_local/frontend/src/features/chat/reply-thinking.tsx:160 — reply-thinking.ReplyHeader has cyclomatic complexity 25 (threshold 15). Of this number, 18 points are the body's own statements and 7 belong to 4 function literals inside it that branch. 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 · excel._resolve (cyclomatic 24) · ×1
  • excel._resolve (cyclomatic 24) surfsense_local/backend/modules/artifacts/revised_copies/engines/excel.py:124 — excel._resolve 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 · rollup.render (cyclomatic 24) · ×1
  • rollup.render (cyclomatic 24) plans/community-local/seo/data/b2b-oct/rollup.py:258 — rollup.render 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 · plugin-search-results.PluginSearchResults (cyclomatic 24) · ×1
  • plugin-search-results.PluginSearchResults (cyclomatic 24) surfsense_local/frontend/src/features/plugins/search/plugin-search-results.tsx:51 — plugin-search-results.PluginSearchResults has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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 · file-card-collections.FileCard (cyclomatic 24) · ×1
  • file-card-collections.FileCard (cyclomatic 24) www/app/(home)/_home/home-formats/file-card-collections.tsx:94 — file-card-collections.FileCard has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · scraper._media_flow (cyclomatic 23) · ×1
  • scraper._media_flow (cyclomatic 23) backend/plugins/proprietary/instagram/scraper.py:321 — scraper._media_flow 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 · word_decide.decide_all (cyclomatic 23) · ×1
  • word_decide.decide_all (cyclomatic 23) surfsense_local/backend/modules/artifacts/revised_copies/engines/word_decide.py:86 — word_decide.decide_all 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 · check-export-sample.main (cyclomatic 23) · ×1
  • check-export-sample.main (cyclomatic 23) docs/contracts/check-export-sample.py:29 — check-export-sample.main 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 · plugin-actions-menu.PluginActionsMenu (cyclomatic 23) · ×1
  • plugin-actions-menu.PluginActionsMenu (cyclomatic 23) surfsense_local/frontend/src/features/plugins/details/plugin-actions-menu.tsx:40 — plugin-actions-menu.PluginActionsMenu has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parsers._hotel_fields (cyclomatic 22) · ×1
  • parsers._hotel_fields (cyclomatic 22) backend/plugins/proprietary/google_maps/parsers.py:249 — parsers._hotel_fields 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 · solvers._capsolver (cyclomatic 22) · ×1
  • solvers._capsolver (cyclomatic 22) backend/plugins/proprietary/scraping/captcha/solvers.py:204 — solvers._capsolver 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 · WebCrawlerConnector.crawl_url (cyclomatic 22) · ×1
  • WebCrawlerConnector.crawl_url (cyclomatic 22) backend/plugins/proprietary/web_crawl/connector.py:539 — WebCrawlerConnector.crawl_url 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 · source-tree.SourceTree · ×1
  • source-tree.SourceTree::onRowKeyDown (cyclomatic 22) surfsense_local/frontend/src/features/sources/tree/source-tree.tsx:143 — source-tree.SourceTree::onRowKeyDown 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 · parse-study-text.parseStudyText (cyclomatic 22) · ×1
  • parse-study-text.parseStudyText (cyclomatic 22) surfsense_local/frontend/src/features/studio/viewers/parse-study-text.ts:34 — parse-study-text.parseStudyText 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 · stage.main (cyclomatic 22) · ×1
  • stage.main (cyclomatic 22) surfsense_local/runtimes/audiocpp/stage.mjs:69 — stage.main has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · plugin-listing.listingFromEntry (cyclomatic 22) · ×1
  • plugin-listing.listingFromEntry (cyclomatic 22) www/app/(home)/plugins/plugin-listing.ts:71 — plugin-listing.listingFromEntry 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 · parsers.parse_place (cyclomatic 21) · ×1
  • parsers.parse_place (cyclomatic 21) backend/plugins/proprietary/google_maps/parsers.py:317 — parsers.parse_place has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · fetch._fetch (cyclomatic 21) · ×1
  • fetch._fetch (cyclomatic 21) backend/plugins/proprietary/instagram/fetch.py:385 — fetch._fetch 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 · try-model-dialog.TryModelDialog (cyclomatic 21) · ×1
  • try-model-dialog.TryModelDialog (cyclomatic 21) surfsense_local/frontend/src/features/models/remote/models/try-model-dialog.tsx:108 — try-model-dialog.TryModelDialog has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to 4 function items 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 · settings-dialog.SettingsDialog (cyclomatic 21) · ×1
  • settings-dialog.SettingsDialog (cyclomatic 21) surfsense_local/frontend/src/features/settings/settings-dialog.tsx:329 — settings-dialog.SettingsDialog has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 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 · use-sources.useSources.uploadEntries (cyclomatic 21) · ×1
  • use-sources.useSources.uploadEntries (cyclomatic 21) surfsense_local/frontend/src/features/sources/use-sources.ts:395 — use-sources.useSources.uploadEntries 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 · flashcards-viewer.FlashcardRunner (cyclomatic 21) · ×1
  • flashcards-viewer.FlashcardRunner (cyclomatic 21) surfsense_local/frontend/src/features/studio/viewers/flashcards/flashcards-viewer.tsx:101 — flashcards-viewer.FlashcardRunner has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (markCard, shuffle, resetProgress, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · comments._comments_for_video (cyclomatic 20) · ×1
  • comments._comments_for_video (cyclomatic 20) backend/plugins/proprietary/youtube/comments.py:142 — comments._comments_for_video 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 · errors.classify_chat_error (cyclomatic 20) · ×1
  • errors.classify_chat_error (cyclomatic 20) surfsense_local/backend/modules/chat/errors.py:118 — errors.classify_chat_error 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 · ParagraphStyles._role (cyclomatic 20) · ×1
  • ParagraphStyles._role (cyclomatic 20) surfsense_local/backend/worker/ingestion/word_markdown/styles.py:78 — ParagraphStyles._role 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 · parse.render_serp (cyclomatic 20) · ×1
  • parse.render_serp (cyclomatic 20) plans/community-local/seo/data/parse.py:522 — parse.render_serp 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 · theme-provider.ThemeProvider (cyclomatic 20) · ×1
  • theme-provider.ThemeProvider (cyclomatic 20) surfsense_local/frontend/src/components/theme-provider.tsx:105 — theme-provider.ThemeProvider has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 175, 130, 195, …). 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 · apply-frame.applyFrame (cyclomatic 20) · ×1
  • apply-frame.applyFrame (cyclomatic 20) surfsense_local/frontend/src/features/chat/runs/apply-frame.ts:17 — apply-frame.applyFrame has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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 · studio-panel.Composer (cyclomatic 20) · ×1
  • studio-panel.Composer (cyclomatic 20) surfsense_local/frontend/src/features/studio/studio-panel.tsx:137 — studio-panel.Composer has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 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 · url_resolver.resolve_url (cyclomatic 19) · ×1
  • url_resolver.resolve_url (cyclomatic 19) backend/plugins/proprietary/reddit/url_resolver.py:49 — url_resolver.resolve_url has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · browser_pool.page (cyclomatic 19) · ×1
  • browser_pool.page (cyclomatic 19) backend/plugins/proprietary/scraping/browser_pool.py:561 — browser_pool.page 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 · parsers.parse_video_page (cyclomatic 19) · ×1
  • parsers.parse_video_page (cyclomatic 19) backend/plugins/proprietary/youtube/parsers.py:586 — parsers.parse_video_page has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · scraper._channel_tab_flow (cyclomatic 19) · ×1
  • scraper._channel_tab_flow (cyclomatic 19) backend/plugins/proprietary/youtube/scraper.py:291 — scraper._channel_tab_flow has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · read-policy.readPolicy (cyclomatic 19) · ×1
  • read-policy.readPolicy (cyclomatic 19) surfsense_local/electron/src/main/admin-policy/read-policy.ts:52 — read-policy.readPolicy 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 · license-settings.LicenseSettings (cyclomatic 19) · ×1
  • license-settings.LicenseSettings (cyclomatic 19) surfsense_local/frontend/src/features/license/license-settings.tsx:264 — license-settings.LicenseSettings has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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 · chatgpt-sign-in.ChatGPTSignIn (cyclomatic 19) · ×1
  • chatgpt-sign-in.ChatGPTSignIn (cyclomatic 19) surfsense_local/frontend/src/features/models/remote/connections/chatgpt/chatgpt-sign-in.tsx:39 — chatgpt-sign-in.ChatGPTSignIn has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 3 function items 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 · add-sources-menu.AddSourcesMenu (cyclomatic 19) · ×1
  • add-sources-menu.AddSourcesMenu (cyclomatic 19) surfsense_local/frontend/src/features/sources/add-sources-menu.tsx:39 — add-sources-menu.AddSourcesMenu has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs 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 · parse-workbook.cellText (cyclomatic 19) · ×1
  • parse-workbook.cellText (cyclomatic 19) surfsense_local/frontend/src/features/studio/viewers/parse-workbook.ts:36 — parse-workbook.cellText has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · scraper._passes_filters (cyclomatic 18) · ×1
  • scraper._passes_filters (cyclomatic 18) backend/plugins/proprietary/google_maps/scraper.py:113 — scraper._passes_filters has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · parsers.parse_job_detail_model (cyclomatic 18) · ×1
  • parsers.parse_job_detail_model (cyclomatic 18) backend/plugins/proprietary/indeed/parsers.py:388 — parsers.parse_job_detail_model 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 · captcha.detect_challenge (cyclomatic 18) · ×1
  • captcha.detect_challenge (cyclomatic 18) backend/plugins/proprietary/web_crawl/captcha.py:63 — captcha.detect_challenge 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 · read_document.read (cyclomatic 18) · ×1
  • read_document.read (cyclomatic 18) surfsense_local/backend/modules/agent/tool_endpoint/read_document.py:73 — read_document.read 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 · routes.connect_registry_plugin (cyclomatic 18) · ×1
  • routes.connect_registry_plugin (cyclomatic 18) surfsense_local/backend/modules/plugins/lists/registry/routes.py:72 — routes.connect_registry_plugin 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 · rollup.level (cyclomatic 18) · ×1
  • rollup.level (cyclomatic 18) plans/community-local/seo/data/b2b-oct/rollup.py:90 — rollup.level has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · citation-panel.CitationPanel (cyclomatic 18) · ×1
  • citation-panel.CitationPanel (cyclomatic 18) surfsense_local/frontend/src/features/chat/citation-panel.tsx:10 — citation-panel.CitationPanel has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to 3 function literals inside it that branch. 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 · dashboard-page.DashboardPage (cyclomatic 18) · ×1
  • dashboard-page.DashboardPage (cyclomatic 18) surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx:632 — dashboard-page.DashboardPage has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 7 function items 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 · model-card.ModelCard (cyclomatic 18) · ×1
  • model-card.ModelCard (cyclomatic 18) surfsense_local/frontend/src/features/models/local/chat/model-card.tsx:34 — model-card.ModelCard has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 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 · plugin-status.pluginStatus (cyclomatic 18) · ×1
  • plugin-status.pluginStatus (cyclomatic 18) surfsense_local/frontend/src/features/plugins/yours/plugin-status.ts:15 — plugin-status.pluginStatus 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 · model-slot-settings.ModelSlotSettings (cyclomatic 18) · ×1
  • model-slot-settings.ModelSlotSettings (cyclomatic 18) surfsense_local/frontend/src/features/settings/models/model-slot-settings.tsx:67 — model-slot-settings.ModelSlotSettings has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs 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 · parsers._embedded_json (cyclomatic 17) · ×1
  • parsers._embedded_json (cyclomatic 17) backend/plugins/proprietary/amazon/parsers.py:180 — parsers._embedded_json 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 · parsers.parse_media (cyclomatic 17) · ×1
  • parsers.parse_media (cyclomatic 17) backend/plugins/proprietary/instagram/parsers.py:191 — parsers.parse_media 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 · scraper._paginate_listing (cyclomatic 17) · ×1
  • scraper._paginate_listing (cyclomatic 17) backend/plugins/proprietary/reddit/scraper.py:147 — scraper._paginate_listing 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 · parsers.parse_product (cyclomatic 17) · ×1
  • parsers.parse_product (cyclomatic 17) backend/plugins/proprietary/walmart/parsers.py:211 — parsers.parse_product 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 · site_crawler.crawl_site (cyclomatic 17) · ×1
  • site_crawler.crawl_site (cyclomatic 17) backend/plugins/proprietary/web_crawl/site_crawler.py:139 — site_crawler.crawl_site 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 · package.package_problems (cyclomatic 17) · ×1
  • package.package_problems (cyclomatic 17) surfsense_local/backend/modules/artifacts/revised_copies/engines/package.py:329 — package.package_problems 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 · workbook_summary._sheet_block (cyclomatic 17) · ×1
  • workbook_summary._sheet_block (cyclomatic 17) surfsense_local/backend/worker/studio/script_document/workbook_summary.py:85 — workbook_summary._sheet_block 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 · visible-rows.visibleRows (cyclomatic 17) · ×1
  • visible-rows.visibleRows (cyclomatic 17) surfsense_local/frontend/src/features/sources/tree/visible-rows.ts:34 — visible-rows.visibleRows has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (walk, a function literal at line 61, a function literal at line 67). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · artifact-list.ArtifactList (cyclomatic 17) · ×1
  • artifact-list.ArtifactList (cyclomatic 17) surfsense_local/frontend/src/features/studio/artifact-list.tsx:572 — artifact-list.ArtifactList has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to 5 function items inside it that branch. 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 · update-settings.UpdateSettings (cyclomatic 17) · ×1
  • update-settings.UpdateSettings (cyclomatic 17) surfsense_local/frontend/src/features/updates/update-settings.tsx:55 — update-settings.UpdateSettings 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 · fetch.resolve_place (cyclomatic 16) · ×1
  • fetch.resolve_place (cyclomatic 16) backend/plugins/proprietary/google_maps/fetch.py:264 — fetch.resolve_place 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 · contacts.extract_contacts (cyclomatic 16) · ×1
  • contacts.extract_contacts (cyclomatic 16) backend/plugins/proprietary/web_crawl/contacts.py:280 — contacts.extract_contacts 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 · url_resolver.resolve_url (cyclomatic 16) · ×1
  • url_resolver.resolve_url (cyclomatic 16) backend/plugins/proprietary/youtube/url_resolver.py:44 — url_resolver.resolve_url 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 · pdf_outputs._shown (cyclomatic 16) · ×1
  • pdf_outputs._shown (cyclomatic 16) surfsense_local/backend/modules/agent/tool_endpoint/pdf_outputs.py:123 — pdf_outputs._shown 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 · quiz_progress._valid_state (cyclomatic 16) · ×1
  • quiz_progress._valid_state (cyclomatic 16) surfsense_local/backend/modules/artifacts/quiz_progress.py:49 — quiz_progress._valid_state 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 · cell_map.cell_map (cyclomatic 16) · ×1
  • cell_map.cell_map (cyclomatic 16) surfsense_local/backend/modules/artifacts/revised_copies/cell_map.py:56 — cell_map.cell_map 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 · Sheet.write (cyclomatic 16) · ×1
  • Sheet.write (cyclomatic 16) surfsense_local/backend/modules/artifacts/revised_copies/engines/excel_sheet.py:155 — Sheet.write 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 · powerpoint._replace_text (cyclomatic 16) · ×1
  • powerpoint._replace_text (cyclomatic 16) surfsense_local/backend/modules/artifacts/revised_copies/engines/powerpoint.py:121 — powerpoint._replace_text 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 · events.deltas (cyclomatic 16) · ×1
  • events.deltas (cyclomatic 16) surfsense_local/backend/modules/llm/providers/openai_responses/events.py:21 — events.deltas 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 · number_formats.formatted (cyclomatic 16) · ×1
  • number_formats.formatted (cyclomatic 16) surfsense_local/backend/worker/ingestion/word_markdown/number_formats.py:70 — number_formats.formatted 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 · parse.rows_score (cyclomatic 16) · ×1
  • parse.rows_score (cyclomatic 16) plans/community-local/seo/data/parse.py:463 — parse.rows_score 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 · parse.compact_market (cyclomatic 16) · ×1
  • parse.compact_market (cyclomatic 16) plans/community-local/seo/data/parse.py:578 — parse.compact_market 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 · parse.rows_markets (cyclomatic 16) · ×1
  • parse.rows_markets (cyclomatic 16) plans/community-local/seo/data/parse.py:727 — parse.rows_markets 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 · parse.self_check (cyclomatic 16) · ×1
  • parse.self_check (cyclomatic 16) plans/community-local/seo/data/parse.py:804 — parse.self_check has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · external-url.allowedExternalUrl (cyclomatic 16) · ×1
  • external-url.allowedExternalUrl (cyclomatic 16) surfsense_local/electron/src/main/external-url.ts:52 — external-url.allowedExternalUrl 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 · model-search.ModelSearch (cyclomatic 16) · ×1
  • model-search.ModelSearch (cyclomatic 16) surfsense_local/frontend/src/features/models/local/chat/model-search.tsx:229 — model-search.ModelSearch has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 271, 400, 436, …). 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 · privacy-step.PrivacyStep (cyclomatic 16) · ×1
  • privacy-step.PrivacyStep (cyclomatic 16) surfsense_local/frontend/src/features/onboarding/privacy-step/privacy-step.tsx:39 — privacy-step.PrivacyStep has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · add-plugin-dialog.AddPluginForm (cyclomatic 16) · ×1
  • add-plugin-dialog.AddPluginForm (cyclomatic 16) surfsense_local/frontend/src/features/plugins/add-custom/add-plugin-dialog.tsx:57 — add-plugin-dialog.AddPluginForm has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · connect-listed-plugin.ConnectListedPlugin (cyclomatic 16) · ×1
  • connect-listed-plugin.ConnectListedPlugin (cyclomatic 16) surfsense_local/frontend/src/features/plugins/browse/connect-listed-plugin.tsx:33 — connect-listed-plugin.ConnectListedPlugin has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 5 function items 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 · plugin-status-line.checkLabel (cyclomatic 16) · ×1
  • plugin-status-line.checkLabel (cyclomatic 16) surfsense_local/frontend/src/features/plugins/details/plugin-status-line.tsx:15 — plugin-status-line.checkLabel 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.
D2 · Cognitive Complexity · add-from-web-dialog.AddFromWebDialog (cognitive 88) · ×1
  • add-from-web-dialog.AddFromWebDialog (cognitive 88) surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx:54 — add-from-web-dialog.AddFromWebDialog has cognitive complexity 88 (threshold 15). Drivers by points: ternaries 23 (48 pts), if/else 17 (22 pts), boolean chains 10, error handling 5 (6 pts), loops 2 (nesting depth added 31). Of this number, 29 points are the body's own statements and 59 belong to 15 function items inside it that branch. To reduce it, split the body into named stages: move each independent 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 · scraper._product_flow (cognitive 75) · ×1
  • scraper._product_flow (cognitive 75) backend/plugins/proprietary/amazon/scraper.py:151 — scraper._product_flow has cognitive complexity 75 (threshold 15). Drivers by points: if/else 21 (34 pts), ternaries 12 (17 pts), boolean chains 16, loops 5 (8 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WebCrawlerConnector._build_result (cognitive 61) · ×1
  • WebCrawlerConnector._build_result (cognitive 61) backend/plugins/proprietary/web_crawl/connector.py:1042 — WebCrawlerConnector._build_result has cognitive complexity 61 (threshold 15). Drivers by points: if/else 24 (35 pts), boolean chains 13, ternaries 5 (7 pts), error handling 4 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sources-panel.SourcesPanel (cognitive 61) · ×1
  • sources-panel.SourcesPanel (cognitive 61) surfsense_local/frontend/src/features/sources/sources-panel.tsx:79 — sources-panel.SourcesPanel has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 24 (27 pts), if/else 15 (23 pts), boolean chains 11 (nesting depth added 11). Of this number, 30 points are the body's own statements and 31 belong to 13 function items 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, 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 · gradient-ascii.GradientAscii (cognitive 59) · ×1
  • gradient-ascii.GradientAscii (cognitive 59) surfsense_local/frontend/src/features/onboarding/welcome-backdrop/gradient-ascii.tsx:63 — gradient-ascii.GradientAscii has cognitive complexity 59 (threshold 15). Drivers by points: if/else 27 (29 pts), boolean chains 17, ternaries 7, loops 5 (6 pts) (nesting depth added 3). Most of this is not in the body itself: 2 of the 59 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 341, 373, 413, …). 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 · scraper._media_flow (cognitive 57) · ×1
  • scraper._media_flow (cognitive 57) backend/plugins/proprietary/instagram/scraper.py:321 — scraper._media_flow has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (47 pts), loops 2 (5 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · turn._stream (cognitive 57) · ×1
  • turn._stream (cognitive 57) surfsense_local/backend/modules/agent/agent_threads/turn.py:192 — turn._stream has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (35 pts), error handling 6 (8 pts), boolean chains 6, loops 3 (6 pts), ternaries 2 (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 · turn._stream (cognitive 54) · ×1
  • turn._stream (cognitive 54) surfsense_local/backend/modules/agent/engines/claude_code/turn.py:210 — turn._stream has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 5 (9 pts), boolean chains 8, ternaries 3 (5 pts), error handling 2 (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 · use-chat-runtime.useChatRuntime (cognitive 54) · ×1
  • use-chat-runtime.useChatRuntime (cognitive 54) surfsense_local/frontend/src/features/chat/use-chat-runtime.ts:220 — use-chat-runtime.useChatRuntime has cognitive complexity 54 (threshold 15). Drivers by points: if/else 29 (33 pts), boolean chains 10, ternaries 7 (10 pts), loops 1 (nesting depth added 7). Most of this is not in the body itself: 7 of the 54 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 404, 507, 464, …). 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 · parsers.parse_product (cognitive 53) · ×1
  • parsers.parse_product (cognitive 53) backend/plugins/proprietary/amazon/parsers.py:302 — parsers.parse_product has cognitive complexity 53 (threshold 15). Drivers by points: boolean chains 19, if/else 9 (16 pts), ternaries 8, loops 4 (7 pts), error handling 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server-models.ServerModels (cognitive 52) · ×1
  • server-models.ServerModels (cognitive 52) surfsense_local/frontend/src/features/models/remote/models/server-models.tsx:77 — server-models.ServerModels has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 17 (43 pts), boolean chains 6, if/else 2 (3 pts) (nesting depth added 27). Of this number, 32 points are the body's own statements and 20 belong to 5 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · check-export-sample.main (cognitive 51) · ×1
  • check-export-sample.main (cognitive 51) docs/contracts/check-export-sample.py:29 — check-export-sample.main has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 7 (16 pts), boolean chains 1, ternaries 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent 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 · step-label.stepLabel (cognitive 51) · ×1
  • step-label.stepLabel (cognitive 51) REDACTED:44 — step-label.stepLabel has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (32 pts), ternaries 8 (18 pts), match/switch 1 (nesting depth added 26). 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 · fetch.fetch_serp_html (cognitive 47) · ×1
  • fetch.fetch_serp_html (cognitive 47) backend/plugins/proprietary/google_search/fetch.py:866 — fetch.fetch_serp_html has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (31 pts), error handling 3 (7 pts), boolean chains 6, ternaries 1 (2 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetch.fetch_page (cognitive 46) · ×1
  • fetch.fetch_page (cognitive 46) backend/plugins/proprietary/amazon/fetch.py:215 — fetch.fetch_page has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (28 pts), ternaries 6 (9 pts), boolean chains 6, error handling 1 (2 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fetch._fetch_on (cognitive 45) · ×1
  • fetch._fetch_on (cognitive 45) backend/plugins/proprietary/reddit/fetch.py:406 — fetch._fetch_on has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (33 pts), boolean chains 7, error handling 2 (4 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document-row.DocumentRow (cognitive 45) · ×1
  • document-row.DocumentRow (cognitive 45) surfsense_local/frontend/src/features/sources/tree/document-row.tsx:53 — document-row.DocumentRow has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 25 (31 pts), boolean chains 14 (nesting depth added 6). 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 · model-search.ModelSearch (cognitive 44) · ×1
  • model-search.ModelSearch (cognitive 44) surfsense_local/frontend/src/features/models/local/chat/model-search.tsx:229 — model-search.ModelSearch has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 11 (41 pts), if/else 2, boolean chains 1 (nesting depth added 30). Most of this is not in the body itself: 11 of the 44 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 271, 400, 436, …). 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 · fetch._fetch (cognitive 42) · ×1
  • fetch._fetch (cognitive 42) backend/plugins/proprietary/instagram/fetch.py:385 — fetch._fetch has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (34 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat-composer.ChatComposer (cognitive 42) · ×1
  • chat-composer.ChatComposer (cognitive 42) surfsense_local/frontend/src/features/chat/chat-composer.tsx:154 — chat-composer.ChatComposer has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 22 (32 pts), boolean chains 10 (nesting depth added 10). Of this number, 37 points are the body's own statements and 5 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent 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 · connection-form.ConnectionForm (cognitive 41) · ×1
  • connection-form.ConnectionForm (cognitive 41) surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx:96 — connection-form.ConnectionForm has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 18 (23 pts), if/else 9 (10 pts), boolean chains 7, error handling 1 (nesting depth added 6). Of this number, 24 points are the body's own statements and 17 belong to 4 function items 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.
D2 · Cognitive Complexity · comments._comments_for_video (cognitive 40) · ×1
  • comments._comments_for_video (cognitive 40) backend/plugins/proprietary/youtube/comments.py:142 — comments._comments_for_video has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 4 (10 pts), boolean chains 3, ternaries 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scraper._reviews_flow (cognitive 39) · ×1
  • scraper._reviews_flow (cognitive 39) backend/plugins/proprietary/walmart/scraper.py:456 — scraper._reviews_flow has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (31 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent 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 · use-chat-runtime.useChatRuntime.send (cognitive 38) · ×1
  • use-chat-runtime.useChatRuntime.send (cognitive 38) surfsense_local/frontend/src/features/chat/use-chat-runtime.ts:590 — use-chat-runtime.useChatRuntime.send has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (21 pts), ternaries 5 (8 pts), boolean chains 7, error handling 2 (nesting depth added 10). Of this number, 35 points are the body's own statements and 3 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 · thread-panel.ThreadPanel (cognitive 38) · ×1
  • thread-panel.ThreadPanel (cognitive 38) surfsense_local/frontend/src/features/chat/thread-panel.tsx:159 — thread-panel.ThreadPanel has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 12 (14 pts), boolean chains 9 (nesting depth added 9). Most of this is not in the body itself: 15 of the 38 points are its own statements and the rest belongs to 6 function items inside it that branch (commitEditing, composer, a function literal at line 267, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · quiz-viewer.QuizRunner (cognitive 38) · ×1
  • quiz-viewer.QuizRunner (cognitive 38) surfsense_local/frontend/src/features/studio/viewers/quiz/quiz-viewer.tsx:86 — quiz-viewer.QuizRunner has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 13 (18 pts), boolean chains 10, if/else 7, error handling 3 (nesting depth added 5). Most of this is not in the body itself: 10 of the 38 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 301, selectAnswer, skipQuestion, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · cell_map.cell_map (cognitive 37) · ×1
  • cell_map.cell_map (cognitive 37) surfsense_local/backend/modules/artifacts/revised_copies/cell_map.py:56 — cell_map.cell_map has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (6 pts), ternaries 1 (5 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parse-study-text.parseStudyText (cognitive 37) · ×1
  • parse-study-text.parseStudyText (cognitive 37) surfsense_local/frontend/src/features/studio/viewers/parse-study-text.ts:34 — parse-study-text.parseStudyText has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 9, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · site_crawler.crawl_site (cognitive 36) · ×1
  • site_crawler.crawl_site (cognitive 36) backend/plugins/proprietary/web_crawl/site_crawler.py:139 — site_crawler.crawl_site has cognitive complexity 36 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 5 (11 pts), boolean chains 6 (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 · word_decide.decide_all (cognitive 35) · ×1
  • word_decide.decide_all (cognitive 35) surfsense_local/backend/modules/artifacts/revised_copies/engines/word_decide.py:86 — word_decide.decide_all has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 7 (8 pts), ternaries 1 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reply-thinking.ReplyHeader (cognitive 35) · ×1
  • reply-thinking.ReplyHeader (cognitive 35) surfsense_local/frontend/src/features/chat/reply-thinking.tsx:160 — reply-thinking.ReplyHeader has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 15 (26 pts), boolean chains 5, if/else 3 (4 pts) (nesting depth added 12). Of this number, 28 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent 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 · model-step.ModelStep (cognitive 35) · ×1
  • model-step.ModelStep (cognitive 35) surfsense_local/frontend/src/features/onboarding/model-step/model-step.tsx:52 — model-step.ModelStep has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 16 (19 pts), if/else 11, boolean chains 5 (nesting depth added 3). Most of this is not in the body itself: 12 of the 35 points are its own statements and the rest belongs to 10 function items inside it that branch (body, downloadBuild, use, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · solvers._capsolver (cognitive 34) · ×1
  • solvers._capsolver (cognitive 34) backend/plugins/proprietary/scraping/captcha/solvers.py:204 — solvers._capsolver has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 7 (16 pts), if/else 9 (12 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rollup.render (cognitive 34) · ×1
  • rollup.render (cognitive 34) plans/community-local/seo/data/b2b-oct/rollup.py:258 — rollup.render has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 5 (9 pts), loops 8 (9 pts), boolean chains 4 (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 · chats-dialog.ChatList (cognitive 34) · ×1
  • chats-dialog.ChatList (cognitive 34) surfsense_local/frontend/src/features/chat/chats-dialog.tsx:342 — chats-dialog.ChatList has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 14 (22 pts), boolean chains 12 (nesting depth added 8). Most of this is not in the body itself: 6 of the 34 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 415, rowActive, a function literal at line 394, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · captcha.detect_challenge (cognitive 32) · ×1
  • captcha.detect_challenge (cognitive 32) backend/plugins/proprietary/web_crawl/captcha.py:63 — captcha.detect_challenge has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 4 (6 pts), boolean chains 5, error handling 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · package.package_problems (cognitive 32) · ×1
  • package.package_problems (cognitive 32) surfsense_local/backend/modules/artifacts/revised_copies/engines/package.py:329 — package.package_problems has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (21 pts), error handling 2 (5 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · workbook_summary._sheet_block (cognitive 32) · ×1
  • workbook_summary._sheet_block (cognitive 32) surfsense_local/backend/worker/studio/script_document/workbook_summary.py:85 — workbook_summary._sheet_block has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 4 (10 pts), loops 2 (3 pts), boolean chains 2 (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 · model-picker.ModelPicker (cognitive 32) · ×1
  • model-picker.ModelPicker (cognitive 32) surfsense_local/frontend/src/features/chat/model-picker.tsx:49 — model-picker.ModelPicker has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 9 (27 pts), if/else 4, boolean chains 1 (nesting depth added 18). Most of this is not in the body itself: 15 of the 32 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 213, 96, 70, …). 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 · scraper._all_places_flow (cognitive 31) · ×1
  • scraper._all_places_flow (cognitive 31) backend/plugins/proprietary/google_maps/scraper.py:320 — scraper._all_places_flow has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 4 (9 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scraper._paginate_listing (cognitive 31) · ×1
  • scraper._paginate_listing (cognitive 31) backend/plugins/proprietary/reddit/scraper.py:147 — scraper._paginate_listing has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scraper._channel_tab_flow (cognitive 31) · ×1
  • scraper._channel_tab_flow (cognitive 31) backend/plugins/proprietary/youtube/scraper.py:291 — scraper._channel_tab_flow has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (8 pts), boolean chains 4 (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 · refine-box.RefineBox (cognitive 31) · ×1
  • refine-box.RefineBox (cognitive 31) surfsense_local/frontend/src/features/studio/refine-box.tsx:37 — refine-box.RefineBox has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 11 (12 pts), boolean chains 6, error handling 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 14 belong to 5 function items 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.
D2 · Cognitive Complexity · server.startAccess (cognitive 31) · ×1
  • server.startAccess (cognitive 31) surfsense_local/headless/access/server.ts:75 — server.startAccess has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 6, ternaries 1 (2 pts), error handling 1 (nesting depth added 5). None of this is in the body itself: all 31 points belong to 4 function items inside it that branch (a function literal at line 135, changeInTurn, signIn, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · parsers._media_from_relay (cognitive 30) · ×1
  • parsers._media_from_relay (cognitive 30) backend/plugins/proprietary/instagram/parsers.py:431 — parsers._media_from_relay has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 14, ternaries 11, if/else 5. 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 · scraper._listing_flow (cognitive 30) · ×1
  • scraper._listing_flow (cognitive 30) backend/plugins/proprietary/walmart/scraper.py:292 — scraper._listing_flow has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (9 pts), boolean chains 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dashboard-page.WorkspaceDashboard (cognitive 30) · ×1
  • dashboard-page.WorkspaceDashboard (cognitive 30) surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx:94 — dashboard-page.WorkspaceDashboard has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 14 (17 pts), boolean chains 7, if/else 6 (nesting depth added 3). Of this number, 20 points are the body's own statements and 10 belong to 7 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.
D2 · Cognitive Complexity · stage.main (cognitive 30) · ×1
  • stage.main (cognitive 30) surfsense_local/runtimes/audiocpp/stage.mjs:69 — stage.main has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 5 (9 pts), error handling 2, boolean chains 1 (nesting depth added 9). Of this number, 29 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · transcript_shape.opencode_messages (cognitive 29) · ×1
  • transcript_shape.opencode_messages (cognitive 29) surfsense_local/backend/modules/agent/engines/claude_code/transcript_shape.py:20 — transcript_shape.opencode_messages has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (21 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · excel._resolve (cognitive 29) · ×1
  • excel._resolve (cognitive 29) surfsense_local/backend/modules/artifacts/revised_copies/engines/excel.py:124 — excel._resolve has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 7, loops 4 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parse.rows_markets (cognitive 29) · ×1
  • parse.rows_markets (cognitive 29) plans/community-local/seo/data/parse.py:727 — parse.rows_markets has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 4 (10 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · use-sources.useSources.uploadEntries (cognitive 29) · ×1
  • use-sources.useSources.uploadEntries (cognitive 29) surfsense_local/frontend/src/features/sources/use-sources.ts:395 — use-sources.useSources.uploadEntries has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 8 (11 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parsers._hotel_fields (cognitive 28) · ×1
  • parsers._hotel_fields (cognitive 28) backend/plugins/proprietary/google_maps/parsers.py:249 — parsers._hotel_fields has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 5, loops 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · client._get_ok (cognitive 28) · ×1
  • client._get_ok (cognitive 28) backend/plugins/proprietary/tiktok/session/client.py:177 — client._get_ok has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 3, error handling 1 (2 pts), loops 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 · job._generate (cognitive 28) · ×1
  • job._generate (cognitive 28) surfsense_local/backend/worker/studio/job.py:97 — job._generate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 2, error handling 2, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.registerDocumentHandlers (cognitive 28) · ×1
  • index.registerDocumentHandlers (cognitive 28) REDACTED:168 — index.registerDocumentHandlers has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12, boolean chains 10, ternaries 2 (4 pts), error handling 2 (nesting depth added 2). None of this is in the body itself: all 28 points belong to 8 function items inside it that branch (a function literal at line 196, a function literal at line 253, a function literal at line 172, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · visible-rows.visibleRows (cognitive 28) · ×1
  • visible-rows.visibleRows (cognitive 28) surfsense_local/frontend/src/features/sources/tree/visible-rows.ts:34 — visible-rows.visibleRows has cognitive complexity 28 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 4 (9 pts), boolean chains 5 (nesting depth added 13). Of this number, 19 points are the body's own statements and 9 belong to 3 function items inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · artifact-list.ArtifactRow (cognitive 28) · ×1
  • artifact-list.ArtifactRow (cognitive 28) surfsense_local/frontend/src/features/studio/artifact-list.tsx:129 — artifact-list.ArtifactRow has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 15 (18 pts), boolean chains 10 (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 · parse.main (cognitive 27) · ×1
  • parse.main (cognitive 27) plans/community-local/seo/data/parse.py:1061 — parse.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 3 (6 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · docx-viewer.DocxViewer (cognitive 27) · ×1
  • docx-viewer.DocxViewer (cognitive 27) surfsense_local/frontend/src/features/studio/viewers/docx-viewer.tsx:71 — docx-viewer.DocxViewer has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (16 pts), ternaries 4 (5 pts), boolean chains 4, error handling 2 (nesting depth added 2). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 104, 90, 224, …). 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 · scraper._search_flow (cognitive 26) · ×1
  • scraper._search_flow (cognitive 26) backend/plugins/proprietary/amazon/scraper.py:451 — scraper._search_flow has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (7 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (scraper._bestsellers_flow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · scraper._bestsellers_flow (cognitive 26) · ×1
  • scraper._bestsellers_flow (cognitive 26) backend/plugins/proprietary/amazon/scraper.py:534 — scraper._bestsellers_flow has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (7 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (scraper._search_flow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · contacts.extract_contacts (cognitive 26) · ×1
  • contacts.extract_contacts (cognitive 26) backend/plugins/proprietary/web_crawl/contacts.py:280 — contacts.extract_contacts has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · excel.apply (cognitive 26) · ×1
  • excel.apply (cognitive 26) surfsense_local/backend/modules/artifacts/revised_copies/engines/excel.py:55 — excel.apply has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (4 pts), error handling 1 (2 pts), ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · word_comments.remove_comments (cognitive 26) · ×1
  • word_comments.remove_comments (cognitive 26) surfsense_local/backend/modules/artifacts/revised_copies/engines/word_comments.py:114 — word_comments.remove_comments has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · license-settings.LicenseSettings (cognitive 26) · ×1
  • license-settings.LicenseSettings (cognitive 26) surfsense_local/frontend/src/features/license/license-settings.tsx:264 — license-settings.LicenseSettings has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 13 (21 pts), boolean chains 2, if/else 1 (2 pts), error handling 1 (nesting depth added 9). Of this number, 23 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent 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 · plugin-search-results.PluginSearchResults (cognitive 26) · ×1
  • plugin-search-results.PluginSearchResults (cognitive 26) surfsense_local/frontend/src/features/plugins/search/plugin-search-results.tsx:51 — plugin-search-results.PluginSearchResults has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 8, if/else 3 (4 pts) (nesting depth added 7). Of this number, 24 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent 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 · send-batch.sendBatch (cognitive 26) · ×1
  • send-batch.sendBatch (cognitive 26) surfsense_local/frontend/src/features/sources/folder-upload/send-batch.ts:31 — send-batch.sendBatch has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 1 (5 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mac-os-dock.MacOSDock (cognitive 26) · ×1
  • mac-os-dock.MacOSDock (cognitive 26) www/app/(home)/_home/home-pillars/previews/mac-os-dock.tsx:81 — mac-os-dock.MacOSDock has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 10, if/else 9, boolean chains 7. Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 254, a function literal at line 164, a function literal at line 138, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · pdf-viewer.PdfViewer (cognitive 25) · ×1
  • pdf-viewer.PdfViewer (cognitive 25) surfsense_local/frontend/src/features/studio/viewers/pdf-viewer.tsx:47 — pdf-viewer.PdfViewer has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6, ternaries 4 (5 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 5 of the 25 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 86, 183, 63, …). 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 · parsers._variant_data (cognitive 24) · ×1
  • parsers._variant_data (cognitive 24) backend/plugins/proprietary/amazon/parsers.py:231 — parsers._variant_data has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (10 pts), 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 · scraper.iter_reddit (cognitive 24) · ×1
  • scraper.iter_reddit (cognitive 24) backend/plugins/proprietary/reddit/scraper.py:407 — scraper.iter_reddit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 5 (10 pts), error handling 1 (2 pts), boolean chains 1, ternaries 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 · WebCrawlerConnector.crawl_url (cognitive 24) · ×1
  • WebCrawlerConnector.crawl_url (cognitive 24) backend/plugins/proprietary/web_crawl/connector.py:539 — WebCrawlerConnector.crawl_url has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 8, boolean chains 3, ternaries 1 (2 pts) (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.
D2 · Cognitive Complexity · parsers.parse_video_page (cognitive 24) · ×1
  • parsers.parse_video_page (cognitive 24) backend/plugins/proprietary/youtube/parsers.py:586 — parsers.parse_video_page has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (9 pts), ternaries 4 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pdf-viewer.PdfViewer (cognitive 24) · ×1
  • pdf-viewer.PdfViewer (cognitive 24) surfsense_local/frontend/src/features/file-viewers/pdf-viewer.tsx:46 — pdf-viewer.PdfViewer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, ternaries 4 (5 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 24 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 78, 172, 55, …). 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 · model-slot-settings.ModelSlotSettings (cognitive 24) · ×1
  • model-slot-settings.ModelSlotSettings (cognitive 24) surfsense_local/frontend/src/features/settings/models/model-slot-settings.tsx:67 — model-slot-settings.ModelSlotSettings has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 8 (19 pts), boolean chains 3, if/else 2 (nesting depth added 11). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · artifact-panel.ArtifactPanel (cognitive 24) · ×1
  • artifact-panel.ArtifactPanel (cognitive 24) surfsense_local/frontend/src/features/studio/artifact-panel.tsx:70 — artifact-panel.ArtifactPanel has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 8 (nesting depth added 5). Of this number, 23 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent 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 · reviews.collect_place_reviews (cognitive 23) · ×1
  • reviews.collect_place_reviews (cognitive 23) backend/plugins/proprietary/google_maps/reviews.py:105 — reviews.collect_place_reviews has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts), boolean chains 2, error handling 1, ternaries 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 · parsers._ai_sources (cognitive 23) · ×1
  • parsers._ai_sources (cognitive 23) backend/plugins/proprietary/google_search/parsers.py:488 — parsers._ai_sources has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (10 pts), boolean chains 6, if/else 3 (6 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · url_resolver.resolve_url (cognitive 23) · ×1
  • url_resolver.resolve_url (cognitive 23) backend/plugins/proprietary/reddit/url_resolver.py:49 — url_resolver.resolve_url has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 8, ternaries 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · concurrency.hedged (cognitive 23) · ×1
  • concurrency.hedged (cognitive 23) backend/plugins/proprietary/scraping/concurrency.py:137 — concurrency.hedged has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scan.projector_notices (cognitive 23) · ×1
  • scan.projector_notices (cognitive 23) surfsense_local/backend/modules/llm/catalog/local/engines/llamacpp/models_folder/scan.py:102 — scan.projector_notices has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 2 (5 pts), boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deck_text._shape_lines (cognitive 23) · ×1
  • deck_text._shape_lines (cognitive 23) surfsense_local/backend/worker/studio/script_document/deck_text.py:41 — deck_text._shape_lines has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (7 pts), ternaries 2 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parse.compact_market (cognitive 23) · ×1
  • parse.compact_market (cognitive 23) plans/community-local/seo/data/parse.py:578 — parse.compact_market has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 5, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · try-model-dialog.TryModelDialog (cognitive 23) · ×1
  • try-model-dialog.TryModelDialog (cognitive 23) surfsense_local/frontend/src/features/models/remote/models/try-model-dialog.tsx:108 — try-model-dialog.TryModelDialog has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 13 (16 pts), if/else 4, boolean chains 3 (nesting depth added 3). Of this number, 15 points are the body's own statements and 8 belong to 4 function items 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, 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 · office-support-settings.OfficeSupportSettings (cognitive 23) · ×1
  • office-support-settings.OfficeSupportSettings (cognitive 23) surfsense_local/frontend/src/features/office-support/office-support-settings.tsx:54 — office-support-settings.OfficeSupportSettings has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 2 (8 pts), boolean chains 3 (nesting depth added 12). Of this number, 15 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · add-sources-menu.AddSourcesMenu (cognitive 23) · ×1
  • add-sources-menu.AddSourcesMenu (cognitive 23) surfsense_local/frontend/src/features/sources/add-sources-menu.tsx:39 — add-sources-menu.AddSourcesMenu has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 12 (17 pts), boolean chains 5, if/else 1 (nesting depth added 5). Of this number, 22 points are the body's own statements and 1 belongs 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 · flashcards-viewer.FlashcardRunner (cognitive 23) · ×1
  • flashcards-viewer.FlashcardRunner (cognitive 23) surfsense_local/frontend/src/features/studio/viewers/flashcards/flashcards-viewer.tsx:101 — flashcards-viewer.FlashcardRunner has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (11 pts), if/else 5, boolean chains 4, error handling 3 (nesting depth added 4). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (markCard, shuffle, resetProgress, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · checkout.resolve_license_plan (cognitive 22) · ×1
  • checkout.resolve_license_plan (cognitive 22) backend/license/checkout.py:86 — checkout.resolve_license_plan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · browser_pool.page (cognitive 22) · ×1
  • browser_pool.page (cognitive 22) backend/plugins/proprietary/scraping/browser_pool.py:561 — browser_pool.page has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9, ternaries 7 (9 pts), boolean chains 3, error handling 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.
D2 · Cognitive Complexity · entry_rules._headers_problems (cognitive 22) · ×1
  • entry_rules._headers_problems (cognitive 22) backend/plugins/registry/check/registry_check/static/entry_rules.py:127 — entry_rules._headers_problems has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Sheet.write (cognitive 22) · ×1
  • Sheet.write (cognitive 22) surfsense_local/backend/modules/artifacts/revised_copies/engines/excel_sheet.py:155 — Sheet.write has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 1 (3 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parse.rows_score (cognitive 22) · ×1
  • parse.rows_score (cognitive 22) plans/community-local/seo/data/parse.py:463 — parse.rows_score has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 7, ternaries 3 (6 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · plugin-actions-menu.PluginActionsMenu (cognitive 22) · ×1
  • plugin-actions-menu.PluginActionsMenu (cognitive 22) surfsense_local/frontend/src/features/plugins/details/plugin-actions-menu.tsx:40 — plugin-actions-menu.PluginActionsMenu has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 9 (14 pts), boolean chains 7, if/else 1 (nesting depth added 5). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · docx-comments.shadePassages (cognitive 22) · ×1
  • docx-comments.shadePassages (cognitive 22) surfsense_local/frontend/src/features/studio/viewers/docx-comments.ts:114 — docx-comments.shadePassages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · workspace-changes.follow (cognitive 22) · ×1
  • workspace-changes.follow (cognitive 22) surfsense_local/frontend/src/features/workspaces/workspace-changes.ts:49 — workspace-changes.follow has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (8 pts), ternaries 1 (4 pts), error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parsers._embedded_json (cognitive 21) · ×1
  • parsers._embedded_json (cognitive 21) backend/plugins/proprietary/amazon/parsers.py:180 — parsers._embedded_json has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (4 pts), boolean chains 2, loops 2, ternaries 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 · fetch.resolve_place (cognitive 21) · ×1
  • fetch.resolve_place (cognitive 21) backend/plugins/proprietary/google_maps/fetch.py:264 — fetch.resolve_place has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 4 (7 pts), 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 · parsers.parse_place (cognitive 21) · ×1
  • parsers.parse_place (cognitive 21) backend/plugins/proprietary/google_maps/parsers.py:317 — parsers.parse_place has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7, ternaries 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 · scraper._search_flow (cognitive 21) · ×1
  • scraper._search_flow (cognitive 21) backend/plugins/proprietary/google_maps/scraper.py:230 — scraper._search_flow has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), boolean chains 3, ternaries 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 · parsers._extract_json_object (cognitive 21) · ×1
  • parsers._extract_json_object (cognitive 21) backend/plugins/proprietary/youtube/parsers.py:244 — parsers._extract_json_object has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (5 pts), error handling 2, 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 · pdf_outputs._shown (cognitive 21) · ×1
  • pdf_outputs._shown (cognitive 21) surfsense_local/backend/modules/agent/tool_endpoint/pdf_outputs.py:123 — pdf_outputs._shown has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 4 (6 pts), error handling 1 (2 pts), loops 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · routes.connect_registry_plugin (cognitive 21) · ×1
  • routes.connect_registry_plugin (cognitive 21) surfsense_local/backend/modules/plugins/lists/registry/routes.py:72 — routes.connect_registry_plugin has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 6 (7 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ListNumbering._levels_of (cognitive 21) · ×1
  • ListNumbering._levels_of (cognitive 21) surfsense_local/backend/worker/ingestion/word_markdown/numbering.py:159 — ListNumbering._levels_of has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · theme-provider.ThemeProvider (cognitive 21) · ×1
  • theme-provider.ThemeProvider (cognitive 21) surfsense_local/frontend/src/components/theme-provider.tsx:105 — theme-provider.ThemeProvider has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, ternaries 5 (8 pts), boolean chains 2 (nesting depth added 3). None of this is in the body itself: all 21 points belong to 6 function literals inside it that branch (lines 175, 195, 130, …). 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 · citation-panel.CitationPanel (cognitive 21) · ×1
  • citation-panel.CitationPanel (cognitive 21) surfsense_local/frontend/src/features/chat/citation-panel.tsx:10 — citation-panel.CitationPanel has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 11 (17 pts), boolean chains 2, if/else 2 (nesting depth added 6). Of this number, 12 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent 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 · model-card.ModelCard (cognitive 21) · ×1
  • model-card.ModelCard (cognitive 21) surfsense_local/frontend/src/features/models/local/chat/model-card.tsx:34 — model-card.ModelCard has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 6, if/else 1 (nesting depth added 4). Of this number, 17 points are the body's own statements and 4 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 · plugin-status.pluginStatus (cognitive 21) · ×1
  • plugin-status.pluginStatus (cognitive 21) surfsense_local/frontend/src/features/plugins/yours/plugin-status.ts:15 — plugin-status.pluginStatus has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 5, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pin-manifest-to-release.checkStructure (cognitive 21) · ×1
  • pin-manifest-to-release.checkStructure (cognitive 21) www/features/desktop-telemetry/update-feed/pin-manifest-to-release.ts:61 — pin-manifest-to-release.checkStructure has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 2, loops 1 (nesting depth added 9). Of this number, 20 points are the body's own statements and 1 belongs 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 · fetch._get (cognitive 20) · ×1
  • fetch._get (cognitive 20) backend/plugins/proprietary/google_maps/fetch.py:425 — fetch._get has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parsers._opening_hours (cognitive 20) · ×1
  • parsers._opening_hours (cognitive 20) backend/plugins/proprietary/google_maps/parsers.py:74 — parsers._opening_hours has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 3 (6 pts), boolean chains 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 · scraper._subreddit_flow (cognitive 20) · ×1
  • scraper._subreddit_flow (cognitive 20) backend/plugins/proprietary/reddit/scraper.py:231 — scraper._subreddit_flow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · innertube._fetch (cognitive 20) · ×1
  • innertube._fetch (cognitive 20) REDACTED:190 — innertube._fetch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · url_resolver.resolve_url (cognitive 20) · ×1
  • url_resolver.resolve_url (cognitive 20) backend/plugins/proprietary/youtube/url_resolver.py:44 — url_resolver.resolve_url has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (5 pts), boolean chains 3, 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 · icon_rules._svg_problem (cognitive 20) · ×1
  • icon_rules._svg_problem (cognitive 20) backend/plugins/registry/check/registry_check/static/icon_rules.py:67 — icon_rules._svg_problem has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat._answer (cognitive 20) · ×1
  • chat._answer (cognitive 20) surfsense_local/backend/modules/llm/subscriptions/claude/chat.py:168 — chat._answer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · first_party_list.checked_entries (cognitive 20) · ×1
  • first_party_list.checked_entries (cognitive 20) surfsense_local/backend/modules/plugins/lists/first_party/first_party_list.py:21 — first_party_list.checked_entries has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParagraphStyles._role (cognitive 20) · ×1
  • ParagraphStyles._role (cognitive 20) surfsense_local/backend/worker/ingestion/word_markdown/styles.py:78 — ParagraphStyles._role has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, ternaries 3 (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 · chatgpt-sign-in.ChatGPTSignIn (cognitive 20) · ×1
  • chatgpt-sign-in.ChatGPTSignIn (cognitive 20) surfsense_local/frontend/src/features/models/remote/connections/chatgpt/chatgpt-sign-in.tsx:39 — chatgpt-sign-in.ChatGPTSignIn has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 6, error handling 1, if/else 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 5 belong to 3 function items 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.
D2 · Cognitive Complexity · settings-dialog.SettingsDialog (cognitive 20) · ×1
  • settings-dialog.SettingsDialog (cognitive 20) surfsense_local/frontend/src/features/settings/settings-dialog.tsx:329 — settings-dialog.SettingsDialog has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 18, boolean chains 2. Of this number, 16 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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 · source-tree.SourceTree · ×1
  • source-tree.SourceTree::onRowKeyDown (cognitive 20) surfsense_local/frontend/src/features/sources/tree/source-tree.tsx:143 — source-tree.SourceTree::onRowKeyDown has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), 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 · artifact-list.ArtifactList (cognitive 20) · ×1
  • artifact-list.ArtifactList (cognitive 20) surfsense_local/frontend/src/features/studio/artifact-list.tsx:572 — artifact-list.ArtifactList has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 3, boolean chains 2, loops 2 (nesting depth added 4). Of this number, 15 points are the body's own statements and 5 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent 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 · studio-panel.Composer (cognitive 20) · ×1
  • studio-panel.Composer (cognitive 20) surfsense_local/frontend/src/features/studio/studio-panel.tsx:137 — studio-panel.Composer has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 7 (nesting depth added 2). Of this number, 17 points are the body's own statements and 3 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.
D2 · Cognitive Complexity · stage.main (cognitive 20) · ×1
  • stage.main (cognitive 20) surfsense_local/runtimes/sdcpp/stage.mjs:51 — stage.main has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 7 (9 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · results._text (cognitive 19) · ×1
  • results._text (cognitive 19) backend/plugins/mcp_server/results.py:71 — results._text has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 pts), boolean chains 3, 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 · fetch._mint_location_session (cognitive 19) · ×1
  • fetch._mint_location_session (cognitive 19) backend/plugins/proprietary/amazon/fetch.py:627 — fetch._mint_location_session has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (4 pts), boolean chains 2, 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 · scraper._serp_page (cognitive 19) · ×1
  • scraper._serp_page (cognitive 19) backend/plugins/proprietary/google_search/scraper.py:184 — scraper._serp_page has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resolver.resolve_target (cognitive 19) · ×1
  • resolver.resolve_target (cognitive 19) backend/plugins/proprietary/tiktok/targets/resolver.py:17 — resolver.resolve_target has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · word_check.word_problems (cognitive 19) · ×1
  • word_check.word_problems (cognitive 19) surfsense_local/backend/modules/artifacts/revised_copies/engines/word_check.py:42 — word_check.word_problems has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · errors.classify_chat_error (cognitive 19) · ×1
  • errors.classify_chat_error (cognitive 19) surfsense_local/backend/modules/chat/errors.py:118 — errors.classify_chat_error has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · connect-listed-plugin.ConnectListedPlugin (cognitive 19) · ×1
  • connect-listed-plugin.ConnectListedPlugin (cognitive 19) surfsense_local/frontend/src/features/plugins/browse/connect-listed-plugin.tsx:33 — connect-listed-plugin.ConnectListedPlugin has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 6, boolean chains 2 (nesting depth added 2). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 54, start, a function literal at line 83, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · recording-line.RecordingLine (cognitive 19) · ×1
  • recording-line.RecordingLine (cognitive 19) surfsense_local/frontend/src/features/sources/transcription/recording-line.tsx:18 — recording-line.RecordingLine has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (14 pts), boolean chains 4, if/else 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · plugin-listing.listingFromEntry (cognitive 19) · ×1
  • plugin-listing.listingFromEntry (cognitive 19) www/app/(home)/plugins/plugin-listing.ts:71 — plugin-listing.listingFromEntry has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 5, if/else 2 (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 · scraper._passes_filters (cognitive 18) · ×1
  • scraper._passes_filters (cognitive 18) backend/plugins/proprietary/google_maps/scraper.py:113 — scraper._passes_filters has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · parsers.parse_paid_results (cognitive 18) · ×1
  • parsers.parse_paid_results (cognitive 18) backend/plugins/proprietary/google_search/parsers.py:325 — parsers.parse_paid_results has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 2 (5 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · solvers._twocaptcha (cognitive 18) · ×1
  • solvers._twocaptcha (cognitive 18) backend/plugins/proprietary/scraping/captcha/solvers.py:92 — solvers._twocaptcha has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · client.fetch_trending_api (cognitive 18) · ×1
  • client.fetch_trending_api (cognitive 18) backend/plugins/proprietary/tiktok/session/client.py:365 — client.fetch_trending_api has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · read_document.read (cognitive 18) · ×1
  • read_document.read (cognitive 18) surfsense_local/backend/modules/agent/tool_endpoint/read_document.py:73 — read_document.read has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 5, ternaries 4 (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 · word_ops._check_fields (cognitive 18) · ×1
  • word_ops._check_fields (cognitive 18) surfsense_local/backend/modules/artifacts/revised_copies/engines/word_ops.py:358 — word_ops._check_fields has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResponsesChatProvider._stream (cognitive 18) · ×1
  • ResponsesChatProvider._stream (cognitive 18) surfsense_local/backend/modules/llm/providers/openai_responses/chat.py:211 — ResponsesChatProvider._stream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · events.deltas (cognitive 18) · ×1
  • events.deltas (cognitive 18) surfsense_local/backend/modules/llm/providers/openai_responses/events.py:21 — events.deltas has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · speech_spans.spans_in (cognitive 18) · ×1
  • speech_spans.spans_in (cognitive 18) surfsense_local/backend/modules/llm/transcription/voice_activity/speech_spans.py:46 — speech_spans.spans_in has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, 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 · page_ranges.page_groups (cognitive 18) · ×1
  • page_ranges.page_groups (cognitive 18) surfsense_local/backend/modules/pdf_tools/page_ranges.py:25 — page_ranges.page_groups has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · registry_document.read_document (cognitive 18) · ×1
  • registry_document.read_document (cognitive 18) surfsense_local/backend/modules/plugins/lists/registry/registry_document.py:33 — registry_document.read_document has cognitive complexity 18 (threshold 15). Drivers by points: error handling 3 (5 pts), if/else 3 (5 pts), ternaries 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pipeline.build (cognitive 18) · ×1
  • pipeline.build (cognitive 18) surfsense_local/backend/worker/studio/web/html/pipeline.py:37 — pipeline.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · rollup.level (cognitive 18) · ×1
  • rollup.level (cognitive 18) plans/community-local/seo/data/b2b-oct/rollup.py:90 — rollup.level has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (5 pts), ternaries 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · parse.render_serp (cognitive 18) · ×1
  • parse.render_serp (cognitive 18) plans/community-local/seo/data/parse.py:522 — parse.render_serp has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (5 pts), loops 2 (4 pts), ternaries 3 (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 · fetch-llamacpp.checkConfiguration (cognitive 18) · ×1
  • fetch-llamacpp.checkConfiguration (cognitive 18) surfsense_local/runtimes/fetch-llamacpp.mjs:131 — fetch-llamacpp.checkConfiguration has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · read-policy.readPolicy (cognitive 18) · ×1
  • read-policy.readPolicy (cognitive 18) surfsense_local/electron/src/main/admin-policy/read-policy.ts:52 — read-policy.readPolicy has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (6 pts), boolean chains 5, if/else 5, error handling 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 · claude-dialog.ClaudeDialog (cognitive 18) · ×1
  • claude-dialog.ClaudeDialog (cognitive 18) surfsense_local/frontend/src/features/models/remote/connections/claude/claude-dialog.tsx:184 — claude-dialog.ClaudeDialog has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 2, error handling 1 (nesting depth added 6). Of this number, 11 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent 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 · msvc-runtime.copyMsvcRuntime (cognitive 18) · ×1
  • msvc-runtime.copyMsvcRuntime (cognitive 18) surfsense_local/runtimes/msvc-runtime.mjs:75 — msvc-runtime.copyMsvcRuntime has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · main (cognitive 18) · ×1
  • main (cognitive 18) surfsense_local/runtimes/fetch-llamacpp.mjs:157 — main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 1, loops 1, other 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 · parsers.parse_job_detail_model (cognitive 17) · ×1
  • parsers.parse_job_detail_model (cognitive 17) backend/plugins/proprietary/indeed/parsers.py:388 — parsers.parse_job_detail_model has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, ternaries 5, if/else 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · scraper._search_items (cognitive 17) · ×1
  • scraper._search_items (cognitive 17) backend/plugins/proprietary/indeed/scraper.py:86 — scraper._search_items has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scraper._discover_via_google (cognitive 17) · ×1
  • scraper._discover_via_google (cognitive 17) backend/plugins/proprietary/instagram/scraper.py:409 — scraper._discover_via_google has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessions._reap (cognitive 17) · ×1
  • sessions._reap (cognitive 17) backend/plugins/proprietary/scraping/sessions.py:453 — sessions._reap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · client.fetch_comments_api (cognitive 17) · ×1
  • client.fetch_comments_api (cognitive 17) backend/plugins/proprietary/tiktok/session/client.py:265 — client.fetch_comments_api has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · subtitles._native_subtitles (cognitive 17) · ×1
  • subtitles._native_subtitles (cognitive 17) backend/plugins/proprietary/youtube/subtitles.py:151 — subtitles._native_subtitles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · loaded_steps.name_loaded_steps (cognitive 17) · ×1
  • loaded_steps.name_loaded_steps (cognitive 17) surfsense_local/backend/modules/agent/tool_exposure/loaded_steps.py:59 — loaded_steps.name_loaded_steps has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Sheet.content (cognitive 17) · ×1
  • Sheet.content (cognitive 17) surfsense_local/backend/modules/artifacts/revised_copies/engines/excel_sheet.py:114 — Sheet.content has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, ternaries 3 (6 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · Package.remove (cognitive 17) · ×1
  • Package.remove (cognitive 17) surfsense_local/backend/modules/artifacts/revised_copies/engines/package.py:177 — Package.remove has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · powerpoint._replace_text (cognitive 17) · ×1
  • powerpoint._replace_text (cognitive 17) surfsense_local/backend/modules/artifacts/revised_copies/engines/powerpoint.py:121 — powerpoint._replace_text has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 2, ternaries 1 (2 pts) (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 · Deck._unlink (cognitive 17) · ×1
  • Deck._unlink (cognitive 17) surfsense_local/backend/modules/artifacts/revised_copies/engines/powerpoint_slides.py:132 — Deck._unlink has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Deck._copy (cognitive 17) · ×1
  • Deck._copy (cognitive 17) surfsense_local/backend/modules/artifacts/revised_copies/engines/powerpoint_slides.py:216 — Deck._copy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · router.upload_documents (cognitive 17) · ×1
  • router.upload_documents (cognitive 17) surfsense_local/backend/modules/documents/router.py:230 — router.upload_documents has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (5 pts), if/else 2 (4 pts), error handling 2 (3 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reddit._fit (cognitive 17) · ×1
  • reddit._fit (cognitive 17) surfsense_local/backend/modules/documents/web_sources/pullers/reddit.py:34 — reddit._fit has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 1 (2 pts) (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 · McpSession._run (cognitive 17) · ×1
  • McpSession._run (cognitive 17) surfsense_local/backend/modules/plugins/remote/mcp_client/session.py:60 — McpSession._run has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3 (6 pts), error handling 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · render_copy._fields (cognitive 17) · ×1
  • render_copy._fields (cognitive 17) surfsense_local/backend/modules/runtime_packs/office/soffice/render_copy.py:87 — render_copy._fields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 3, loops 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 · kf8_index._values (cognitive 17) · ×1
  • kf8_index._values (cognitive 17) surfsense_local/backend/worker/ingestion/kindle_books/kf8_index.py:52 — kf8_index._values has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 4 (7 pts), boolean chains 2 (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · _Reader._properties (cognitive 17) · ×1
  • _Reader._properties (cognitive 17) surfsense_local/backend/worker/ingestion/word_markdown/document.py:156 — _Reader._properties has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListNumbering.next_marker (cognitive 17) · ×1
  • ListNumbering.next_marker (cognitive 17) surfsense_local/backend/worker/ingestion/word_markdown/numbering.py:81 — ListNumbering.next_marker has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (5 pts), boolean chains 2, 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 · rollup.render (cognitive 17) · ×1
  • rollup.render (cognitive 17) plans/community-local/seo/data/b2b/rollup.py:176 — rollup.render has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (6 pts), ternaries 3 (6 pts), if/else 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-store.pump (cognitive 17) · ×1
  • run-store.pump (cognitive 17) surfsense_local/frontend/src/features/chat/runs/run-store.ts:179 — run-store.pump has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pasted-links.pastedLinks (cognitive 17) · ×1
  • pasted-links.pastedLinks (cognitive 17) surfsense_local/frontend/src/features/sources/web/pasted-links.ts:10 — pasted-links.pastedLinks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (5 pts), ternaries 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update-settings.UpdateSettings (cognitive 17) · ×1
  • update-settings.UpdateSettings (cognitive 17) surfsense_local/frontend/src/features/updates/update-settings.tsx:55 — update-settings.UpdateSettings has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 4, if/else 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 · keygen_licences.read_licences (cognitive 16) · ×1
  • keygen_licences.read_licences (cognitive 16) backend/license/cohorts/keygen_licences.py:19 — keygen_licences.read_licences has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (5 pts), ternaries 1 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · scraper._card_details (cognitive 16) · ×1
  • scraper._card_details (cognitive 16) backend/plugins/proprietary/amazon/scraper.py:423 — scraper._card_details has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · url_resolver.resolve_url (cognitive 16) · ×1
  • url_resolver.resolve_url (cognitive 16) backend/plugins/proprietary/amazon/url_resolver.py:67 — url_resolver.resolve_url has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 6, ternaries 2 (4 pts) (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 · scraper._keep_on_site (cognitive 16) · ×1
  • scraper._keep_on_site (cognitive 16) backend/plugins/proprietary/google_search/scraper.py:110 — scraper._keep_on_site has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (4 pts), ternaries 2 (4 pts), loops 1 (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 · parsers._brace_match (cognitive 16) · ×1
  • parsers._brace_match (cognitive 16) backend/plugins/proprietary/indeed/parsers.py:49 — parsers._brace_match has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), boolean chains 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parsers.parse_media (cognitive 16) · ×1
  • parsers.parse_media (cognitive 16) backend/plugins/proprietary/instagram/parsers.py:191 — parsers.parse_media has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9, boolean chains 4, if/else 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 · parsers.parse_product (cognitive 16) · ×1
  • parsers.parse_product (cognitive 16) backend/plugins/proprietary/walmart/parsers.py:211 — parsers.parse_product has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7, boolean chains 6, if/else 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 · scraper._playlist_flow (cognitive 16) · ×1
  • scraper._playlist_flow (cognitive 16) backend/plugins/proprietary/youtube/scraper.py:435 — scraper._playlist_flow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (4 pts), 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 · unused_payload._dropped (cognitive 16) · ×1
  • unused_payload._dropped (cognitive 16) surfsense_local/backend/bundling/unused_payload.py:11 — unused_payload._dropped has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7 (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 · replies.session_turns (cognitive 16) · ×1
  • replies.session_turns (cognitive 16) surfsense_local/backend/modules/agent/agent_threads/replies.py:49 — replies.session_turns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mirror_path._directories (cognitive 16) · ×1
  • mirror_path._directories (cognitive 16) surfsense_local/backend/modules/agent/thread_folder/mirror_path.py:111 — mirror_path._directories has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · analyze_data._found (cognitive 16) · ×1
  • analyze_data._found (cognitive 16) surfsense_local/backend/modules/agent/tool_endpoint/analyze_data.py:181 — analyze_data._found has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 1, loops 1, ternaries 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.
D2 · Cognitive Complexity · quiz_progress._valid_state (cognitive 16) · ×1
  • quiz_progress._valid_state (cognitive 16) surfsense_local/backend/modules/artifacts/quiz_progress.py:49 — quiz_progress._valid_state has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, loops 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 · Workbook._shared_text (cognitive 16) · ×1
  • Workbook._shared_text (cognitive 16) surfsense_local/backend/modules/artifacts/revised_copies/engines/excel_workbook.py:162 — Workbook._shared_text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 3, loops 1 (3 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · instagram._list_items (cognitive 16) · ×1
  • instagram._list_items (cognitive 16) surfsense_local/backend/modules/documents/web_sources/pullers/instagram.py:102 — instagram._list_items has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (9 pts), boolean chains 4, if/else 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · form_fields._pages_of (cognitive 16) · ×1
  • form_fields._pages_of (cognitive 16) surfsense_local/backend/modules/pdf_tools/form_fields.py:86 — form_fields._pages_of has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · header_rules.header_problem (cognitive 16) · ×1
  • header_rules.header_problem (cognitive 16) surfsense_local/backend/modules/plugins/remote/sign_in/headers/header_rules.py:32 — header_rules.header_problem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, 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 · render.render (cognitive 16) · ×1
  • render.render (cognitive 16) surfsense_local/backend/scripts/remote_manifest/render.py:13 — render.render has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (6 pts), if/else 2 (5 pts), ternaries 2 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · palmdoc.palmdoc_decompress (cognitive 16) · ×1
  • palmdoc.palmdoc_decompress (cognitive 16) surfsense_local/backend/worker/ingestion/kindle_books/palmdoc.py:7 — palmdoc.palmdoc_decompress has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · paragraph_breaks._place_captions (cognitive 16) · ×1
  • paragraph_breaks._place_captions (cognitive 16) surfsense_local/backend/worker/ingestion/pdf_text_layer/paragraph_breaks.py:94 — paragraph_breaks._place_captions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _Writer._list (cognitive 16) · ×1
  • _Writer._list (cognitive 16) surfsense_local/backend/worker/studio/office/markdown/word.py:87 — _Writer._list has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), ternaries 4, loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · serve-snapshots.serve (cognitive 16) · ×1
  • serve-snapshots.serve (cognitive 16) surfsense_local/electron/src/main/docx-snapshot/serve-snapshots.ts:112 — serve-snapshots.serve has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 3, boolean chains 2, error handling 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dashboard-page.DashboardPage (cognitive 16) · ×1
  • dashboard-page.DashboardPage (cognitive 16) surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx:632 — dashboard-page.DashboardPage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, ternaries 6, boolean chains 3. Of this number, 8 points are the body's own statements and 8 belong to 7 function items inside it that branch. 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 · privacy-step.PrivacyStep (cognitive 16) · ×1
  • privacy-step.PrivacyStep (cognitive 16) surfsense_local/frontend/src/features/onboarding/privacy-step/privacy-step.tsx:39 — privacy-step.PrivacyStep has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 3, error handling 1, if/else 1 (nesting depth added 2). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · use-plugin-sign-in.usePluginSignIn.poll (cognitive 16) · ×1
  • use-plugin-sign-in.usePluginSignIn.poll (cognitive 16) surfsense_local/frontend/src/features/plugins/sign-in/use-plugin-sign-in.ts:53 — use-plugin-sign-in.usePluginSignIn.poll has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · switches.dictionarySwitches (cognitive 16) · ×1
  • switches.dictionarySwitches (cognitive 16) surfsense_local/runtimes/audiocpp/espeak/switches.mjs:43 — switches.dictionarySwitches has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (4 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · file-card-collections.FileCard (cognitive 16) · ×1
  • file-card-collections.FileCard (cognitive 16) www/app/(home)/_home/home-formats/file-card-collections.tsx:94 — file-card-collections.FileCard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member pair (45 shared lines) · ×1
  • Near-duplicate member pair (45 shared lines) backend/plugins/proprietary/instagram/scraper.py:129 — backend/plugins/proprietary/instagram/scraper.py:129-202 | backend/plugins/proprietary/reddit/scraper.py:78-137 — These two members are variants of one another: 45 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (8 members, 50+ identical tokens) REDACTED:34 — REDACTED:34-87 | REDACTED:38-78 | REDACTED:49-103 | REDACTED:48-93 | REDACTED:46-97 | REDACTED:50-101 | surfsense_local/backend/alembic/versions/0025_source_roots_and_folders.py:67-217 | REDACTED:54-106 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication · Edited copy of a member (76 corresponding lines) · ×1
  • Edited copy of a member (76 corresponding lines) backend/plugins/proprietary/amazon/scraper.py:454 — backend/plugins/proprietary/amazon/scraper.py:454-531 | backend/plugins/proprietary/amazon/scraper.py:537-612 — These two members are one piece of code written twice and then edited apart: 76 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (60 corresponding lines) · ×1
  • Edited copy of a member (60 corresponding lines) surfsense_local/backend/modules/agent/agent_threads/turn.py:130 — surfsense_local/backend/modules/agent/agent_threads/turn.py:130-189 | surfsense_local/backend/modules/agent/engines/claude_code/turn.py:148-207 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) backend/plugins/proprietary/google_maps/scraper.py:233 — backend/plugins/proprietary/google_maps/scraper.py:233-290 | backend/plugins/proprietary/google_maps/scraper.py:323-371 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 47+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 47+ corresponding lines) surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/rows/catalog.py:34 — surfsense_local/backend/modules/llm/catalog/local/engines/audiocpp/rows/catalog.py:34-80 | surfsense_local/backend/modules/llm/catalog/local/engines/onnxruntime/rows.py:36-84 | surfsense_local/backend/modules/llm/catalog/local/engines/sdcpp/rows/catalog.py:27-74 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 47 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) surfsense_local/backend/modules/artifacts/image_edits/service.py:62 — surfsense_local/backend/modules/artifacts/image_edits/service.py:62-107 | surfsense_local/backend/modules/artifacts/studio_documents/service.py:88-133 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×1
  • Edited copy of a member (26 corresponding lines) backend/plugins/proprietary/youtube/scraper.py:210 — backend/plugins/proprietary/youtube/scraper.py:210-235 | backend/plugins/proprietary/youtube/scraper.py:496-529 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 24+ corresponding lines) backend/plugins/proprietary/tiktok/flows/comments.py:32 — backend/plugins/proprietary/tiktok/flows/comments.py:32-55 | backend/plugins/proprietary/tiktok/flows/listing.py:33-56 | backend/plugins/proprietary/tiktok/flows/user_search.py:31-55 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) surfsense_local/backend/modules/llm/resolution.py:105 — surfsense_local/backend/modules/llm/resolution.py:105-131 | surfsense_local/backend/modules/llm/resolution.py:135-156 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×1
  • Edited copy of a member (23 corresponding lines) backend/plugins/proprietary/walmart/scraper.py:366 — backend/plugins/proprietary/walmart/scraper.py:366-390 | backend/plugins/proprietary/walmart/scraper.py:522-544 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 28+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 28+ corresponding lines) surfsense_local/backend/modules/documents/web_sources/pullers/amazon.py:47 — surfsense_local/backend/modules/documents/web_sources/pullers/amazon.py:47-85 | surfsense_local/backend/modules/documents/web_sources/pullers/indeed.py:33-60 | surfsense_local/backend/modules/documents/web_sources/pullers/walmart.py:56-87 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×1
  • Edited copy of a member (18 corresponding lines) backend/plugins/proprietary/scraping/captcha/solvers.py:62 — backend/plugins/proprietary/scraping/captcha/solvers.py:62-79 | backend/plugins/proprietary/scraping/captcha/solvers.py:174-191 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×1
  • Edited copy of a member (19 corresponding lines) backend/license/records.py:84 — backend/license/records.py:84-103 | backend/license/records.py:107-125 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (7 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (7 members, 14+ corresponding lines) backend/plugins/proprietary/google_maps/reviews.py:277 — backend/plugins/proprietary/google_maps/reviews.py:277-291 | backend/plugins/proprietary/google_maps/scraper.py:527-543 | backend/plugins/proprietary/google_search/scraper.py:412-431 | backend/plugins/proprietary/instagram/scraper.py:532-545 | backend/plugins/proprietary/reddit/scraper.py:493-508 | backend/plugins/proprietary/walmart/scraper.py:400-414 | backend/plugins/proprietary/walmart/scraper.py:554-568 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 10+ corresponding lines) surfsense_local/backend/modules/documents/web_sources/background_pull/pull.py:51 — surfsense_local/backend/modules/documents/web_sources/background_pull/pull.py:51-60 | surfsense_local/backend/worker/ingestion/pipeline.py:32-47 | surfsense_local/backend/worker/studio/job.py:82-94 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×1
  • Edited copy of a member (10 corresponding lines) surfsense_local/backend/modules/agent/tool_endpoint/read_document.py:138 — surfsense_local/backend/modules/agent/tool_endpoint/read_document.py:138-148 | surfsense_local/backend/modules/agent/tool_endpoint/read_revised_copy.py:150-159 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×1
  • Edited copy of a member (12 corresponding lines) backend/plugins/proprietary/youtube/scraper.py:597 — backend/plugins/proprietary/youtube/scraper.py:597-610 | backend/plugins/proprietary/youtube/comments.py:253-264 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 9+ corresponding lines) surfsense_local/backend/modules/documents/web_sources/pullers/google_maps.py:143 — surfsense_local/backend/modules/documents/web_sources/pullers/google_maps.py:143-151 | surfsense_local/backend/modules/documents/web_sources/pullers/indeed.py:71-79 | surfsense_local/backend/modules/documents/web_sources/pullers/reddit.py:130-138 | surfsense_local/backend/modules/documents/web_sources/pullers/youtube.py:113-121 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) surfsense_local/backend/modules/llm/catalog/local/install/download.py:83 — surfsense_local/backend/modules/llm/catalog/local/install/download.py:83-89 | surfsense_local/backend/worker/ingestion/docling_batches/checkpoint.py:85-91 | surfsense_local/backend/worker/ingestion/pdf_reading/ocr_kept.py:62-66 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×1
  • Edited copy of a member (3 corresponding lines) surfsense_local/backend/modules/runtime_packs/office/soffice/convert.py:161 — surfsense_local/backend/modules/runtime_packs/office/soffice/convert.py:161-163 | surfsense_local/backend/worker/document_script/run.py:175-180 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 3+ corresponding lines) surfsense_local/backend/modules/agent/tool_endpoint/render_document.py:334 — surfsense_local/backend/modules/agent/tool_endpoint/render_document.py:334-336 | surfsense_local/backend/modules/agent/tool_endpoint/revised_result.py:127-129 | surfsense_local/backend/modules/agent/tool_endpoint/save_page.py:258-260 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (49–51 lines × 2) · ×1
  • Duplicated block (49–51 lines × 2) surfsense_local/backend/bundling/api_inputs.py:37 — surfsense_local/backend/bundling/api_inputs.py:37-85 | surfsense_local/backend/bundling/worker_inputs.py:27-77 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) backend/plugins/proprietary/tiktok/session/stealth.py:119 — backend/plugins/proprietary/tiktok/session/stealth.py:119-153 | backend/plugins/proprietary/web_crawl/stealth.py:119-153 — before extracting anything, compare `backend/plugins/proprietary/tiktok/session/stealth.py` and `backend/plugins/proprietary/web_crawl/stealth.py` as WHOLE FILES: 88% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (33–34 lines × 2) · ×1
  • Duplicated block (33–34 lines × 2) surfsense_local/backend/modules/artifacts/image_edits/service.py:75 — surfsense_local/backend/modules/artifacts/image_edits/service.py:75-107 | surfsense_local/backend/modules/artifacts/studio_documents/service.py:100-133 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `surfsense_local/backend/modules/artifacts/image_edits/service.py:72` calls `version_of`, `as_metadata` and `surfsense_local/backend/modules/artifacts/studio_documents/service.py:98` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (24–26 lines × 2) · ×1
  • Duplicated block (24–26 lines × 2) REDACTED:55 — REDACTED:55-78 | REDACTED:78-103 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:55` 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 (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) backend/plugins/proprietary/amazon/scraper.py:508 — backend/plugins/proprietary/amazon/scraper.py:508-531 | backend/plugins/proprietary/amazon/scraper.py:588-612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `backend/plugins/proprietary/amazon/scraper.py:588` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `backend/plugins/proprietary/amazon/scraper.py:508` calls `_new_cards` and `backend/plugins/proprietary/amazon/scraper.py:588` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) backend/plugins/proprietary/amazon/server.py:42 — backend/plugins/proprietary/amazon/server.py:42-64 | backend/plugins/proprietary/walmart/server.py:52-76 — 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 `backend/plugins/proprietary/amazon/server.py: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. 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 (23–24 lines × 3) · ×1
  • Duplicated block (23–24 lines × 3) REDACTED:74 — REDACTED:74-97 | REDACTED:78-101 | REDACTED:84-106 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 110 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:74` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:83` calls `Column`, `JSON`, `DateTime` and `REDACTED:74` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) backend/plugins/proprietary/google_maps/parsers.py:50 — backend/plugins/proprietary/google_maps/parsers.py:50-71 | backend/plugins/proprietary/indeed/parsers.py:52-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) surfsense_local/backend/modules/plugins/lists/registry/routes.py:88 — surfsense_local/backend/modules/plugins/lists/registry/routes.py:88-108 | surfsense_local/backend/modules/plugins/routes.py:251-271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (13–20 lines × 2) · ×1
  • Duplicated block (13–20 lines × 2) backend/plugins/proprietary/instagram/server.py:151 — backend/plugins/proprietary/instagram/server.py:151-170 | backend/plugins/proprietary/instagram/server.py:227-239 — both copies are in the same file, so extract the 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 `backend/plugins/proprietary/instagram/server.py:151` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `backend/plugins/proprietary/instagram/server.py:242` calls `join` and `backend/plugins/proprietary/instagram/server.py:171` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) backend/plugins/proprietary/google_maps/scraper.py:255 — backend/plugins/proprietary/google_maps/scraper.py:255-273 | backend/plugins/proprietary/google_maps/scraper.py:336-354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15–19 lines × 2) · ×1
  • Duplicated block (15–19 lines × 2) backend/plugins/proprietary/instagram/scraper.py:129 — backend/plugins/proprietary/instagram/scraper.py:129-147 | backend/plugins/proprietary/reddit/scraper.py:78-92 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) surfsense_local/backend/alembic/versions/0025_source_roots_and_folders.py:98 — surfsense_local/backend/alembic/versions/0025_source_roots_and_folders.py:98-116 | surfsense_local/backend/alembic/versions/0025_source_roots_and_folders.py:168-185 — both copies are in the same file, so extract the 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 `surfsense_local/backend/alembic/versions/0025_source_roots_and_folders.py: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `surfsense_local/backend/alembic/versions/0025_source_roots_and_folders.py:167` calls `Column`, `DateTime` and `surfsense_local/backend/alembic/versions/0025_source_roots_and_folders.py:98` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) REDACTED:67 — REDACTED:67-82 | REDACTED:63-78 | REDACTED:67-82 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:79` calls `CheckConstraint`, `f` and `REDACTED:83` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14–15 lines × 5) · ×1
  • Duplicated block (14–15 lines × 5) REDACTED:56 — REDACTED:56-70 | REDACTED:80-94 | REDACTED:78-91 | REDACTED:82-95 | REDACTED:87-100 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:56` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:77` calls `f` and `REDACTED:56` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 4) · ×1
  • Duplicated block (13 lines × 4) REDACTED:66 — REDACTED:66-78 | REDACTED:62-74 | REDACTED:66-78 | REDACTED:70-82 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:83` calls `Column`, `JSON` and `REDACTED:79` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) backend/plugins/proprietary/instagram/scraper.py:180 — backend/plugins/proprietary/instagram/scraper.py:180-192 | backend/plugins/proprietary/reddit/scraper.py:119-130 — 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 `backend/plugins/proprietary/instagram/scraper.py:180` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×1
  • Duplicated block (13 lines × 2) surfsense_local/backend/modules/agent/agent_threads/turn.py:338 — surfsense_local/backend/modules/agent/agent_threads/turn.py:338-351 | surfsense_local/backend/modules/agent/engines/claude_code/turn.py:356-368 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) REDACTED:41 — REDACTED:41-52 | REDACTED:52-63 | surfsense_local/backend/alembic/versions/0025_source_roots_and_folders.py:71-82 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×1
  • Duplicated block (11 lines × 2) surfsense_local/backend/modules/llm/catalog/local/install_jobs/router.py:103 — surfsense_local/backend/modules/llm/catalog/local/install_jobs/router.py:103-113 | surfsense_local/backend/modules/runtime_packs/office/router.py:63-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9–12 lines × 5) · ×1
  • Duplicated block (9–12 lines × 5) REDACTED:63 — REDACTED:63-74 | REDACTED:56-64 | REDACTED:59-70 | REDACTED:63-74 | REDACTED:67-78 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:63` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) REDACTED:46 — REDACTED:46-54 | REDACTED:57-65 | REDACTED:53-61 | REDACTED:57-65 | REDACTED:61-69 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:46` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×1
  • Duplicated block (9 lines × 3) surfsense_local/backend/alembic/versions/0001_initial_schema.py:105 — surfsense_local/backend/alembic/versions/0001_initial_schema.py:105-113 | surfsense_local/backend/alembic/versions/0001_initial_schema.py:152-160 | surfsense_local/backend/alembic/versions/0025_source_roots_and_folders.py:191-200 — 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 `surfsense_local/backend/alembic/versions/0001_initial_schema.py:105` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `surfsense_local/backend/alembic/versions/0025_source_roots_and_folders.py:201` calls `create_index` and `surfsense_local/backend/alembic/versions/0001_initial_schema.py:116` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×1
  • Duplicated block (8 lines × 2) surfsense_local/backend/worker/studio/content/flashcards/pipeline.py:47 — surfsense_local/backend/worker/studio/content/flashcards/pipeline.py:47-54 | surfsense_local/backend/worker/studio/content/quiz/pipeline.py:64-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. 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 (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) surfsense_local/backend/alembic/versions/0001_initial_schema.py:122 — surfsense_local/backend/alembic/versions/0001_initial_schema.py:122-128 | surfsense_local/backend/alembic/versions/0001_initial_schema.py:183-189 | surfsense_local/backend/alembic/versions/0025_source_roots_and_folders.py:131-137 — 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 `surfsense_local/backend/alembic/versions/0001_initial_schema.py:122` 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) · ×1
  • Duplicated block (6 lines × 3) surfsense_local/backend/alembic/versions/0001_initial_schema.py:228 — surfsense_local/backend/alembic/versions/0001_initial_schema.py:228-234 | surfsense_local/backend/alembic/versions/0001_initial_schema.py:237-243 | REDACTED:94-99 — 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 `surfsense_local/backend/alembic/versions/0001_initial_schema.py:228` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `surfsense_local/backend/alembic/versions/0001_initial_schema.py:226` calls `Column`, `_enum` and `surfsense_local/backend/alembic/versions/0001_initial_schema.py:235` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (5 lines × 7) · ×1
  • Duplicated block (5 lines × 7) REDACTED:56 — REDACTED:56-60 | REDACTED:49-54 | REDACTED:60-65 | REDACTED:54-58 | REDACTED:56-61 | REDACTED:60-65 | REDACTED:64-69 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:56` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×1
  • Duplicated block (8 lines × 3) backend/plugins/proprietary/indeed/parsers.py:171 — backend/plugins/proprietary/indeed/parsers.py:171-178 | backend/plugins/proprietary/instagram/parsers.py:45-52 | backend/plugins/proprietary/reddit/parsers.py:23-30 — 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.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: surfsense-plugin-manifest — surfsense-plugin-manifest: abstractness 0.07, instability 0.00, distance 0.93 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
D6 · Cohesion (LCOM4) · Low cohesion · ×1
  • Low cohesion: ClaudeCodeEngine (LCOM4 4) surfsense_local/backend/modules/agent/engines/claude_code/engine.py:48 — ClaudeCodeEngine's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the node:test suite in surfsense_local/headless/ ran and not one test passed (throw new ERR_UNKNOWN_FILE_EXTENSION(ext, filepath);), so the coverage would describe the failed run, not the code. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
P3 · Security & performance tooling · SAST runs, but gates no merge · ×1
  • SAST runs, but gates no merge — `REDACTED` run(s) a static-analysis scan, but no workflow that runs one is triggered by a pull request (or a merge queue, or an unfiltered push) — the scan fires on a schedule or a manual dispatch only. A vulnerable change therefore merges clean and is reported on the next scheduled run, by which time it is on the default branch and the only remedy is a follow-up fix. Add the pull-request trigger to the workflow that runs the scan so the finding arrives before the merge rather than after it.
P5 · DR & Backup · No DR/backup evidence · ×1
  • No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
R10 · Code Duplication · Duplication concentrated across 21 sibling directories (77 clone groups) · ×1
  • Duplication concentrated across 21 sibling directories (77 clone groups) surfsense_local/frontend/src/features/file-viewers/pdf-viewer.tsx:1 — 77 duplicated blocks under surfsense_local/frontend/src/features/ have copies in at least two of the sibling directories about, access, chat, dashboard, dictation, egress (+15 more sibling(s) not listed) — 31 of them are reported below, and 46 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 77 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 77 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 77 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 15 sibling directories (25 clone groups) · ×1
  • Duplication concentrated across 15 sibling directories (25 clone groups) www/app/(home)/external-mcp-connectors/page.tsx:203 — 25 duplicated blocks under www/app/(home)/ have copies in at least two of the sibling directories _home, announcements, blog, changelog, contact, downloads (+9 more sibling(s) not listed) — 16 of them are reported below, and 9 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 25 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 25 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 25 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 9 sibling directories (14 clone groups) · ×1
  • Duplication concentrated across 9 sibling directories (14 clone groups) surfsense_local/frontend/src/features/plugins/connection/edit-connection-button.tsx:49 — 14 duplicated blocks under surfsense_local/frontend/src/features/plugins/ have copies in at least two of the sibling directories add-custom, browse, connection, details, in-thread, public-page (+3 more sibling(s) not listed) — 11 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 14 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (8 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (8 clone groups) www/app/(home)/_home/home-compare/home-compare.tsx:13 — 8 of the duplicated blocks reported below have copies in at least two of the sibling directories home-compare, home-confidential, home-features, home-formats, home-pillars under www/app/(home)/_home/. That concentration is one structural fact, not 8 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 8 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 4 sibling directories (7 clone groups) · ×1
  • Duplication concentrated across 4 sibling directories (7 clone groups) surfsense_local/frontend/src/features/models/local/audio/download-audio-models.tsx:1 — 7 duplicated blocks under surfsense_local/frontend/src/features/models/local/ have copies in at least two of the sibling directories audio, chat, image, transcription — 5 of them are reported below, and 2 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 7 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 3 sibling directories (6 clone groups) · ×1
  • Duplication concentrated across 3 sibling directories (6 clone groups) surfsense_local/runtimes/audiocpp/stage.mjs:25 — 6 of the duplicated blocks reported below have copies in at least two of the sibling directories audiocpp, opencode, sdcpp under surfsense_local/runtimes/. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (204 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (204 matched lines × 2 locations) surfsense_local/frontend/src/components/ui/context-menu.tsx:36 — surfsense_local/frontend/src/components/ui/context-menu.tsx:36 · surfsense_local/frontend/src/components/ui/dropdown-menu.tsx:27 — the two spans are one implementation copied and then locally edited — 708 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Wholesale file copy (181 identical lines × 2 files) · ×1
  • Wholesale file copy (181 identical lines × 2 files) surfsense_local/frontend/src/features/file-viewers/pdf-viewer.tsx:1 — surfsense_local/frontend/src/features/file-viewers/pdf-viewer.tsx:1 · surfsense_local/frontend/src/features/studio/viewers/pdf-viewer.tsx:1 — these 2 files are line-for-line copies of one another — 181 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication · Duplicated block with local edits (178 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (178 matched lines × 2 locations) surfsense_local/frontend/src/features/sources/tree/document-row.tsx:202 — surfsense_local/frontend/src/features/sources/tree/document-row.tsx:202 · surfsense_local/frontend/src/features/studio/artifact-list.tsx:188 — the two spans are one implementation copied and then locally edited — 598 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (150 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (150 matched lines × 2 locations) surfsense_local/frontend/src/features/plugins/connection/edit-connection-button.tsx:49 — surfsense_local/frontend/src/features/plugins/connection/edit-connection-button.tsx:49 · surfsense_local/frontend/src/features/plugins/details/edit-headers-button.tsx:36 — the two spans are one implementation copied and then locally edited — 659 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Wholesale file copy (123 identical lines × 2 files) · ×1
  • Wholesale file copy (123 identical lines × 2 files) surfsense_local/frontend/src/features/models/local/audio/download-audio-models.tsx:1 — surfsense_local/frontend/src/features/models/local/audio/download-audio-models.tsx:1 · surfsense_local/frontend/src/features/models/local/transcription/download-speech-models.tsx:1 — these 2 files are line-for-line copies of one another — 123 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication · Duplicated block with local edits (105 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (105 matched lines × 2 locations) surfsense_local/frontend/src/features/models/local/chat/download-chat-models.tsx:23 — surfsense_local/frontend/src/features/models/local/chat/download-chat-models.tsx:23 · surfsense_local/frontend/src/features/models/local/image/download-image-models.tsx:37 — the two spans are one implementation copied and then locally edited — 590 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (89 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (89 matched lines × 2 locations) surfsense_local/frontend/src/features/plugins/browse/registry-headers-dialog.tsx:26 — surfsense_local/frontend/src/features/plugins/browse/registry-headers-dialog.tsx:26 · surfsense_local/frontend/src/features/plugins/browse/registry-key-dialog.tsx:21 — the two spans are one implementation copied and then locally edited — 430 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (85 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (85 matched lines × 2 locations) www/app/(home)/pricing/individual/individual-sections.tsx:30 — www/app/(home)/pricing/individual/individual-sections.tsx:30 · www/app/(home)/pricing/pricing-sections.tsx:51 — the two spans are one implementation copied and then locally edited — 517 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (82 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (82 matched lines × 2 locations) surfsense_local/frontend/src/features/plugins/browse/registry-key-dialog.tsx:21 — surfsense_local/frontend/src/features/plugins/browse/registry-key-dialog.tsx:21 · surfsense_local/frontend/src/features/plugins/details/replace-key-button.tsx:23 — the two spans are one implementation copied and then locally edited — 395 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (73 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (73 matched lines × 2 locations) surfsense_local/frontend/src/features/models/remote/connections/chatgpt/chatgpt-option.tsx:21 — surfsense_local/frontend/src/features/models/remote/connections/chatgpt/chatgpt-option.tsx:21 · surfsense_local/frontend/src/features/models/remote/connections/claude/claude-option.tsx:22 — the two spans are one implementation copied and then locally edited — 307 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (71 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (71 matched lines × 2 locations) surfsense_local/frontend/src/features/studio/viewers/flashcards/flashcards-viewer.tsx:58 — surfsense_local/frontend/src/features/studio/viewers/flashcards/flashcards-viewer.tsx:58 · surfsense_local/frontend/src/features/studio/viewers/quiz/quiz-viewer.tsx:50 — the two spans are one implementation copied and then locally edited — 355 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (70 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (70 matched lines × 2 locations) surfsense_local/runtimes/audiocpp/stage.mjs:25 — surfsense_local/runtimes/audiocpp/stage.mjs:25 · surfsense_local/runtimes/sdcpp/stage.mjs:22 — the two spans are one implementation copied and then locally edited — 535 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (67 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (67 matched lines × 2 locations) surfsense_local/frontend/src/features/sources/rename-source-dialog.tsx:26 — surfsense_local/frontend/src/features/sources/rename-source-dialog.tsx:26 · surfsense_local/frontend/src/features/sources/tree/folder-name-dialog.tsx:30 — the two spans are one implementation copied and then locally edited — 357 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (54 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (54 matched lines × 2 locations) www/app/(home)/license/page.tsx:37 — www/app/(home)/license/page.tsx:37 · www/app/(home)/license/success/page.tsx:19 — the two spans are one implementation copied and then locally edited — 357 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (50 lines × 2 locations) · ×1
  • Duplicated block (50 lines × 2 locations) www/app/(home)/external-mcp-connectors/page.tsx:203 — www/app/(home)/external-mcp-connectors/page.tsx:203 · www/app/(home)/mcp-server/page.tsx:238 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block with local edits (46 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (46 matched lines × 2 locations) surfsense_local/frontend/src/features/studio/viewers/html-viewer.tsx:12 — surfsense_local/frontend/src/features/studio/viewers/html-viewer.tsx:12 · surfsense_local/frontend/src/features/studio/viewers/xlsx-viewer.tsx:94 — the two spans are one implementation copied and then locally edited — 226 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (45 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (45 matched lines × 2 locations) surfsense_local/frontend/src/features/access/setup-screen.tsx:52 — surfsense_local/frontend/src/features/access/setup-screen.tsx:52 · surfsense_local/frontend/src/features/access/sign-in-screen.tsx:57 — the two spans are one implementation copied and then locally edited — 228 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (44 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (44 matched lines × 2 locations) surfsense_local/frontend/src/features/plugins/add-custom/add-plugin-dialog.tsx:147 — surfsense_local/frontend/src/features/plugins/add-custom/add-plugin-dialog.tsx:147 · surfsense_local/frontend/src/features/plugins/sign-in/own-app/own-app-fields.tsx:111 — the two spans are one implementation copied and then locally edited — 187 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (43 lines × 2 locations) · ×1
  • Duplicated block (43 lines × 2 locations) www/app/(home)/external-mcp-connectors/page.tsx:310 — www/app/(home)/external-mcp-connectors/page.tsx:310 · www/app/(home)/mcp-server/page.tsx:358 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (35 lines × 2 locations) · ×1
  • Duplicated block (35 lines × 2 locations) surfsense_local/sidecars/audiocpp-transcription.ts:18 — surfsense_local/sidecars/audiocpp-transcription.ts:18 · surfsense_local/sidecars/audiocpp.ts:51 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (33 lines × 2 locations) · ×1
  • Duplicated block (33 lines × 2 locations) surfsense_local/frontend/src/features/plugins/details/disconnect-plugin-button.tsx:55 — surfsense_local/frontend/src/features/plugins/details/disconnect-plugin-button.tsx:55 · surfsense_local/frontend/src/features/plugins/details/remove-plugin-dialog.tsx:36 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (30 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (30 matched lines × 2 locations) surfsense_local/frontend/src/features/models/your-models/use-audio-models.ts:11 — surfsense_local/frontend/src/features/models/your-models/use-audio-models.ts:11 · surfsense_local/frontend/src/features/models/your-models/use-speech-models.ts:10 — the two spans are one implementation copied and then locally edited — 135 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (27 lines × 3 locations) · ×1
  • Duplicated block (27 lines × 3 locations) surfsense_local/frontend/src/features/file-viewers/pdf-viewer.tsx:242 — surfsense_local/frontend/src/features/file-viewers/pdf-viewer.tsx:242 · surfsense_local/frontend/src/features/studio/viewers/docx-viewer.tsx:271 · surfsense_local/frontend/src/features/studio/viewers/pdf-viewer.tsx:255 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (27 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (27 matched lines × 2 locations) www/features/license/license-forms.tsx:157 — www/features/license/license-forms.tsx:157 · www/features/license/license-forms.tsx:212 — the two spans are one implementation copied and then locally edited — 240 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (26 lines × 2 locations) · ×1
  • Duplicated block (26 lines × 2 locations) surfsense_local/sidecars/watch-audio-models.ts:15 — surfsense_local/sidecars/watch-audio-models.ts:15 · surfsense_local/sidecars/watch-generation-preset.ts:21 — 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.
R10 · Code Duplication · Duplicated block (25 lines × 3 locations) · ×1
  • Duplicated block (25 lines × 3 locations) surfsense_local/frontend/src/features/plugins/connection/edit-connection-button.tsx:59 — surfsense_local/frontend/src/features/plugins/connection/edit-connection-button.tsx:59 · surfsense_local/frontend/src/features/plugins/details/edit-headers-button.tsx:49 · surfsense_local/frontend/src/features/plugins/details/replace-key-button.tsx:35 — the 3 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R2 · Cyclomatic Complexity · Complex function stepLabel (cyclomatic 59, cognitive 62) · ×1
  • Complex function stepLabel (cyclomatic 59, cognitive 62) REDACTED:44 — stepLabel has cyclomatic complexity 59 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 48, cognitive 66) · ×1
  • Complex function (anonymous) (cyclomatic 48, cognitive 66) surfsense_local/frontend/src/features/plugins/plugins-settings.test.tsx:181 — (anonymous) has cyclomatic complexity 48 and cognitive complexity 66; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 47, cognitive 54) · ×1
  • Complex function (anonymous) (cyclomatic 47, cognitive 54) surfsense_local/frontend/src/features/onboarding/onboarding-page.test.tsx:170 — (anonymous) has cyclomatic complexity 47 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function DocumentRow (cyclomatic 42, cognitive 41) · ×1
  • Complex function DocumentRow (cyclomatic 42, cognitive 41) surfsense_local/frontend/src/features/sources/tree/document-row.tsx:53 — DocumentRow has cyclomatic complexity 42 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 35, cognitive 39) · ×1
  • Complex function (anonymous) (cyclomatic 35, cognitive 39) surfsense_local/frontend/src/features/chat/use-chat-runtime.ts:590 — (anonymous) has cyclomatic complexity 35 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ArtifactPanel (cyclomatic 33, cognitive 26) · ×1
  • Complex function ArtifactPanel (cyclomatic 33, cognitive 26) surfsense_local/frontend/src/features/studio/artifact-panel.tsx:70 — ArtifactPanel has cyclomatic complexity 33 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ArtifactRow (cyclomatic 32, cognitive 31) · ×1
  • Complex function ArtifactRow (cyclomatic 32, cognitive 31) surfsense_local/frontend/src/features/studio/artifact-list.tsx:129 — ArtifactRow has cyclomatic complexity 32 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function SourcesPanel (cyclomatic 30, cognitive 29) · ×1
  • Complex function SourcesPanel (cyclomatic 30, cognitive 29) surfsense_local/frontend/src/features/sources/sources-panel.tsx:79 — SourcesPanel has cyclomatic complexity 30 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ChatComposer (cyclomatic 30, cognitive 28) · ×1
  • Complex function ChatComposer (cyclomatic 30, cognitive 28) surfsense_local/frontend/src/features/chat/chat-composer.tsx:154 — ChatComposer has cyclomatic complexity 30 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ConnectionForm (cyclomatic 29, cognitive 25) · ×1
  • Complex function ConnectionForm (cyclomatic 29, cognitive 25) surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx:96 — ConnectionForm has cyclomatic complexity 29 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function PluginSearchResults (cyclomatic 27, cognitive 24) · ×1
  • Complex function PluginSearchResults (cyclomatic 27, cognitive 24) surfsense_local/frontend/src/features/plugins/search/plugin-search-results.tsx:51 — PluginSearchResults has cyclomatic complexity 27 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function FileCard (cyclomatic 24, cognitive 16) · ×1
  • Complex function FileCard (cyclomatic 24, cognitive 16) www/app/(home)/_home/home-formats/file-card-collections.tsx:94 — FileCard has cyclomatic complexity 24 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function parseStudyText (cyclomatic 22, cognitive 37) · ×1
  • Complex function parseStudyText (cyclomatic 22, cognitive 37) surfsense_local/frontend/src/features/studio/viewers/parse-study-text.ts:34 — parseStudyText has cyclomatic complexity 22 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function onRowKeyDown (cyclomatic 22, cognitive 20) · ×1
  • Complex function onRowKeyDown (cyclomatic 22, cognitive 20) surfsense_local/frontend/src/features/sources/tree/source-tree.tsx:143 — onRowKeyDown has cyclomatic complexity 22 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function listingFromEntry (cyclomatic 22, cognitive 17) · ×1
  • Complex function listingFromEntry (cyclomatic 22, cognitive 17) www/app/(home)/plugins/plugin-listing.ts:71 — listingFromEntry has cyclomatic complexity 22 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function PluginActionsMenu (cyclomatic 22, cognitive 16) · ×1
  • Complex function PluginActionsMenu (cyclomatic 22, cognitive 16) surfsense_local/frontend/src/features/plugins/details/plugin-actions-menu.tsx:40 — PluginActionsMenu has cyclomatic complexity 22 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 21, cognitive 27) · ×1
  • Complex function (anonymous) (cyclomatic 21, cognitive 27) surfsense_local/frontend/src/features/sources/use-sources.ts:395 — (anonymous) has cyclomatic complexity 21 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function main (cyclomatic 21, cognitive 26) · ×1
  • Complex function main (cyclomatic 21, cognitive 26) surfsense_local/runtimes/audiocpp/stage.mjs:69 — main has cyclomatic complexity 21 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 21, cognitive 21) · ×1
  • Complex function (anonymous) (cyclomatic 21, cognitive 21) surfsense_local/frontend/src/features/sources/tree/source-tree.test.tsx:69 — (anonymous) has cyclomatic complexity 21 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ReplyHeader (cyclomatic 21, cognitive 20) · ×1
  • Complex function ReplyHeader (cyclomatic 21, cognitive 20) surfsense_local/frontend/src/features/chat/reply-thinking.tsx:160 — ReplyHeader has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ServerModels (cyclomatic 21, cognitive 20) · ×1
  • Complex function ServerModels (cyclomatic 21, cognitive 20) surfsense_local/frontend/src/features/models/remote/models/server-models.tsx:77 — ServerModels has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function cellText (cyclomatic 20, cognitive 21) · ×1
  • Complex function cellText (cyclomatic 20, cognitive 21) surfsense_local/frontend/src/features/studio/viewers/parse-workbook.ts:36 — cellText has cyclomatic complexity 20 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function toRuntimeMessage (cyclomatic 20, cognitive 19) · ×1
  • Complex function toRuntimeMessage (cyclomatic 20, cognitive 19) surfsense_local/frontend/src/features/chat/thread-messages.ts:85 — toRuntimeMessage has cyclomatic complexity 20 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function LicenseSettings (cyclomatic 20, cognitive 19) · ×1
  • Complex function LicenseSettings (cyclomatic 20, cognitive 19) surfsense_local/frontend/src/features/license/license-settings.tsx:264 — LicenseSettings has cyclomatic complexity 20 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function RefineBox (cyclomatic 20, cognitive 17) · ×1
  • Complex function RefineBox (cyclomatic 20, cognitive 17) surfsense_local/frontend/src/features/studio/refine-box.tsx:37 — RefineBox has cyclomatic complexity 20 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function readPolicy (cyclomatic 19, cognitive 19) · ×1
  • Complex function readPolicy (cyclomatic 19, cognitive 19) surfsense_local/electron/src/main/admin-policy/read-policy.ts:52 — readPolicy has cyclomatic complexity 19 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function AddSourcesMenu (cyclomatic 19, cognitive 18) · ×1
  • Complex function AddSourcesMenu (cyclomatic 19, cognitive 18) surfsense_local/frontend/src/features/sources/add-sources-menu.tsx:39 — AddSourcesMenu has cyclomatic complexity 19 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function WorkspaceDashboard (cyclomatic 18, cognitive 17) · ×1
  • Complex function WorkspaceDashboard (cyclomatic 18, cognitive 17) surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx:94 — WorkspaceDashboard has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function SettingsDialog (cyclomatic 18, cognitive 17) · ×1
  • Complex function SettingsDialog (cyclomatic 18, cognitive 17) surfsense_local/frontend/src/features/settings/settings-dialog.tsx:329 — SettingsDialog has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function AddFromWebDialog (cyclomatic 18, cognitive 17) · ×1
  • Complex function AddFromWebDialog (cyclomatic 18, cognitive 17) surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx:54 — AddFromWebDialog has cyclomatic complexity 18 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 18, cognitive 16) · ×1
  • Complex function (anonymous) (cyclomatic 18, cognitive 16) surfsense_local/frontend/src/features/chat/chats-dialog.tsx:415 — (anonymous) has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ModelSlotSettings (cyclomatic 18, cognitive 16) · ×1
  • Complex function ModelSlotSettings (cyclomatic 18, cognitive 16) surfsense_local/frontend/src/features/settings/models/model-slot-settings.tsx:67 — ModelSlotSettings has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function Composer (cyclomatic 18, cognitive 16) · ×1
  • Complex function Composer (cyclomatic 18, cognitive 16) surfsense_local/frontend/src/features/studio/studio-panel.tsx:137 — Composer has cyclomatic complexity 18 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function pluginStatus (cyclomatic 18, cognitive 15) · ×1
  • Complex function pluginStatus (cyclomatic 18, cognitive 15) surfsense_local/frontend/src/features/plugins/yours/plugin-status.ts:15 — pluginStatus has cyclomatic complexity 18 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 17, cognitive 18) · ×1
  • Complex function (anonymous) (cyclomatic 17, cognitive 18) surfsense_local/headless/access/server.ts:135 — (anonymous) has cyclomatic complexity 17 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function UpdateSettings (cyclomatic 17, cognitive 15) · ×1
  • Complex function UpdateSettings (cyclomatic 17, cognitive 15) surfsense_local/frontend/src/features/updates/update-settings.tsx:55 — UpdateSettings has cyclomatic complexity 17 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function shadePassages (cyclomatic 16, cognitive 24) · ×1
  • Complex function shadePassages (cyclomatic 16, cognitive 24) surfsense_local/frontend/src/features/studio/viewers/docx-comments.ts:114 — shadePassages has cyclomatic complexity 16 and cognitive complexity 24; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 16, cognitive 18) · ×1
  • Complex function (anonymous) (cyclomatic 16, cognitive 18) surfsense_local/frontend/src/features/chat/use-chat-runtime.test.tsx:104 — (anonymous) has cyclomatic complexity 16 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function walk (cyclomatic 16, cognitive 17) · ×1
  • Complex function walk (cyclomatic 16, cognitive 17) surfsense_local/frontend/src/features/sources/tree/scope-state.ts:161 — walk has cyclomatic complexity 16 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ModelCard (cyclomatic 16, cognitive 15) · ×1
  • Complex function ModelCard (cyclomatic 16, cognitive 15) surfsense_local/frontend/src/features/models/local/chat/model-card.tsx:34 — ModelCard has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · surfsense_local/frontend/src/features/chat/use-chat-runtime.ts · ×1
  • surfsense_local/frontend/src/features/chat/use-chat-runtime.ts: 959 lines of code surfsense_local/frontend/src/features/chat/use-chat-runtime.ts:1 — surfsense_local/frontend/src/features/chat/use-chat-runtime.ts has 959 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx · ×1
  • surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx: 839 lines of code surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx:1 — surfsense_local/frontend/src/features/dashboard/dashboard-page.tsx has 839 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/studio/artifact-list.tsx · ×1
  • surfsense_local/frontend/src/features/studio/artifact-list.tsx: 808 lines of code surfsense_local/frontend/src/features/studio/artifact-list.tsx:1 — surfsense_local/frontend/src/features/studio/artifact-list.tsx has 808 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/sources/use-sources.ts · ×1
  • surfsense_local/frontend/src/features/sources/use-sources.ts: 679 lines of code surfsense_local/frontend/src/features/sources/use-sources.ts:1 — surfsense_local/frontend/src/features/sources/use-sources.ts has 679 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/sources/sources-panel.tsx · ×1
  • surfsense_local/frontend/src/features/sources/sources-panel.tsx: 608 lines of code surfsense_local/frontend/src/features/sources/sources-panel.tsx:1 — surfsense_local/frontend/src/features/sources/sources-panel.tsx has 608 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/chat/chats-dialog.tsx · ×1
  • surfsense_local/frontend/src/features/chat/chats-dialog.tsx: 605 lines of code surfsense_local/frontend/src/features/chat/chats-dialog.tsx:1 — surfsense_local/frontend/src/features/chat/chats-dialog.tsx has 605 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · www/app/(home)/privacy/page.tsx · ×1
  • www/app/(home)/privacy/page.tsx: 537 lines of code www/app/(home)/privacy/page.tsx:1 — www/app/(home)/privacy/page.tsx has 537 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 531 lines of code REDACTED:1 — REDACTED has 531 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx · ×1
  • surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx: 520 lines of code surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx:1 — surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx has 520 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/studio/studio-panel.tsx · ×1
  • surfsense_local/frontend/src/features/studio/studio-panel.tsx: 520 lines of code surfsense_local/frontend/src/features/studio/studio-panel.tsx:1 — surfsense_local/frontend/src/features/studio/studio-panel.tsx has 520 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/models/remote/models/server-models.tsx · ×1
  • surfsense_local/frontend/src/features/models/remote/models/server-models.tsx: 505 lines of code surfsense_local/frontend/src/features/models/remote/models/server-models.tsx:1 — surfsense_local/frontend/src/features/models/remote/models/server-models.tsx has 505 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx · ×1
  • surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx: 495 lines of code surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx:1 — surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx has 495 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/onboarding/welcome-backdrop/gradient-ascii.tsx · ×1
  • surfsense_local/frontend/src/features/onboarding/welcome-backdrop/gradient-ascii.tsx: 476 lines of code surfsense_local/frontend/src/features/onboarding/welcome-backdrop/gradient-ascii.tsx:1 — surfsense_local/frontend/src/features/onboarding/welcome-backdrop/gradient-ascii.tsx has 476 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/studio/podcast-brief-form.tsx · ×1
  • surfsense_local/frontend/src/features/studio/podcast-brief-form.tsx: 475 lines of code surfsense_local/frontend/src/features/studio/podcast-brief-form.tsx:1 — surfsense_local/frontend/src/features/studio/podcast-brief-form.tsx has 475 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/models/local/chat/model-search.tsx · ×1
  • surfsense_local/frontend/src/features/models/local/chat/model-search.tsx: 466 lines of code surfsense_local/frontend/src/features/models/local/chat/model-search.tsx:1 — surfsense_local/frontend/src/features/models/local/chat/model-search.tsx has 466 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/studio/viewers/flashcards/flashcards-viewer.tsx · ×1
  • surfsense_local/frontend/src/features/studio/viewers/flashcards/flashcards-viewer.tsx: 465 lines of code surfsense_local/frontend/src/features/studio/viewers/flashcards/flashcards-viewer.tsx:1 — surfsense_local/frontend/src/features/studio/viewers/flashcards/flashcards-viewer.tsx has 465 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/license/license-settings.tsx · ×1
  • surfsense_local/frontend/src/features/license/license-settings.tsx: 461 lines of code surfsense_local/frontend/src/features/license/license-settings.tsx:1 — surfsense_local/frontend/src/features/license/license-settings.tsx has 461 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/settings/settings-dialog.tsx · ×1
  • surfsense_local/frontend/src/features/settings/settings-dialog.tsx: 461 lines of code surfsense_local/frontend/src/features/settings/settings-dialog.tsx:1 — surfsense_local/frontend/src/features/settings/settings-dialog.tsx has 461 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/sources/tree/document-row.tsx · ×1
  • surfsense_local/frontend/src/features/sources/tree/document-row.tsx: 457 lines of code surfsense_local/frontend/src/features/sources/tree/document-row.tsx:1 — surfsense_local/frontend/src/features/sources/tree/document-row.tsx has 457 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/chat/thread-panel.tsx · ×1
  • surfsense_local/frontend/src/features/chat/thread-panel.tsx: 440 lines of code surfsense_local/frontend/src/features/chat/thread-panel.tsx:1 — surfsense_local/frontend/src/features/chat/thread-panel.tsx has 440 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/chat/chat-composer.tsx · ×1
  • surfsense_local/frontend/src/features/chat/chat-composer.tsx: 416 lines of code surfsense_local/frontend/src/features/chat/chat-composer.tsx:1 — surfsense_local/frontend/src/features/chat/chat-composer.tsx has 416 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · www/app/(home)/mcp-server/page.tsx · ×1
  • www/app/(home)/mcp-server/page.tsx: 415 lines of code www/app/(home)/mcp-server/page.tsx:1 — www/app/(home)/mcp-server/page.tsx has 415 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · surfsense_local/frontend/src/features/chat/message.tsx · ×1
  • surfsense_local/frontend/src/features/chat/message.tsx: 412 lines of code surfsense_local/frontend/src/features/chat/message.tsx:1 — surfsense_local/frontend/src/features/chat/message.tsx has 412 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · www/app/(home)/terms/page.tsx · ×1
  • www/app/(home)/terms/page.tsx: 405 lines of code www/app/(home)/terms/page.tsx:1 — www/app/(home)/terms/page.tsx has 405 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~266 LoC) · ×1
  • Dead file (~266 LoC) surfsense_local/frontend/src/components/ui/stepper.tsx — no import path from any entry point (248 application, 19 tooling, 255 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~23 LoC) · ×1
  • Dead file (~23 LoC) surfsense_local/electron/scripts/electron-dev.mjs — no import path from any entry point (248 application, 19 tooling, 255 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R8 · Dependency Hygiene · Unused dependency 'lenis' · ×1
  • Unused dependency 'lenis' www/package.json:42 — Declared in www/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'next-themes' · ×1
  • Unused dependency 'next-themes' www/package.json:45 — Declared in www/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'tailwindcss-animate' · ×1
  • Unused dependency 'tailwindcss-animate' www/package.json:52 — Declared in www/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
X28 · Index access outside its own emptiness guard · Index access outside its own emptiness guard · ×1
  • Index access outside its own emptiness guard backend/plugins/proprietary/tiktok/targets/resolver.py:35 — This condition tests `segments` for emptiness and then indexes it on a branch that test does not reach. `segments[0]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `segments` being empty — so an empty `segments` indexes position 0 of nothing and throws. This same condition already shows the intended bracketing: `segments[1]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `segments` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `segments`.
Minor — 136 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate surfsense_local/sidecars/audiocpp-transcription.ts:29 — `!existsSync(binary) || !existsSync(config)` appears character-identically in 2 files — surfsense_local/sidecars/audiocpp-transcription.ts, surfsense_local/sidecars/audiocpp.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/studio/artifact-list.tsx:153 — `artifact.status === "pending" || artifact.status === "processing"` appears character-identically in 2 files — surfsense_local/frontend/src/features/studio/artifact-list.tsx, surfsense_local/frontend/src/features/studio/use-studio.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/models/your-models/use-audio-models.ts:43 — `catalog.isPending || selection.isPending` appears character-identically in 4 files — surfsense_local/frontend/src/features/models/your-models/use-audio-models.ts, surfsense_local/frontend/src/features/models/your-models/use-chat-models.ts, surfsense_local/frontend/src/features/models/your-models/use-image-models.ts, surfsense_local/frontend/src/features/models/your-models/use-speech-models.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/agent/outdated-thread.ts:11 — `cause instanceof ApiError && cause.status === 409 && cause.message === REFUSAL` appears character-identically in 2 files — surfsense_local/frontend/src/features/agent/outdated-thread.ts, surfsense_local/frontend/src/features/agent/unsupported-model.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/sources/tree/document-row.tsx:167 — `dropdownOpen && "bg-muted dark:bg-muted/50"` appears character-identically in 2 files — surfsense_local/frontend/src/features/sources/tree/document-row.tsx, surfsense_local/frontend/src/features/studio/artifact-list.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/sources/tree/document-row.tsx:279 — `dropdownOpen && "sidebar-row-title-fade-actions"` appears character-identically in 2 files — surfsense_local/frontend/src/features/sources/tree/document-row.tsx, surfsense_local/frontend/src/features/studio/artifact-list.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/dictation/recording.ts:261 — `error instanceof ApiError && error.code === "needs_speech_model"` appears character-identically in 2 files — surfsense_local/frontend/src/features/dictation/recording.ts, surfsense_local/frontend/src/features/models/local/transcription/language/api.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/models/selection/api.ts:39 — `error instanceof ApiError && error.status === 404` appears character-identically in 2 files — surfsense_local/frontend/src/features/models/selection/api.ts, surfsense_local/frontend/src/features/plugins/sign-in/use-plugin-sign-in.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/chat/use-chat-runtime.ts:92 — `error instanceof DOMException && error.name === "AbortError"` appears character-identically in 2 files — surfsense_local/frontend/src/features/chat/use-chat-runtime.ts, surfsense_local/frontend/src/features/sources/use-sources.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/electron/src/main/microphone/ipc.ts:16 — `options.isTrusted(event.sender) && event.senderFrame === event.sender.mainFrame` appears character-identically in 2 files — surfsense_local/electron/src/main/microphone/ipc.ts, surfsense_local/electron/src/main/privacy-choices/privacy-ipc.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/electron/src/main/external-url.ts:97 — `parsed.protocol !== "https:" || parsed.username || parsed.password` appears character-identically in 2 files — surfsense_local/electron/src/main/external-url.ts, surfsense_local/electron/src/main/plugin-page-url.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/plugins/details/plugin-details-card.tsx:103 — `plugin.check_failure === "sign_in" && plugin.never_signed_in` appears character-identically in 2 files — surfsense_local/frontend/src/features/plugins/details/plugin-details-card.tsx, surfsense_local/frontend/src/features/plugins/details/plugin-status-line.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/plugins/in-thread/plugin-mentions.tsx:68 — `plugin.source === "first_party" || thirdPartyOn` appears character-identically in 2 files — surfsense_local/frontend/src/features/plugins/in-thread/plugin-mentions.tsx, surfsense_local/frontend/src/features/plugins/in-thread/plugins-menu.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/electron/src/main/i18n/resolve-locale.ts:18 — `preference !== "system" && isLocale(preference)` appears character-identically in 2 files — surfsense_local/electron/src/main/i18n/resolve-locale.ts, surfsense_local/frontend/src/i18n/resolve-locale.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/plugins/add-custom/add-plugin-dialog.tsx:101 — `refused instanceof ApiError && refused.code === "plugin_needs_sign_in"` appears character-identically in 6 files — surfsense_local/frontend/src/features/plugins/add-custom/add-plugin-dialog.tsx, surfsense_local/frontend/src/features/plugins/browse/registry-headers-dialog.tsx, surfsense_local/frontend/src/features/plugins/browse/registry-key-dialog.tsx, surfsense_local/frontend/src/features/plugins/connection/edit-connection-button.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/settings/settings-dialog.tsx:405 — `selected && "bg-sidebar-accent text-sidebar-accent-foreground"` appears character-identically in 2 files — surfsense_local/frontend/src/features/settings/settings-dialog.tsx, surfsense_local/frontend/src/features/workspaces/workspace-rail.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx:143 — `state === "added" || state === "already"` appears character-identically in 2 files — surfsense_local/frontend/src/features/sources/web/add-from-web-dialog.tsx, surfsense_local/frontend/src/features/sources/web/web-result-row.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/frontend/src/features/models/remote/connections/chatgpt/chatgpt-option.tsx:50 — `state.phase === "starting" || state.phase === "waiting"` appears character-identically in 2 files — surfsense_local/frontend/src/features/models/remote/connections/chatgpt/chatgpt-option.tsx, surfsense_local/frontend/src/features/models/remote/connections/chatgpt/chatgpt-sign-in.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/electron/src/main/privacy-choices/privacy-ipc.ts:6 — `typeof value !== "object" || value === null` appears character-identically in 4 files — surfsense_local/electron/src/main/privacy-choices/privacy-ipc.ts, surfsense_local/electron/src/main/usage-statistics/setup-tries.ts, surfsense_local/electron/src/preload/index.ts, surfsense_local/frontend/src/features/dashboard/chrome-prefs.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/electron/src/main/updater.ts:68 — `typeof value === "object" && value !== null` appears character-identically in 3 files — surfsense_local/electron/src/main/updater.ts, surfsense_local/electron/src/main/usage-statistics/report-body.ts, surfsense_local/headless/access/server.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/electron/src/main/update-feed/manifest-checks.ts:11 — `typeof value === "object" && value !== null && !Array.isArray(value)` appears character-identically in 2 files — surfsense_local/electron/src/main/update-feed/manifest-checks.ts, surfsense_local/electron/src/main/usage-statistics/privacy-file.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/backend/modules/agent/tool_endpoint/pdf_inputs.py:132 — `artifact is None or artifact.workspace_id != workspace_id` appears character-identically in 3 files — surfsense_local/backend/modules/agent/tool_endpoint/pdf_inputs.py, surfsense_local/backend/modules/artifacts/converted_documents/input_file.py, surfsense_local/backend/modules/artifacts/revised_copies/versions.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/backend/modules/artifacts/script_documents/service.py:174 — `base is None or base.workspace_id != workspace_id` appears character-identically in 2 files — surfsense_local/backend/modules/artifacts/script_documents/service.py, surfsense_local/backend/modules/artifacts/web_pages/saved_page.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate backend/plugins/proprietary/reddit/parsers.py:236 — `date_limit and _before(data.get("created_utc"), date_limit)` appears character-identically in 2 files — backend/plugins/proprietary/reddit/parsers.py, backend/plugins/proprietary/reddit/scraper.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate surfsense_local/backend/worker/ingestion/pipeline.py:93 — `document is None or document.status is DocumentStatus.CANCELLED` appears character-identically in 2 files — surfsense_local/backend/worker/ingestion/pipeline.py, surfsense_local/backend/worker/studio/job.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×16
  • Silent fallback default on parse failure backend/plugins/proprietary/indeed/scraper.py:45 — `_concurrency` returns `3` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure backend/plugins/proprietary/instagram/pages/embed.py:19 — `embed_context` returns `{}` when `(ValueError, AttributeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure backend/plugins/proprietary/scraping/logged_host.py:13 — `logged_host` returns `'-'` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure backend/plugins/proprietary/web_crawl/site_crawler.py:58 — `_concurrency` returns `6` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure backend/plugins/registry/check/registry_check/static/icon_rules.py:96 — `_square_problem` returns `'needs a viewBox'` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure surfsense_local/backend/modules/agent/plugin_gateway/host_calls.py:65 — `_messages` returns `[]` when `(ValueError, UnicodeDecodeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure surfsense_local/backend/modules/llm/catalog/local/installs.py:57 — `read_installs` returns `{}` when `(OSError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure surfsense_local/backend/modules/llm/connections/service.py:191 — `_optional_other_entries` returns `{}` when `(httpx.HTTPError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure surfsense_local/backend/modules/llm/hardware/system_memory.py:29 — `_total` returns `0` when `(ValueError, OSError, AttributeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure surfsense_local/backend/modules/llm/providers/llamacpp/router_client.py:90 — `props` returns `{}` when `(httpx.HTTPError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure surfsense_local/backend/modules/llm/subscriptions/claude/status.py:56 — `_sign_in` returns `{}` when `json.JSONDecodeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure surfsense_local/backend/modules/usage_statistics/activity_counts/tools_called.py:9 — `tools_called` returns `0` when `(ValueError, UnicodeDecodeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure surfsense_local/backend/modules/usage_statistics/ui_language/preference.py:16 — `stored_preference` returns `'system'` when `(OSError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure surfsense_local/backend/modules/usage_statistics/ui_language/system_languages.py:21 — `system_languages` returns `[]` when `(OSError, ValueError, subprocess.SubprocessError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure surfsense_local/backend/tests/live/sweep/attempt.py:195 — `_ledger` returns `{}` when `(OSError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure surfsense_local/backend/worker/studio/script_document/workbook_summary.py:139 — `_used_range` returns `'size not recorded'` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
D29 · Static Analysis (SAST) · REDACTED · ×14
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default in catch · ×14
  • Silent fallback default in catch backend/plugins/proprietary/google_search/captcha.py:194 — `exemption_cookies` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch backend/plugins/proprietary/tiktok/session/listing.py:350 — `_page_url` swallows every exception into `return '?'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch surfsense_local/electron/scripts/notices/native-components.mjs:15 — `electronVersion` swallows every exception into `return "unknown"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch surfsense_local/electron/src/main/i18n/locale-prefs.ts:28 — `loadLocalePreference` swallows every exception into `return "system"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch surfsense_local/sidecars/file-stamp.ts:8 — `fileStamp` swallows every exception into `return "absent"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch surfsense_local/electron/src/main/theme-prefs.ts:32 — `loadThemePreference` swallows every exception into `return "system"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch surfsense_local/electron/src/main/update-feed/manifest-checks.ts:74 — `mirrorManifestProblem` swallows every exception into `return true` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch surfsense_local/frontend/src/features/chat/runs/unread-replies.ts:14 — `readUnread` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch surfsense_local/frontend/src/features/dashboard/chrome-prefs.ts:18 — `readSourcePreviews` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch surfsense_local/frontend/src/features/dashboard/chrome-prefs.ts:83 — `readColumnWidth` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch surfsense_local/frontend/src/features/studio/artifact-list.tsx:78 — `readStoredFormats` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch surfsense_local/frontend/src/i18n/browser-locale.ts:22 — `storedPreference` swallows every exception into `return "system"` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch www/app/(home)/plugins/registry-plugins.ts:24 — `registryPlugins` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch www/features/downloads/release-assets.ts:41 — `getReleaseAssets` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×11
  • Hand-rolled JSON/XML parsing via regex surfsense_local/backend/worker/ingestion/kindle_books/mobi6_headings.py:7 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex surfsense_local/backend/worker/ingestion/kindle_books/mobi6_pages.py:3 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex surfsense_local/backend/worker/ingestion/kindle_books/one_document.py:3 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex surfsense_local/backend/modules/agent/tool_endpoint/passage_label.py:5 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex backend/plugins/proprietary/walmart/next_data.py:23 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex backend/plugins/proprietary/walmart/next_data.py:24 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex backend/plugins/proprietary/tiktok/extraction/hydration.py:14 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex backend/plugins/proprietary/instagram/parsers.py:293 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex backend/plugins/proprietary/instagram/parsers.py:295 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex backend/plugins/proprietary/instagram/pages/embed.py:10 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex backend/plugins/proprietary/instagram/pages/relay.py:10 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
D10 · Test Quality · Mock-dominated test · ×5
  • Mock-dominated test: sends the ticked folders as the job's source scope surfsense_local/frontend/src/features/studio/studio-panel.test.tsx:119 — This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: previews a PDF source before ingestion finishes surfsense_local/frontend/src/features/sources/source-upload.test.tsx:98 — This test sets up 17 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: cancels a processing source from the overflow menu surfsense_local/frontend/src/features/sources/source-upload.test.tsx:543 — This test sets up 15 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: re-renders no reply for a new handler, and opens with the newest surfsense_local/frontend/src/features/chat/inline-citation.test.tsx:64 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: re-renders no reply for new handlers, and calls the newest surfsense_local/frontend/src/features/chat/thread-panel.test.tsx:146 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
D16 · Bus Factor · Off-boarding risk · ×5
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 136 significant file(s) lose their only recent owner: surfsense_local/backend/modules/agent/engines/claude_code/turn.py, surfsense_local/frontend/src/features/chat/chats-dialog.tsx, surfsense_local/frontend/src/features/models/remote/models/server-models.tsx, surfsense_local/backend/modules/plugins/routes.py, surfsense_local/frontend/src/features/models/remote/connections/connection-form.tsx, surfsense_local/frontend/src/features/studio/refine-box.tsx, surfsense_local/frontend/src/features/onboarding/model-step/model-step.tsx, surfsense_local/frontend/src/features/workspaces/workspace-rail.tsx (+128 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 72 significant file(s) lose their only recent owner: plans/community-local/seo/data/parse.py, backend/plugins/proprietary/scraping/browser_pool.py, surfsense_local/backend/modules/agent/tool_endpoint/render_document.py, surfsense_local/backend/modules/agent/tool_endpoint/revise_document.py, surfsense_local/frontend/src/features/dictation/recording.ts, surfsense_local/frontend/src/features/office-support/office-support-settings.tsx, surfsense_local/frontend/src/features/studio/viewers/docx-comments.ts, surfsense_local/backend/modules/runtime_packs/office/install.py (+64 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 13 significant file(s) lose their only recent owner: surfsense_local/backend/alembic/versions/0001_initial_schema.py, surfsense_local/backend/shared/db.py, surfsense_local/backend/scripts/remote_manifest/translate.py, surfsense_local/backend/scripts/local_manifest/sdcpp/assemble.py, surfsense_local/backend/modules/agent/model_endpoint/request_shaping.py, surfsense_local/backend/modules/llm/catalog/remote/router.py, REDACTED, surfsense_local/sidecars/audiocpp.ts (+5 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 3 significant file(s) lose their only recent owner: surfsense_local/backend/modules/llm/catalog/local/engines/onnxruntime/engine.py, surfsense_local/frontend/src/features/models/local/installs/install-text.ts, surfsense_local/frontend/src/features/models/local/chat/not-runnable-text.ts. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 3 significant file(s) lose their only recent owner: surfsense_local/frontend/src/features/sources/note-editor-dialog.tsx, surfsense_local/backend/scripts/notices/distribution_notice.py, surfsense_local/backend/scripts/notices/model_packs.py. Pair on, review, or document these before any departure.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×4
  • Projects may be oversized for their cohesion REDACTED:1 — `surfsense_local/backend` (69976 LoC, 1933 module-visible types across 177 directories) overshoots its size bounds. 4 of 13 build unit(s) (Python, checkout, npm) overshoot their size bounds, lowering Project Cohesion to 3.8/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion surfsense_local/frontend/package.json:1 — `surfsense_local/frontend` (57970 LoC, 655 module-visible types across 84 directories) overshoots its size bounds. 4 of 13 build unit(s) (Python, checkout, npm) overshoot their size bounds, lowering Project Cohesion to 3.8/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion www/package.json:1 — `www` (14650 LoC, 214 module-visible types across 57 directories) overshoots its size bounds. 4 of 13 build unit(s) (Python, checkout, npm) overshoot their size bounds, lowering Project Cohesion to 3.8/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
  • Projects may be oversized for their cohesion REDACTED:1 — `backend` (30550 LoC, 363 module-visible types across 34 directories) overshoots its size bounds. 4 of 13 build unit(s) (Python, checkout, npm) overshoot their size bounds, lowering Project Cohesion to 3.8/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D20 · ADR Quality · ADR superseded but its status says otherwise · ×2
  • ADR superseded but its status says otherwise docs/adr/0020-two-update-channels.md:1 — docs/adr/0020-two-update-channels.md:1 says "Accepted; amended by [ADR 0070](0070-opt-in-id-less-update-checks-and-usage-statistics.md): the manifest is read through `updates.surfsense.com`, with GitHub behind it, and the automatic check runs once a UTC day", but docs/adr/0070-opt-in-id-less-update-checks-and-usage-statistics.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
  • ADR superseded but its status says otherwise docs/adr/0060-one-consent-question-per-user-action.md:1 — docs/adr/0060-one-consent-question-per-user-action.md:1 says "Accepted; amended by [ADR 0070](0070-opt-in-id-less-update-checks-and-usage-statistics.md): on a new install, the first-run privacy step is the user action the update and usage questions belong to", but docs/adr/0070-opt-in-id-less-update-checks-and-usage-statistics.md supersedes it. Two records now claim the same ground; mark this one "Superseded by" its successor.
D21 · Naming Consistency · `do_GET` spells `GET` where 31 names in the project spell it `get` · ×2
  • `do_GET` spells `GET` where 31 names in the project spell it `get` surfsense_local/backend/tests/integration/llm/transcription_stand_in.py:37 — 31 of 33 names in project surfsense-local-backend spell the token `get` (31 of 33; unit: names in project surfsense-local-backend containing `get`). Peers: config.get_settings (surfsense_local/backend/api/config.py:47); dependencies.get_session (surfsense_local/backend/api/dependencies.py:9); dependencies.get_launch_key (surfsense_local/backend/modules/agent/dependencies.py:6); snapshot_key.get_snapshot_key_settings (surfsense_local/backend/modules/agent/previews/snapshot_key.py:25); dependencies.get_artifact (surfsense_local/backend/modules/artifacts/dependencies.py:9). Rename to `do_get`. [rule N6]
  • `do_GET` spells `GET` where 31 names in the project spell it `get` surfsense_local/backend/tests/integration/worker/speech_api_stand_in.py:63 — 31 of 33 names in project surfsense-local-backend spell the token `get` (31 of 33; unit: names in project surfsense-local-backend containing `get`). Peers: config.get_settings (surfsense_local/backend/api/config.py:47); dependencies.get_session (surfsense_local/backend/api/dependencies.py:9); dependencies.get_launch_key (surfsense_local/backend/modules/agent/dependencies.py:6); snapshot_key.get_snapshot_key_settings (surfsense_local/backend/modules/agent/previews/snapshot_key.py:25); dependencies.get_artifact (surfsense_local/backend/modules/artifacts/dependencies.py:9). Rename to `do_get`. [rule N6]
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
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 (229 single-owned of 893 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 893 of the 2429 production source files in this repository met that bar). They are anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: surfsense_local/backend/worker/studio/office/markdown/word.py, surfsense_local/frontend/src/features/plugins/sign-in/sign-in-failure-text.ts.
D25 · ADR Conformance · ADR not followed · ×1
  • ADR not followed: ADR 0029: Interface text lives in ICU MessageFormat catalogs, one flat JSON file per language docs/adr/0029-icu-translation-catalogs.md:13 — docs/adr/0029-icu-translation-catalogs.md:13 rules out `common`, but production code uses it: surfsense_local/electron/src/main/data-dir.ts:26, surfsense_local/electron/src/main/data-dir.ts:27, surfsense_local/electron/src/main/data-dir.ts:28. Remove the use, or supersede the record if the decision changed.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low vulnerability · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M4 · Documentation accuracy · README/code drift · ×1
  • README/code drift surfsense_local/packaging/README.md:153 — surfsense_local/packaging/README.md links to `../../surfsense_web/lib/install-script-redirects.ts`, but `surfsense_web/lib/install-script-redirects.ts` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 3/10 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `.`, `backend/plugins/bundles/core/cli`, `backend/plugins/bundles/core/sdk`, `surfsense_local/headless` and 2 more.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation surfsense_local/electron/package.json:35 — `surfsense_local/electron/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate REDACTED:277 — Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
R7 · Dead Code · Unused export 'listInstalls' · ×1
  • Unused export 'listInstalls' surfsense_local/frontend/src/features/models/local/installs/api.ts:37 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'DOCUMENT_PAGE' · ×1
  • Unused export 'DOCUMENT_PAGE' surfsense_local/frontend/src/features/sources/api.ts:120 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'MAX_BATCH_FILES' · ×1
  • Unused export 'MAX_BATCH_FILES' surfsense_local/frontend/src/features/sources/folder-upload/upload-plan.ts:23 — Nothing imports this binding — it is safe to review for removal.
R8 · Dependency Hygiene · Test-only dependency '@streamdown/code' in production deps · ×1
  • Test-only dependency '@streamdown/code' in production deps surfsense_local/frontend/package.json:34 — Only test files import it (first: surfsense_local/frontend/src/features/studio/viewers/code-highlighter.test.ts:3) — move it to devDependencies.
S1 · Web-Security Posture · Security headers incomplete · ×1
  • Security headers incomplete REDACTED:11 — Set: Content-Security-Policy. Missing: Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options — the four headers that carry the points of this card's security-headers term (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options), 0.5 each. (−1.5 on this card.)
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 18/31 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X4 · Structured logging · Interpolated log message defeats structured logging · ×1
  • Interpolated log message defeats structured logging backend/plugins/proprietary/web_crawl/connector.py:1162 — `info` at line 1162 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
X5 · Nullable reference types · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — 4/5 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
X5 · Nullable reference types · Null assertions (`!`) override strict null checking · ×1
  • Null assertions (`!`) override strict null checking — ~0.2 `!` null assertions per 1k TypeScript source lines — 13 assertion(s) across the 84310 source line(s) of the 898 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: surfsense_local/frontend/src/features/about/data-folder.tsx (4), surfsense_local/electron/src/main/system-labels.ts (3), surfsense_local/frontend/src/features/studio/viewers/docx-comments.ts (2). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Minor — 12 finding(s)
D10 · Test Quality · Skipped (documented) · ×10
  • Skipped (documented): (unnamed test) surfsense_local/frontend/src/features/models/local/chat/download-chat-models.test.tsx:42 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) surfsense_local/frontend/src/features/models/local/chat/download-chat-models.test.tsx:200 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) surfsense_local/frontend/src/features/models/local/chat/download-chat-models.test.tsx:427 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) surfsense_local/frontend/src/features/models/local/chat/download-chat-models.test.tsx:460 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) surfsense_local/frontend/src/features/models/local/chat/download-chat-models.test.tsx:492 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) surfsense_local/frontend/src/features/models/local/chat/download-chat-models.test.tsx:570 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) surfsense_local/frontend/src/features/models/local/chat/download-chat-models.test.tsx:871 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) surfsense_local/frontend/src/features/models/local/chat/download-chat-models.test.tsx:1216 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) surfsense_local/frontend/src/features/models/local/chat/download-chat-models.test.tsx:1227 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
  • Skipped (documented): (unnamed test) surfsense_local/frontend/src/features/models/local/chat/download-chat-models.test.tsx:1281 — Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
D24 · Comment Value · doc comments repeat the names · ×2
  • doc comments repeat the names surfsense_local/frontend/src/features/sources/tree/folder-name-dialog.tsx:18 — 0 of 1 documented parameters and 1 of 1055 summaries in `surfsense-local-frontend` only repeat the member or parameter name (e.g. "A new folder, or a folder's new name." for `FolderNameTarget`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names www/features/announcements/announcement.types.ts:12 — 0 of 0 documented parameters and 1 of 310 summaries in `surfsense-website` only repeat the member or parameter name (e.g. "Announcement category" for `AnnouncementCategory`). Delete the restating tags, or add what the name does not say.

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-851464431e5b4da085468ad69f731eb8/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-851464431e5b4da085468ad69f731eb8/history-1.json --exit-code 0 --source .9artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=3200" --report-format json --report-path /tmp/watchdog-gitleaks-851464431e5b4da085468ad69f731eb8/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=4200 --max-count=4628" --report-format json --report-path /tmp/watchdog-gitleaks-851464431e5b4da085468ad69f731eb8/history-3.json --exit-code 0 --source .1artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=8828 --max-count=3108" --report-format json --report-path /tmp/watchdog-gitleaks-851464431e5b4da085468ad69f731eb8/history-4.json --exit-code 0 --source .2artifacts/raw/gitleaks-history-4.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-851464431e5b4da085468ad69f731eb8/tree.json --exit-code 0 --source .8artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .171artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .53artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .11artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 24 file(s) — `backend/plugins/bundles/core/manifest/surfsense_plugin_manifest/rules/duplicate_names.py`, `backend/plugins/bundles/core/sdk/surfsense_plugin_sdk/action.py`, `backend/plugins/bundles/core/sdk/surfsense_plugin_sdk/http/sending.py`, `backend/plugins/proprietary/google_maps/fetch.py`, `backend/plugins/proprietary/scraping/browser_pool.py`, … (+19 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1e950-0c44-7202-9e2a-188753ab8c07 · 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