Public report of ColbyGallagher/redcolumn, published 16 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, 16 November 2026, 20:41 UTC · Survey ID cd_fcf27566fb1a4f61a95b7c051230c21a

ColbyGallagher/redcolumn

Measured 16 November 2026, 20:39 UTC, at code version 89a92da

First survey, so nothing to compare with yet
CAI score 51.2out of 100 Adequate
CriticalWeakAdequateStrongExemplary

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: 137,685 lines of product code in 8 projects, tests not counted · Estimated rebuild effort: about 1.1 person-years · Weakest lens: Production Readiness, 44.0

Findings by how serious they are

67 critical 1519 serious 133 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
16 November 2026, 20:39 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.

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 ▸

80of 80 dimensions measured by tools.
1698of 1719 findings point to an exact file and line, so you can open each one in the code. The other 21 concern the repository as a whole, such as missing documentation.
80dimensions across 7 lenses, read from 137,685 lines of product code in 8 projects.
Chapters

Executive summary

ColbyGallagher/redcolumn falls short of our standard for a preview release because we found no logging, tracing or health checks in the code, and it has uses of packages that aren't listed. It scores 51.2 out of 100 and is rated Adequate, and ten of its 67 critical findings are security problems.

Production Readiness, at 44.0, is the weakest lens and counts most in the score. The best first step is fixing the password or key in the code, worth about 5.8 points. Adopting a logging library would lift Production Readiness itself, worth about 5.1 points. Raising Production Readiness to 62 would lift the score to about 56.4.

Five known security holes in the packages the code depends on can be used by attackers. Two automatic updates take new releases before a bad one can be spotted, and thirty-three form fields can't be read by a screen reader. Updating the vulnerable packages, setting a waiting period for automatic updates and labelling the form fields would close these risks. Fixing the weaknesses the scanner points to would fix the two security weaknesses in the code. The 13 controls that only work with a mouse need to work with the keyboard, or to become a real button.

The product code is 137,685 lines, about €160,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 44.0 · counts for 46%Accessibility 50.7 · counts for 25%Code Health 57.3 · counts for 14%Architecture 60.1 · counts for 8%Maturity 70.0 · counts for 4%Security and Compliance 71.1 · counts for 2%Performance 100.0 · counts for 1%

If Production Readiness rose from 44.0 to 62, the lowest score rated Strong, the score would rise from 51.2 to about 56.4.

Code composition: what the lines of code are
Product code 79%Tests 21%
Rebuild cost: about €160,000 · Estimate
Cost to rebuild€55,000 to €270,000, for 910 to 2,888 hours of work, about 1.1 person-years for 1 to 3 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 51. 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: 137,685 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 Secret Scanning — start with REDACTED.
Raises the score by about 5.8 points · Low effort · Secret Scanning
2
Adopt pino (or winston) and log at meaningful points in the services you run.
Raises the score by about 5.1 points · Medium effort · Observability
3
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
Raises the score by about 3.8 points · Medium effort · Dependency Hygiene

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 €160,000 to build again, about 1.1 person-years of work. Its weakest lens is Production Readiness, at 44.0 (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 Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 5.8 points for low effort, because it clears the 1 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.0 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 11% on every change. The history of the code shows how much it changes: about 266,904 lines over the last 90 days, which is about 1,082,444 lines a year. At that pace, the extra work comes to an estimated 136.2 to 817.4 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

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 @nb/desktop desktop @nb/markup markup @nb/measure measure @nb/markup->@nb/measure @nb/sheets sheets @nb/markup->@nb/sheets @nb/pdf-core pdf-core @nb/stitch stitch @nb/stitch->@nb/sheets @nb/web web @nb/web->@nb/markup @nb/web->@nb/measure @nb/web->@nb/pdf-core @nb/web->@nb/sheets @nb/web->@nb/stitch

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.

447 modules, with 619 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; 407 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 apps.desktop.src.excel2 apps.web.src.compare.diff3 apps.web.src.documents.forms4 apps.web.src.geospatial.align5 apps.web.src.sheets.standards6 apps.web.src.studio.protocol7 packages.markup.src.cad8 packages.markup.src.columns9 packages.markup.src.estimating10 packages.measure.src.measure11 packages.measure.src.scale12 packages.pdf-core.src.engine13 packages.sheets.src.types14 apps.desktop.src15 apps.web.src.cad16 apps.web.src.compare17 apps.web.src.measure18 apps.web.src.settings.settings19 apps.web.src.viewer.TileViewer20 packages.markup.src.model21 packages.measure.src22 packages.sheets.src23 apps.web.src.columns.listColumns24 apps.web.src.workspace.profiles25 packages.markup.src.store26 packages.stitch.src27 apps.web.src.assemblies28 apps.web.src.columns29 apps.web.src.desktop30 apps.web.src.documents31 apps.web.src.geospatial32 apps.web.src.markup.MarkupTools33 apps.web.src.sheets34 apps.web.src.studio.types35 packages.markup.src36 apps.web.src37 apps.web.src.commands.appCommands38 apps.web.src.markup39 apps.web.src.studio.drive.DriveSession40 apps.web.src.components
1 apps.desktop.src.excel
2 apps.web.src.compare.diff
3 apps.web.src.documents.forms
4 apps.web.src.geospatial.align
5 apps.web.src.sheets.standards
6 apps.web.src.studio.protocol
7 packages.markup.src.cad
8 packages.markup.src.columns
9 packages.markup.src.estimating
10 packages.measure.src.measure
11 packages.measure.src.scale
12 packages.pdf-core.src.engine
13 packages.sheets.src.types
14 apps.desktop.src4
15 apps.web.src.cad2
16 apps.web.src.compare5121
17 apps.web.src.measure11271
18 apps.web.src.settings.settings1
19 apps.web.src.viewer.TileViewer21
20 packages.markup.src.model2
21 packages.measure.src74
22 packages.sheets.src424
23 apps.web.src.columns.listColumns1111
24 apps.web.src.workspace.profiles2
25 packages.markup.src.store12211
26 packages.stitch.src122
27 apps.web.src.assemblies131113
28 apps.web.src.columns1123
29 apps.web.src.desktop11233
30 apps.web.src.documents7114
31 apps.web.src.geospatial311
32 apps.web.src.markup.MarkupTools12141
33 apps.web.src.sheets127111
34 apps.web.src.studio.types51
35 packages.markup.src1114252441131
36 apps.web.src1111111
37 apps.web.src.commands.appCommands1111
38 apps.web.src.markup2111111013
39 apps.web.src.studio.drive.DriveSession614
40 apps.web.src.components21223115221
Uses a module listed above itPart of a loopThe module itself
1 apps.desktop.src.excel2 apps.web.src.compare.diff3 apps.web.src.documents.forms4 apps.web.src.geospatial.align5 apps.web.src.sheets.standards6 apps.web.src.studio.protocol7 packages.markup.src.cad8 packages.markup.src.columns9 packages.markup.src.estimating10 packages.measure.src.measure11 packages.measure.src.scale12 packages.pdf-core.src.engine13 packages.sheets.src.types14 apps.desktop.src15 apps.web.src.cad16 apps.web.src.compare17 apps.web.src.measure18 apps.web.src.settings.settings19 apps.web.src.viewer.TileViewer20 packages.markup.src.model21 packages.measure.src22 packages.sheets.src23 apps.web.src.columns.listColumns24 apps.web.src.workspace.profiles25 packages.markup.src.store26 packages.stitch.src27 apps.web.src.assemblies28 apps.web.src.columns29 apps.web.src.desktop30 apps.web.src.documents31 apps.web.src.geospatial32 apps.web.src.markup.MarkupTools33 apps.web.src.sheets34 apps.web.src.studio.types35 packages.markup.src36 apps.web.src37 apps.web.src.commands.appCommands38 apps.web.src.markup39 apps.web.src.studio.drive.DriveSession40 apps.web.src.componentsapps.desktop.src.excel1apps.web.src.compare.diff2apps.web.src.documents.forms3apps.web.src.geospatial.align4apps.web.src.sheets.standards5apps.web.src.studio.protocol6packages.markup.src.cad7packages.markup.src.columns8packages.markup.src.estimating9packages.measure.src.measure10packages.measure.src.scale11packages.pdf-core.src.engine12packages.sheets.src.types13apps.desktop.src14apps.web.src.cad15apps.web.src.compare16apps.web.src.measure17apps.web.src.settings.settings18apps.web.src.viewer.TileViewer19packages.markup.src.model20packages.measure.src21packages.sheets.src22apps.web.src.columns.listColumns23apps.web.src.workspace.profiles24packages.markup.src.store25packages.stitch.src26apps.web.src.assemblies27apps.web.src.columns28apps.web.src.desktop29apps.web.src.documents30apps.web.src.geospatial31apps.web.src.markup.MarkupTools32apps.web.src.sheets33apps.web.src.studio.types34packages.markup.src35apps.web.src36apps.web.src.commands.appCommands37apps.web.src.markup38apps.web.src.studio.drive.DriveSession39apps.web.src.components4042512111271121274424111121221112213111311231123371143111214112711151111425244113111111111111211111101361421223115221+407 more modules (most-connected shown)

At a glance — Code Health · 57.3 · Adequate · gated by D1, D2 ·

At a glance — Architecture · 60.1 · Adequate · gated by R9 ·

At a glance — Maturity · 70.0 · Adequate · gated by D15 ·

At a glance — Readiness · 44.0 · Adequate · gated by R8, P2 ·

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

At a glance — Accessibility · 50.7 · Adequate · gated by AC4 ·

At a glance — Performance · 100.0 · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures17High / Critical
A05:2025 — Injection12High / Critical
A07:2025 — Authentication Failures1High / Critical

Roadmap

Top priorities: Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED; Adopt pino (or winston) and log at meaningful points in the services you run; Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.

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 Secret Scanning — start with REDACTED.+5.8 ptsLowSecret Scanning
Adopt pino (or winston) and log at meaningful points in the services you run.+5.1 ptsMediumObservability
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+3.8 ptsMediumDependency Hygiene
Resolve the 6 Deprecated finding(s) in Dependency Hygiene — start with REDACTED (6).+1.4 ptsLowDependency Hygiene
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+2.6 ptsMediumKeyboard semantics
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.+2.2 ptsMediumRelease Hygiene
Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.+1.8 ptsMediumText alternatives
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.+1.2 ptsMediumVisual & motion safety

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
apps/web/src/App.tsx5.0MixedCyclomatic Complexity: App.App (cyclomatic 392)
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
packages/markup/src/export.ts5.5MixedCyclomatic Complexity: export.exportWithAnnotations (cyclomatic 129)
apps/web/src/components/ProjectsPanel.tsx5.5MixedCyclomatic Complexity: ProjectsPanel.FileActions (cyclomatic 61)
REDACTED5.7MixedStatic Analysis (SAST): Medium: REDACTED
packages/markup/src/bluebeam.ts5.7MixedCyclomatic Complexity: bluebeam.parseDefaultStyle (cyclomatic 47)
REDACTED5.7MixedSecret Scanning: Leaked secret: REDACTED
apps/desktop/src/assistant/message.ts5.9MixedCyclomatic Complexity: message.handleMcpMessage (cyclomatic 24)
apps/web/src/markup/MarkupTools.ts7.0Near-cleanCyclomatic Complexity: MarkupTools.pointerDown (cyclomatic 249)
packages/markup/src/import.ts7.0Near-cleanCyclomatic Complexity: import.fromRaw (cyclomatic 139)
apps/web/src/cad/dwg/objects.ts7.0Near-cleanCyclomatic Complexity: objects.entityData (cyclomatic 98)
apps/web/src/components/MeasurementsPanel.tsx7.0Near-cleanCyclomatic Complexity: MeasurementsPanel.PageScale (cyclomatic 88)
apps/web/src/markup/cadTools.ts7.0Near-cleanCyclomatic Complexity: cadTools.cadClick (cyclomatic 78)
apps/web/src/cad/render.ts7.0Near-cleanCyclomatic Complexity: render.multileader (cyclomatic 74)

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

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

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

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 80 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 1.0, 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 — 80 dimensions across the health lenses
D1D2D3D4D5D6D7D8D10D11D12D13D14D15D17D19D20D21D23D24D26D27D28D29D30D34D35D36D37D43AC1AC2AC3AC4AC5AC6AX10AX3AX4AX6GD1IC1M1M2M3M4P1P2P3P4P6PF3R1R10R11R2R3R4R6R7R8R9S1X1X12X13X14X16X17X18X19X2X21X24X25X28X29X3X30X5

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, 1698 of 1719 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 01a1e616-1f60-7029-a3a5-ee3c62c3ceb0.

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.

  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (7 contributor(s) across 776 commit(s) sampled, automation and bot accounts excluded). One of them holds 97% of the history; the other 6 hold 0.5% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • D21 Naming Consistency — 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 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict. For npm the surface is what a published package.json's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
  • D23 Boundary Type-Coupling — 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 kind measured 0/40 valid on a seeded held-out sample of its rows on 98 C# repositories (docs/plans/deterministic-engine/adjudication/P5c-D23-units.md, "Version 1 ON MAIN"): the noise rows were dependencies on layer folders, shared cores and grouping folders read as contexts. By the pre-registered fallback (PREREGISTRATION v37) it publishes no row until version 4 passes its gate. The candidates are counted here, not reported as findings, and the score does not include them.
  • 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.
  • 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 744 sampled here came from .js/.mjs/.ts files. This repository's .tsx 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.
  • 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. `apps/desktop/src/token-ipc.ts`, `apps/web/src/App.tsx`, `apps/web/src/compare/compare.worker.ts`, `apps/web/src/compare/semantic.ts`, `apps/web/src/compare/semanticStore.ts`, … (+6 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • D44 Platform End-of-Life — not measured this run — 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
  • AC2 Forms & labels — 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. 18 further occurrence(s) are not listed individually; the score already reflects all 58.
  • AC4 Keyboard semantics — 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. 29 further occurrence(s) are not listed individually; the score already reflects all 69.
  • AXB2 Runtime readiness — 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. A program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. (rule: missing-tool). The renderer reported: the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> dev / > pnpm --filter @nb/web dev / sh: 1: pnpm: not found" No runtime evidence was gathered.
  • AXR1 Runtime accessibility — 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. Render strategy: boot via DevServer (dev). the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> dev / > pnpm --filter @nb/web dev / sh: 1: pnpm: not found" No runtime evidence was gathered.
  • 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.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • 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. 368 further occurrence(s) are not listed individually; the score already reflects all 408.
  • 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. 666 further occurrence(s) are not listed individually; the score already reflects all 706.
  • R3 Large Files — 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. 38 further occurrence(s) are not listed individually; the score already reflects all 78.
  • 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. 9 further occurrence(s) are not listed individually; the score already reflects all 49.
  • 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. 88 further occurrence(s) are not listed individually; the score already reflects all 128.
  • X4 Structured logging — 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, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala, Rust, Go, Swift, Erlang, F# and Visual Basic source only, and no C# was loaded, and this repository's JavaScript/TypeScript, Python and PHP make no call through a named logger, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

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.
  • D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
  • 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 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • 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.
  • D23 Boundary Type-Coupling: Boundary leakage is detected from type references across detected contexts — leaks that flow through primitives, serialization or shared infrastructure may not surface as a typed reference.
  • 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.
  • 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.
  • 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.
  • 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.
  • 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".
  • 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 Complexity2.0 / 10Critical✓ 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 2.0 / 10 · rule-coverage 100% · ceiling Prevented

427 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was App.App at 392. A further 3 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 r2007.copyRun at 32 — they are counted neither in the figure above nor in this dimension's score.

App.App::sidePanel (cyclomatic 100) · ×8apps/web/src/App.tsx:9022
ifc.parseIfc::item (cyclomatic 22) · ×2apps/web/src/geospatial/ifc.ts:448
SearchPanel.SearchPanel::search (cyclomatic 16) · ×2apps/web/src/components/SearchPanel.tsx:197
App.App (cyclomatic 392)apps/web/src/App.tsx:909
MarkupTools.pointerDown (cyclomatic 249)apps/web/src/markup/MarkupTools.ts:2961

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

What to do

  1. Bring the 43 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with App.App (cyclomatic 392), MarkupTools.pointerDown (cyclomatic 249), GeospatialPanel.GeospatialPanel (cyclomatic 151). — 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 43 together lifts Cyclomatic Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D2 · Cognitive Complexity2.0 / 10Critical✓ 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 2.0 / 10 · rule-coverage 100% · ceiling Prevented

526 method(s) exceeded the cognitive complexity threshold of 15; the worst was App.App::sidePanel at 607.

App.App::sidePanel (cognitive 607) · ×6apps/web/src/App.tsx:9022
MarkupList.MarkupList::editor (cognitive 31) · ×3apps/web/src/components/MarkupList.tsx:583
content.optimizeContent::flush (cognitive 19) · ×2apps/web/src/documents/renderCopy/content.ts:389
MarkupTools.pointerDown (cognitive 320)apps/web/src/markup/MarkupTools.ts:2961
export.exportWithAnnotations (cognitive 308)packages/markup/src/export.ts:2064

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

What to do

  1. Bring the 210 bodies over 30 down to 30 or less in Cognitive Complexity — start with App.App::sidePanel (cognitive 607), MarkupTools.pointerDown (cognitive 320), export.exportWithAnnotations (cognitive 308). — 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 210 together lifts Cognitive Complexity from 2.0 to about 5.6/10, projected with the scoring formula itself and assuming each lands exactly at 30; a cleaner split scores higher.

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

D3 · God Classes6.4 / 10Adequate✓ 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 6.4 / 10 · rule-coverage 100% · ceiling Prevented

157 god class(es) detected.

FunctionTooLong: export.escapeXml · ×99packages/markup/src/export.ts:148
FileTooLong: src/App.tsx · ×39apps/web/src/App.tsx
TooManyMethods: MarkupTools · ×8apps/web/src/markup/MarkupTools.ts:620
MethodTooLong: MarkupTools.pointerDown · ×6apps/web/src/markup/MarkupTools.ts:2961
ClassTooLong: PreferencesDialog · ×5apps/web/src/components/PreferencesDialog.tsx:1

What to do

  1. Resolve the 99 FunctionTooLong finding(s) in God Classes — start with export.ts (4), objects.ts (4), ProjectsPanel.tsx (4). — One of this dimension's main actionable groups (99 warning-level).
  2. Resolve the 39 FileTooLong finding(s) in God Classes — start with render.ts (2), App.tsx, MarkupTools.ts. — One of this dimension's main actionable groups (39 warning-level).
  3. Resolve the 8 TooManyMethods finding(s) in God Classes — start with MarkupTools.ts, TileViewer.ts, store.ts. — One of this dimension's main actionable groups (8 warning-level).

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

D4 · Code Duplication9.9 / 10Stronggated by 9 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.9 / 10 · rule-coverage 100% · ceiling Verified

5 duplicated block group(s) detected. 0.1 % of the production lines (189 of 137,685) are in a reported copy. A further 4 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 9 of the 9 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population. Measured on part of this repository only: .ts, .tsx (97% 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.

Duplicated block (6 lines × 2) · ×2scripts/make_stitch_test_pdf.py:115
Edited copy of a member (26 corresponding lines)scripts/make_stitch_test_pdf.py:99
Edited copy of a member (28 corresponding lines)scripts/roadset/sheets_cross.py:134
Edited copy of a member (9 corresponding lines)scripts/roadset/titleblock.py:183
Edited copy of a member (6 corresponding lines)scripts/roadset/geom.py:197

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

What to do

  1. Resolve the 2 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with make_stitch_test_pdf.py, sheets_long.py. — One of this dimension's main actionable groups (2 warning-level).
  2. Resolve the 1 Edited copy of a member (26 corresponding lines) finding(s) in Code Duplication — start with make_stitch_test_pdf.py. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Edited copy of a member (28 corresponding lines) finding(s) in Code Duplication — start with sheets_cross.py. — One of this dimension's main actionable groups (1 warning-level).

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

D5 · Coupling6.6 / 10Adequate✓ 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 6.6 / 10 · rule-coverage 100% · ceiling Prevented

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

Off the main sequence: @nb/sheets · ×3

What to do

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

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

D6 · Cohesion (LCOM4)10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 47 classes have LCOM4 above 3.

✓ On the Gold path — maintain.

Detailed fixes: d6_recommendation.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.

D8 · Code Coverage10.0 / 10Exemplary✓ Tool-verified

What it measures: How much of the code is actually exercised by tests.

Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.

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

Line coverage 98.0%. Measured from the JavaScript/TypeScript suite (node:test in apps/desktop/: not run; node:test in apps/web/: not run; node:test in packages/markup/: not run; node:test via `pnpm install --frozen-lockfile --ignore-scripts` in packages/measure/, the 3 run(s) test reliability made; node:test in packages/pdf-core/: not run; node:test via `pnpm install --frozen-lockfile --ignore-scripts` in packages/sheets/, the 3 run(s) test reliability made; node:test via `pnpm install --frozen-lockfile --ignore-scripts` in packages/stitch/, the 3 run(s) test reliability made). Taken over 3 runs of the suite: a line counts as covered only when every run executed it.

✓ On the Gold path — maintain.

Detailed fixes: d8_recommendation.md.

D10 · Test Quality9.8 / 10Stronggated by 20 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 9.8 / 10 · rule-coverage 100% · ceiling Prevented

8 skipped (3 with a documented reason), 13 zero-assertion, 2 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1868 tests.

No assertions: a document with unsaved markups moves with them, still unsaved · ×13e2e/specs/detach.spec.ts:28
Skipped test: (unnamed test) · ×5e2e/specs/detach.spec.ts:13
Fixed-sleep synchronisation: selection follows the drawing on screen, and one confirmation shows at a time · ×2apps/web/src/desktop/assistant.test.ts:436
Skipped (documented): (unnamed test) · ×3e2e/support/driver.ts:192

What to do

  1. Resolve the 13 No assertions finding(s) in Test Quality — start with document.spec.ts (5), shortcuts.spec.ts (2), view.spec.ts (2). — One of this dimension's main actionable groups (13 warning-level).
  2. Resolve the 5 Skipped test finding(s) in Test Quality — start with detach.spec.ts, document.spec.ts, dont-save.spec.ts. — One of this dimension's main actionable groups (5 warning-level).
  3. Resolve the 2 Fixed-sleep synchronisation finding(s) in Test Quality — start with assistant.test.ts, token-ipc.test.ts. — One of this dimension's main actionable groups (2 warning-level).

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

D11 · Test Reliability10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 flaky across 1 measured tier(s). JavaScript/TypeScript (node:test via `pnpm install --frozen-lockfile --ignore-scripts` in apps/desktop/ (19 tests); node:test via `pnpm install --frozen-lockfile --ignore-scripts` in apps/web/ (118 tests); node:test via `pnpm install --frozen-lockfile --ignore-scripts` in packages/markup/ (59 tests); node:test via `pnpm install --frozen-lockfile --ignore-scripts` in packages/measure/ (79 tests); node:test via `pnpm install --frozen-lockfile --ignore-scripts` in packages/pdf-core/ (2 tests); node:test via `pnpm install --frozen-lockfile --ignore-scripts` in packages/sheets/ (77 tests); node:test via `pnpm install --frozen-lockfile --ignore-scripts` in packages/stitch/ (10 tests)): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene9.7 / 10Exemplary✓ 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 9.7 / 10 · rule-coverage 100% · ceiling Verified

6 outdated direct production npm dependency(ies) of 23 graded, 0 pinning defect(s), across 9 package.json (9 of them the product) and 1 committed lockfile(s). Development dependencies are deliberately not graded for currency: that grade is about what SHIPS. 0 direct dependency(ies) — production, development or optional — are marked DEPRECATED by their publisher (the registry's per-version mark, or the lockfile's copy of it when the registry could not be asked); deprecated transitive packages are listed but not charged. Whether any is UNMAINTAINED is not graded — the registry publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, and the frontend dependency lens (R8) answers it in this same run. Known CVEs in this dependency graph are D30's question, read from the manifest there.

Deprecated: boolean · ×6REDACTED:1372
Outdated (npm): @azure/msal-browser · ×6

✓ On the Gold path — maintain.

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

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

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

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

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

1 secret(s) detected.

REDACTED

What to do

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

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 61 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 61 package(s) this repository's committed lockfile installs for a consumer — its 23 production, optional and peer dependency(ies), across 9 product package.json manifest(s), and everything those install in turn. Its 29 `devDependencies` declaration(s), and every package only they reach, are excluded: a consumer installs none of them. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. No third-party code was found shipping without a manifest entry (vendored or copied-in directories, licence comments preserved in committed bundles, bundled module paths, compiled wasm modules). This repository publishes itself under Apache-2.0, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: apps/web/src/App.tsx (217×2991=649047); apps/web/src/markup/MarkupTools.ts (73×249=18177); apps/web/src/commands/appCommands.ts (53×142=7526)

Hotspot: apps/web/src/App.tsx · ×85apps/web/src/App.tsx:909

What to do

  1. Resolve the 85 Hotspot finding(s) in Churn × Complexity Hotspots — start with render.ts (2), App.tsx, MarkupTools.ts. — One of this dimension's main actionable groups (85 warning-level).

Detailed fixes: d15_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 131312 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. 8 document(s) read across 8 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality10.0 / 10Exemplary○ Nothing flagged

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 10.0 / 10 · rule-coverage 100% · ceiling Documented

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

✓ On the Gold path — maintain.

Detailed fixes: d20_recommendation.md.

D21 · Naming Consistency9.2 / 10Exemplary✓ 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 9.2 / 10 · rule-coverage 100% · ceiling Verified

3 naming inconsistencies among 393 declarations measured against a convention their peers follow.

`toJSON` spells `JSON` where 13 names in the project spell it `Json`apps/desktop/src/allowlist.ts:54
`AppendToCurrentPDF` spells `PDF` where 49 names in the project spell it `Pdf`apps/web/src/summary/bcf.ts:121
`IncludeIDColumn` spells `ID` where 381 names in the project spell it `Id`apps/web/src/summary/bcf.ts:132

✓ On the Gold path — maintain.

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

D23 · Boundary Type-Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether domain types (IDs, enums, value objects) leak across bounded-context boundaries.

Method: Cross-context domain-type leakage via Roslyn structural classification (strongly-typed IDs / value objects) over every public surface. Exhaustive, deterministic, type-level aggregate-boundary check.

Coverage: Bounded contexts derived from NAMESPACE prefix (or graph-inferred where available); cross-boundary domain-type leakage then checked exhaustively over every public member of every type.

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

50 domain type(s) cross context boundaries across 7 contexts; they are measured and withheld (not published, not scored). Contexts: desktop, markup, measure, pdf-core, sheets, stitch, web.

✓ On the Gold path — maintain.

Detailed fixes: d23_recommendation.md.

D24 · Comment Value9.8 9.7 / 10Exemplary✓ Tool-verified

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.7 / 10 · rule-coverage 99% · ceiling Documented

7 of 3399 judged comments only repeat the code they sit on (0.2 %). 50 comment(s) in another language or script were not judged.

redundant comment · ×7apps/web/src/App.tsx:1225
doc comments repeat the names · ×2packages/markup/src/estimating.ts:35

✓ On the Gold path — maintain.

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

D26 · Project Cohesion5.0 / 10Adequate✓ 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 5.0 / 10 · rule-coverage 100% · ceiling Documented

2 of 8 build units (npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×2apps/web/package.json:1

What to do

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

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

D27 · Navigability9.6 / 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 9.6 / 10 · rule-coverage 100% · ceiling Documented

19 % of calls cross a namespace and 5 % go through an interface, but 84 % 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 .js/.mjs/.ts source only — this repository's .tsx 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)10.0 / 10Exemplary○ Nothing flagged

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)3.3 / 10Weak✓ 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 3.3 / 10 · rule-coverage 100% · ceiling Documented

12 finding(s): 0 critical, 4 high, 8 medium, 0 low. semgrep hit a parse error in 20 file(s) — `apps/desktop/src/token-ipc.ts` (line 45, line 52, line 53, …), `apps/web/src/App.tsx`, `apps/web/src/compare/compare.worker.ts` (line 58, line 60), `apps/web/src/compare/semantic.ts` (line 50, line 63, line 273, …), `apps/web/src/compare/semanticStore.ts` (line 22, line 24), … (+15 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 1 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

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D30 · Dependency Vulnerabilities5.9 / 10Adequate✓ 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 5.9 / 10 · rule-coverage 100% · ceiling Documented

11 finding(s): 0 critical, 5 high, 5 medium, 1 low.

REDACTED
REDACTED
REDACTED

What to do

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

Detailed fixes: d30_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 421 of the 527 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 Coupling9.6 / 10Stronggated by 8 serious findings✓ Tool-verified

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

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

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

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

Strongest change-coupling: message.ts↔assistant.ts 100%; toc.js↔App.tsx 92%; preload.ts↔host.ts 89%

Change coupling: message.ts ↔ assistant.ts · ×7apps/desktop/src/assistant/message.ts:1
Change-coupling hub: App.tsx → message.ts, main.ts, preload.ts, toc.jsapps/web/src/App.tsx

What to do

  1. Resolve the 7 Change coupling finding(s) in Change Coupling — start with toc.js (2), message.ts, preload.ts. — One of this dimension's main actionable groups (7 warning-level).
  2. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with App.tsx. — One of this dimension's main actionable groups (1 warning-level).

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

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

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

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

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

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-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.

Frontend & cross-cutting dimensions

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

AC1 · Text alternatives4.7 / 10Adequate✓ Tool-verified

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

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

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.

  • A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×7) — apps/web/src/App.tsx:9906, apps/web/src/App.tsx:10030, apps/web/src/components/LineStylesDialog.tsx:86, …
  • Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). — apps/web/src/components/SoundDialog.tsx:103

What to do

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

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, 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.

  • This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×24) — apps/web/src/components/AskText.tsx:73, apps/web/src/components/CalibrateDialog.tsx:81, apps/web/src/components/ColumnsDialog.tsx:334, …
  • A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one. (×5) — apps/web/src/components/AssembliesDialog.tsx:336, apps/web/src/components/ColumnsDialog.tsx:289, apps/web/src/components/ProductListsDialog.tsx:145, …
  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×9) — apps/web/src/components/CalibrateDialog.tsx:74, apps/web/src/components/ColumnsDialog.tsx:352, apps/web/src/components/ColumnsDialog.tsx:380, …
  • This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. — apps/web/src/components/PropertiesPanel.tsx:1045
  • This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. — apps/web/src/components/PublishDialog.tsx:82

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure7.3 / 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 <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope). (×7) — apps/web/src/components/AssembliesDialog.tsx:73, apps/web/src/components/AssembliesDialog.tsx:352, apps/web/src/components/RevisionsDialog.tsx:30, …
  • A <tr> may hold only <td>/<th> cells. Text or a value written between the cells is moved out of the table by the browser, so it is read detached from its row. Wrap it in a <td>. — apps/web/src/components/MarkupList.tsx:1041

What to do

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

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no 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".

  • The repo's own CSS styles .doc-tab with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — apps/web/src/App.tsx:6724
  • This <div> announces itself as a role="separator" and is operated by pointerdown, but nothing can put focus on it: no tabIndex={0}, no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabIndex={0}="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds). (×2) — apps/web/src/App.tsx:9602, apps/web/src/App.tsx:9993
  • A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}. (×5) — apps/web/src/App.tsx:9946, apps/web/src/App.tsx:9951, apps/web/src/components/ExportDialog.tsx:340, …
  • This <form role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×5) — apps/web/src/components/AskText.tsx:45, apps/web/src/components/CommentDialog.tsx:16, apps/web/src/components/CountToolDialog.tsx:20, …
  • This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×10) — apps/web/src/components/AssembliesDialog.tsx:238, apps/web/src/components/AssistantConfirmDialog.tsx:21, apps/web/src/components/ColumnsDialog.tsx:170, …
  • This <form role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — apps/web/src/components/AssemblyInputs.tsx:79
  • The repo's own CSS styles .twisty with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — apps/web/src/components/BookmarksPanel.tsx:221
  • This <li> announces itself as a role="option" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="option" or point aria-activedescendant at it. (×2) — apps/web/src/components/BulkInsertDialog.tsx:51, apps/web/src/components/CombineDialog.tsx:49
  • The repo's own CSS styles .color-swatch with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — apps/web/src/components/ColorMenu.tsx:112
  • This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×7) — apps/web/src/components/ColorMenu.tsx:108, apps/web/src/components/EraseRegionsPanel.tsx:81, apps/web/src/components/ExportDialog.tsx:308, …
  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. — apps/web/src/components/LayersPanel.tsx:684
  • The repo's own CSS styles .layer-twisty-space with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — apps/web/src/components/LayersPanel.tsx:722
  • This <div> binds pointerdown, pointerup, pointermove and double-click — pointer gestures with no keyboard form, a double-click among them. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click. — apps/web/src/components/LinkPreview.tsx:240
  • The repo's own CSS styles .link-row with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. — apps/web/src/components/LinksPanel.tsx:115
  • This <span> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click. — apps/web/src/components/PagesPanel.tsx:332

What to do

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

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

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

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 safety6.1 / 10Adequate✓ 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.

  • `.geo-badge` sets color: #fff on background-color: #0891b2 — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — apps/web/src/features.css:6492
  • `.content ol.steps > li::before` sets color: #fff on background-color: #ff5a6e — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them. — apps/web/public/help/help.css:265
  • `.modal .prefs-search-box input.prefs-search:not([type='checkbox']):not([type='radio']):not([type='color'])` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — apps/web/src/features.css:1725
  • `.text-editor` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — apps/web/src/styles.css:884
  • `.pages-panel .thumbs:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — apps/web/src/styles.css:1639
  • `.grid.cards h3 a:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — apps/web/public/home/home.css:226
  • `.prefs-dialog .pref-grid .pref-check input[type='checkbox']::before` moves (`transition: transform 0.15s`) 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. — apps/web/src/features.css:2011
  • `.spinner` moves (`animation: spin 0.7s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — apps/web/src/styles.css:4112
  • `.toc .caret` moves (`transition: transform 0.15s`) 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. — apps/web/public/help/help.css:165
  • `.sidebar` moves (`transition: transform 0.2s`) 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. — apps/web/public/help/help.css:459

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 composition4.0 / 10Weak✓ 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.

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

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

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

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

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

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

AX6 · Interface segregation9.9 / 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.

  • `RedcolumnDesktop` declares 26 required operations: `tokenForFile`, `pickOpen`, `pickSave`, `readToken`, `writeToken`, `showInFolder`, `forgetToken`, `takeLaunchFiles`, `onLaunchFiles`, `printPdf`, `beginPrint`, `addPrintPage`, `finishPrint`, `cancelPrint`, `checkForUpdates`, `updateState`, `onUpdateState`, `installUpdate`, `microsoftToken`, `graphRequest`, `microsoftAccount`, `signOut`, `assistantInfo`, `setAssistantEnabled`, `onAssistantCall`, `replyAssistant`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — apps/web/src/desktop/host.ts:84
  • `CommandActions` declares 163 required operations: `open`, `newPdf`, `newFromTemplate`, `fromCamera`, `combine`, `close`, `closeAll`, `saveAll`, `revert`, `publish`, `share`, `markupsXfdf`, `markupsFdf`, `importMarkupsFromPdf`, `exportBax`, `importBax`, `save`, `saveAs`, `exportCsv`, `exportSummary`, `print`, `preferences`, `manageProfiles`, `migrateRevu`, `shortcuts`, `about`, `undo`, `redo`, `cut`, `copy`, `paste`, `pasteInPlace`, `multiply`, `deleteSelection`, `hideSelection`, `undoHistory`, `checkSpelling`, `sound`, `video`, `showHidden`, and 123 more. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — apps/web/src/commands/appCommands.ts:49

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

IC1 · Incompleteness & stubs8.2 / 10Strong✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's JavaScript/TypeScript: functions that only throw a "not implemented" error, functions that take inputs and return a constant or do nothing, async functions that never await, dead `if (false)` branches, and skeleton classes most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • The guard above `return e.key;` also returns `e.key`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — apps/web/src/commands/keys.ts:45
  • `onRemove` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it. — apps/web/src/components/BatchDialog.tsx:216
  • `updateSW` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — apps/web/src/main.tsx:41
  • `authorize` has an empty body — confirm it's an intentional no-op and not an unfinished method. — apps/web/src/studio/projects/store.ts:29
  • A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×5) — e2e/specs/detach.spec.ts:13, e2e/specs/document.spec.ts:412, e2e/specs/dont-save.spec.ts:8, …

What to do

  • Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
  • Clear the softer debt: re-enable or delete skipped tests, decide whether each empty function is a deliberate no-op (and say so in a comment), and replace blanket `eslint-disable` / `@ts-nocheck` with targeted, justified suppressions.
M1 · Documentation (README)6.7 / 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 documentation7.0 / 10Strong✓ 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.

  • 1 ADR-shaped document(s) detected by content — `docs/dwg-import-plan.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.

What to do

  • Move ADRs under docs/adr/ (or docs/adrs/) and name them NNNN-title.md so they're easy to find.
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 accuracy10.0 / 10Exemplary○ Nothing flagged

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.

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.

P2 · Observability0.0 / 10Critical✓ 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.

  • No logging call was found in the 513 JavaScript/TypeScript production file(s) this check read across 8 module(s). Each was searched for its ecosystem's logging libraries (JavaScript/TypeScript: pino, winston, bunyan, log4js, loglevel, consola, the NestJS Logger) and for a call on a receiver named `log`/`logger` (or ending in `Logger`/`_logger`) with a level verb. It cannot see logging through a repo-local wrapper named otherwise, or in source it did not read — this is 'no logging found by this walk', not a verdict that nothing here logs. If it is right, production issues will be hard to diagnose.

What to do

  • Adopt pino (or winston) and log at meaningful points in the services you run.
  • Add a health-check endpoint (@godaddy/terminus or a /health route) so orchestrators and load balancers can probe liveness/readiness.
P3 · Security & performance tooling7.0 / 10Strong✓ 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` schedules updates, but no `package-ecosystem` entry covers `npm`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list. — REDACTED:4

What to do

  • Dependabot is configured but does not watch `npm` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

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

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

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from 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.

R1 · Type Safety8.6 / 10Strong✓ 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 Duplication7.3 / 10Strong✓ 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.

  • 38 duplicated blocks under the repository root have copies in at least two of the sibling directories apps, packages, scripts — 31 of them are reported below, and 7 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 38 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 38 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 38 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. — apps/web/src/sheetsync/xlsx.ts:12
  • 38 duplicated blocks under apps/web/src/ have copies in at least two of the sibling directories assemblies, cad, columns, compare, components, desktop (+18 more sibling(s) not listed) — 29 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 38 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 38 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 38 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. — apps/web/src/library/pack.ts:28
  • 8 duplicated blocks under packages/ have copies in at least two of the sibling directories markup, measure, pdf-core, stitch — 5 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 8 and which does not depend on how exactly each block's copies still match. 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. — packages/markup/src/import.ts:36
  • 5 duplicated blocks under apps/web/src/studio/ have copies in at least two of the sibling directories crypto, drive, projects — 1 of them are reported below, and 4 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 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 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 5 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. — apps/web/src/studio/crypto/sealedDrive.ts:56
  • apps/web/src/components/standardsWizard/ChainageStep.tsx:13 · apps/web/src/components/standardsWizard/MatchLineStep.tsx:13 — the two spans are one implementation copied and then locally edited — 1282 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. — apps/web/src/components/standardsWizard/ChainageStep.tsx:13
  • apps/web/src/components/MeasurementsPanel.tsx:407 · apps/web/src/components/SetScaleDialog.tsx:116 — the two spans are one implementation copied and then locally edited — 1004 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. — apps/web/src/components/MeasurementsPanel.tsx:407
  • apps/web/src/components/standardsWizard/CalloutStep.tsx:90 · apps/web/src/components/standardsWizard/MatchLineStep.tsx:54 — the two spans are one implementation copied and then locally edited — 1117 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. — apps/web/src/components/standardsWizard/CalloutStep.tsx:90
  • apps/web/src/components/BulkInsertDialog.tsx:19 · apps/web/src/components/CombineDialog.tsx:17 — the two spans are one implementation copied and then locally edited — 698 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. — apps/web/src/components/BulkInsertDialog.tsx:19
  • apps/web/src/components/ProjectsPanel.tsx:177 · apps/web/src/components/SessionsPanel.tsx:219 — the two spans are one implementation copied and then locally edited — 422 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. — apps/web/src/components/ProjectsPanel.tsx:177
  • apps/web/src/components/ItemsDialog.tsx:14 · apps/web/src/components/ProductListsDialog.tsx:11 — the two spans are one implementation copied and then locally edited — 637 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. — apps/web/src/components/ItemsDialog.tsx:14
  • apps/web/src/components/CommandPalette.tsx:11 · apps/web/src/components/MenuSearch.tsx:17 — the two spans are one implementation copied and then locally edited — 534 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. — apps/web/src/components/CommandPalette.tsx:11
  • apps/web/src/library/pack.ts:28 · apps/web/src/sheets/standards.ts:203 — the two spans are one implementation copied and then locally edited — 437 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. — apps/web/src/library/pack.ts:28
  • packages/markup/src/assemblies.ts:77 · packages/markup/src/estimating.ts:153 — the two spans are one implementation copied and then locally edited — 450 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. — packages/markup/src/assemblies.ts:77
  • apps/web/src/components/AssembliesDialog.tsx:244 · apps/web/src/components/ProductListsDialog.tsx:82 — the two spans are one implementation copied and then locally edited — 439 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. — apps/web/src/components/AssembliesDialog.tsx:244
  • apps/web/src/documents/zip.ts:14 · apps/web/src/sheetsync/xlsx.ts:22 — the two spans are one implementation copied and then locally edited — 464 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. — apps/web/src/documents/zip.ts:14
  • apps/web/src/components/ProjectsPanel.tsx:653 · apps/web/src/components/sessions/SessionDialogs.tsx:481 — 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. — apps/web/src/components/ProjectsPanel.tsx:653
  • apps/web/src/assemblies/countProposals.ts:36 · apps/web/src/assemblies/proposals.ts:29 — 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. — apps/web/src/assemblies/countProposals.ts:36
  • apps/web/src/components/standardsWizard/CalloutStep.tsx:244 · apps/web/src/components/standardsWizard/ChainageStep.tsx:279 — 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. — apps/web/src/components/standardsWizard/CalloutStep.tsx:244
  • apps/web/src/App.tsx:9881 · apps/web/src/App.tsx:10005 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — apps/web/src/App.tsx:9881
  • apps/web/src/components/LabelRegionsPanel.tsx:151 · apps/web/src/components/ScaleRegionsPanel.tsx:54 — the two spans are one implementation copied and then locally edited — 257 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. — apps/web/src/components/LabelRegionsPanel.tsx:151
  • apps/web/src/studio/drive/folder.ts:31 · apps/web/src/studio/drive/folder.ts:124 — the two spans are one implementation copied and then locally edited — 244 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. — apps/web/src/studio/drive/folder.ts:31
  • apps/web/src/components/StepUpDialog.tsx:21 · apps/web/src/components/StepUpDialog.tsx:53 — the two spans are one implementation copied and then locally edited — 278 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. — apps/web/src/components/StepUpDialog.tsx:21
  • apps/web/src/components/PageToolsDialog.tsx:239 · apps/web/src/components/ProcessDialog.tsx:37 — 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. — apps/web/src/components/PageToolsDialog.tsx:239
  • apps/web/src/components/standardsWizard/CalloutStep.tsx:278 · apps/web/src/components/standardsWizard/ChainageStep.tsx:312 · apps/web/src/components/standardsWizard/MatchLineStep.tsx:227 — 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. — apps/web/src/components/standardsWizard/CalloutStep.tsx:278
  • apps/web/src/components/ProductListsDialog.tsx:237 · apps/web/src/components/TemplatesDialog.tsx:122 — 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. — apps/web/src/components/ProductListsDialog.tsx:237
  • apps/web/src/signatures/signatures.ts:12 · apps/web/src/storage/fileGroups.ts:11 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — apps/web/src/signatures/signatures.ts:12
  • apps/web/src/assemblies/csv.ts:4 · REDACTED:774 — 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. — apps/web/src/assemblies/csv.ts:4
  • apps/web/src/components/AssembliesDialog.tsx:131 · apps/web/src/components/ItemsDialog.tsx:32 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — apps/web/src/components/AssembliesDialog.tsx:131
  • scripts/help/clips.cjs:21 · scripts/help/gifs.cjs:23 — 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. — scripts/help/clips.cjs:21
  • scripts/readme/measure-redact-shots.cjs:10 · scripts/readme/takeoff-shots.cjs:13 — the two spans are one implementation copied and then locally edited — 210 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. — scripts/readme/measure-redact-shots.cjs:10
  • apps/web/src/components/BulkInsertDialog.tsx:31 · apps/web/src/components/CombineDialog.tsx:29 · apps/web/src/components/MultiplyDialog.tsx:29 — 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. — apps/web/src/components/BulkInsertDialog.tsx:31
  • apps/web/src/components/MenuBar.tsx:221 · apps/web/src/components/ToolBar.tsx:730 — the two spans are one implementation copied and then locally edited — 106 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. — apps/web/src/components/MenuBar.tsx:221
  • apps/web/src/components/standardsWizard/StandardsWizard.tsx:330 · apps/web/src/components/standardsWizard/StandardsWizard.tsx:356 · apps/web/src/components/standardsWizard/StandardsWizard.tsx:380 — all 3 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — apps/web/src/components/standardsWizard/StandardsWizard.tsx:330
  • apps/web/src/desktop/assistant.ts:413 · apps/web/src/desktop/assistant.ts:688 — all 2 copies are in the same file, 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. — apps/web/src/desktop/assistant.ts:413
  • scripts/help/clips/flow-diagrams.cjs:4 · scripts/help/clips/tables.cjs:5 — 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. — scripts/help/clips/flow-diagrams.cjs:4
  • apps/web/src/components/CountReview.tsx:59 · apps/web/src/components/TakeoffReview.tsx:243 — the two spans are one implementation copied and then locally edited — 140 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. — apps/web/src/components/CountReview.tsx:59
  • apps/web/src/components/PreferencesDialog.tsx:1186 · apps/web/src/components/PreferencesDialog.tsx:1243 — all 2 copies are in the same file, 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. — apps/web/src/components/PreferencesDialog.tsx:1186
  • apps/web/src/components/ToolChest.tsx:391 · apps/web/src/components/ToolChest.tsx:413 — all 2 copies are in the same file, 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. — apps/web/src/components/ToolChest.tsx:391
  • apps/web/src/markup/MarkupTools.ts:5475 · apps/web/src/markup/MarkupTools.ts:5539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — apps/web/src/markup/MarkupTools.ts:5475
  • apps/web/src/studio/drive/DriveSession.ts:936 · apps/web/src/studio/drive/rooms.ts:400 — 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. — apps/web/src/studio/drive/DriveSession.ts:936

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 Boundaries9.6 / 10Exemplary✓ 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.

  • scripts/check-cad-samples.mjs:7 reaches into another package with a relative path (../apps/web/src/cad/convert.ts) — import the package by name instead. — scripts/check-cad-samples.mjs:7
  • scripts/check-cad-samples.mjs:8 reaches into another package with a relative path (../packages/markup/src/pdfExtras.ts) — import the package by name instead. — scripts/check-cad-samples.mjs:8
  • scripts/check-cad-samples.mjs:9 reaches into another package with a relative path (../packages/markup/src/bluebeam.ts) — import the package by name instead. — scripts/check-cad-samples.mjs:9

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 Complexity5.0 / 10Adequate✓ 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.

  • App has cyclomatic complexity 384 and cognitive complexity 306; 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. — apps/web/src/App.tsx:909
  • pointerDown has cyclomatic complexity 253 and cognitive complexity 346; 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. — apps/web/src/markup/MarkupTools.ts:2961
  • fromRaw has cyclomatic complexity 138 and cognitive complexity 206; 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. — packages/markup/src/import.ts:635
  • annotationDict has cyclomatic complexity 138 and cognitive complexity 118; 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. — packages/markup/src/export.ts:865
  • buildCommands has cyclomatic complexity 124 and cognitive complexity 104; 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. — apps/web/src/commands/appCommands.ts:365
  • (anonymous) has cyclomatic complexity 122 and cognitive complexity 284; 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. — apps/web/src/App.tsx:3422
  • sidePanel has cyclomatic complexity 120 and cognitive complexity 113; 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. — apps/web/src/App.tsx:9022
  • exportWithAnnotations has cyclomatic complexity 116 and cognitive complexity 256; 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. — packages/markup/src/export.ts:2064
  • draw has cyclomatic complexity 111 and cognitive complexity 155; 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. — apps/web/src/markup/MarkupTools.ts:2388
  • importAnnotations has cyclomatic complexity 104 and cognitive complexity 191; 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. — packages/markup/src/import.ts:136
  • appearance has cyclomatic complexity 102 and cognitive complexity 212; 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. — packages/markup/src/export.ts:399
  • entityData has cyclomatic complexity 97 and cognitive complexity 109; 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. — apps/web/src/cad/dwg/objects.ts:316
  • pointerMove has cyclomatic complexity 93 and cognitive complexity 153; 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. — apps/web/src/markup/MarkupTools.ts:3386
  • oneValidationUpdate has cyclomatic complexity 91 and cognitive complexity 126; 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:482
  • baseShape has cyclomatic complexity 89 and cognitive complexity 63; 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. — packages/markup/src/geometry.ts:65
  • hover has cyclomatic complexity 87 and cognitive complexity 120; 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. — apps/web/src/markup/MarkupTools.ts:3843
  • (anonymous) has cyclomatic complexity 86 and cognitive complexity 73; 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. — apps/web/src/App.tsx:6885
  • pointerUp has cyclomatic complexity 85 and cognitive complexity 120; 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. — apps/web/src/markup/MarkupTools.ts:3568
  • StyleControls has cyclomatic complexity 83 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 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. — apps/web/src/components/ToolBar.tsx:327
  • parseBtx has cyclomatic complexity 82 and cognitive complexity 101; 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:268
  • cadClick has cyclomatic complexity 79 and cognitive complexity 113; 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. — apps/web/src/markup/cadTools.ts:314
  • multileader has cyclomatic complexity 74 and cognitive complexity 75; 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. — apps/web/src/cad/render.ts:659
  • GeospatialPanel has cyclomatic complexity 69 and cognitive complexity 56; 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. — apps/web/src/components/GeospatialPanel.tsx:72
  • drawMarkup has cyclomatic complexity 66 and cognitive complexity 124; 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. — packages/markup/src/render.ts:358
  • assemble has cyclomatic complexity 66 and cognitive complexity 77; 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. — apps/web/src/cad/dwg/index.ts:126
  • PageNav has cyclomatic complexity 64 and cognitive complexity 53; 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. — apps/web/src/components/PageNav.tsx:68
  • toolStyle has cyclomatic complexity 63 and cognitive complexity 65; 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:577
  • updateField has cyclomatic complexity 61 and cognitive complexity 112; 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:536
  • commitDraft has cyclomatic complexity 61 and cognitive complexity 77; 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. — apps/web/src/markup/MarkupTools.ts:4370
  • toolType has cyclomatic complexity 61 and cognitive complexity 63; 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:488
  • StandardsWizard has cyclomatic complexity 60 and cognitive complexity 49; 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. — apps/web/src/components/standardsWizard/StandardsWizard.tsx:80
  • InSession has cyclomatic complexity 60 and cognitive complexity 48; 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. — apps/web/src/components/SessionsPanel.tsx:352
  • redact has cyclomatic complexity 57 and cognitive complexity 149; 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. — packages/pdf-core/src/worker.ts:1041
  • element has cyclomatic complexity 57 and cognitive complexity 30; 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. — packages/markup/src/xfdf.ts:53
  • archiveAsPdfA has cyclomatic complexity 56 and cognitive complexity 84; 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. — apps/web/src/documents/pdfa.ts:19
  • parseIfc has cyclomatic complexity 56 and cognitive complexity 78; 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. — apps/web/src/geospatial/ifc.ts:186
  • readDxf has cyclomatic complexity 55 and cognitive complexity 92; 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. — apps/web/src/cad/dxf.ts:114
  • (anonymous) has cyclomatic complexity 55 and cognitive complexity 63; 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. — packages/markup/src/import.ts:380
  • MarkupList has cyclomatic complexity 55 and cognitive complexity 51; 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. — apps/web/src/components/MarkupList.tsx:169
  • checkSignatures has cyclomatic complexity 53 and cognitive complexity 99; 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. — apps/web/src/documents/pdfSign.ts:394
R3 · Large Files4.9 / 10Adequate✓ 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.

  • apps/web/src/App.tsx has 11419 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/App.tsx:1
  • apps/web/src/markup/MarkupTools.ts has 5400 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/markup/MarkupTools.ts:1
  • packages/markup/src/export.ts has 2242 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/markup/src/export.ts:1
  • packages/pdf-core/src/worker.ts has 1988 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/pdf-core/src/worker.ts:1
  • apps/web/src/viewer/TileViewer.ts has 1867 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/viewer/TileViewer.ts:1
  • apps/web/src/components/Ribbon.tsx has 1377 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/Ribbon.tsx:1
  • apps/web/src/cad/dwg/objects.ts has 1320 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/cad/dwg/objects.ts:1
  • packages/markup/src/store.ts has 1317 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/markup/src/store.ts:1
  • apps/web/src/components/PreferencesDialog.tsx has 1220 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/PreferencesDialog.tsx:1
  • apps/web/src/components/MarkupList.tsx has 1192 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/MarkupList.tsx:1
  • apps/web/src/studio/drive/DriveSession.ts has 1115 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/studio/drive/DriveSession.ts:1
  • apps/web/src/cad/render.ts has 1106 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/cad/render.ts:1
  • apps/web/src/desktop/assistant.ts has 1101 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/desktop/assistant.ts:1
  • apps/web/src/components/MeasurementsPanel.tsx has 1070 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/MeasurementsPanel.tsx:1
  • REDACTED has 1062 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
  • apps/web/src/components/ProjectsPanel.tsx has 1057 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/ProjectsPanel.tsx:1
  • apps/web/src/components/PropertiesPanel.tsx has 1048 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/PropertiesPanel.tsx:1
  • apps/desktop/src/assistant/message.ts has 1023 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/desktop/src/assistant/message.ts:1
  • packages/markup/src/import.ts has 947 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/markup/src/import.ts:1
  • apps/web/src/studio/drive/onedrive.ts has 933 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/studio/drive/onedrive.ts:1
  • apps/web/src/components/ToolBar.tsx has 835 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/ToolBar.tsx:1
  • apps/web/src/components/LayersPanel.tsx has 829 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/LayersPanel.tsx:1
  • apps/web/src/components/sessions/SessionDialogs.tsx has 801 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/sessions/SessionDialogs.tsx:1
  • packages/markup/src/geometry.ts has 791 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/markup/src/geometry.ts:1
  • apps/web/src/components/ExportDialog.tsx has 770 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/ExportDialog.tsx:1
  • REDACTED has 768 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
  • apps/web/src/components/SessionsPanel.tsx has 767 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/SessionsPanel.tsx:1
  • packages/markup/src/cad.ts has 754 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/markup/src/cad.ts:1
  • apps/web/src/studio/projects/Project.ts has 745 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/studio/projects/Project.ts:1
  • packages/markup/src/render.ts has 736 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/markup/src/render.ts:1
  • apps/web/src/components/standardsWizard/StandardsWizard.tsx has 733 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/standardsWizard/StandardsWizard.tsx:1
  • apps/web/src/documents/pki.ts has 733 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/documents/pki.ts:1
  • apps/web/src/components/MenuBar.tsx has 715 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/MenuBar.tsx:1
  • packages/markup/src/model.ts has 685 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/markup/src/model.ts:1
  • apps/web/src/components/LineStylesDialog.tsx has 675 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/components/LineStylesDialog.tsx:1
  • packages/measure/src/measure.ts has 674 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/measure/src/measure.ts:1
  • REDACTED has 672 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
  • apps/web/src/documents/pdfSign.ts has 671 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/documents/pdfSign.ts:1
  • apps/web/src/commands/appCommands.ts has 638 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/commands/appCommands.ts:1
  • apps/web/src/documents/renderCopy/content.ts has 634 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/web/src/documents/renderCopy/content.ts:1

What to do

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

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

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

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×9) — apps/desktop/scripts/fetch-assistant-node.mjs:1, apps/desktop/src/preload.ts:1, apps/web/src/components/resizablePanel.tsx:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R6 · Tooling6.7 / 10Strong✓ 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.

  • test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.

What to do

  • Add eslint as package.json scripts and run them in CI.
R7 · Dead Code9.1 / 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 185 application, 7 tooling and 296 test entry point(s) detected in this repo. Gate removals on `pnpm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (185 application, 7 tooling, 296 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 (×10) — apps/desktop/src/preload.ts, apps/web/src/components/resizablePanel.tsx, scripts/check-cad-samples.mjs, …
  • no import path from any entry point (185 application, 7 tooling, 296 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/assistant/mcp-cli.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — apps/desktop/src/assistant/stdio.ts
  • Nothing imports this binding — it is safe to review for removal. (×12) — apps/desktop/src/navigation.ts:2, apps/web/src/assemblies/quantities.ts:243, apps/web/src/cad/drawing.ts:167, …
  • This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×3) — apps/web/src/components/ProjectsPanel.tsx:60, apps/web/src/components/sessions/SessionDialogs.tsx:29, apps/web/src/studio/drive/DriveSession.test.ts:305

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 Hygiene2.5 / 10Weak✓ 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.

  • Imported but not declared in any reachable package.json — installs work only by hoisting accident. (×2) — apps/web/test/browser/csp.cjs:6, apps/web/vite.config.ts:25
  • Declared in apps/web/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. (×7) — apps/web/package.json:23, apps/web/package.json:24, apps/web/package.json:25, …

What to do

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

  • apps/web/src/cad/dwg/container.ts → apps/web/src/cad/dwg/r2007.ts → apps/web/src/cad/dwg/container.ts — apps/web/src/cad/dwg/container.ts:4
  • apps/web/src/desktop/assistant.ts → apps/web/src/desktop/assistantScales.ts → apps/web/src/desktop/assistant.ts (one verified cycle inside a mutually-dependent group of 6 files) — apps/web/src/desktop/assistant.ts:5
  • apps/web/src/geospatial/dxf.ts → apps/web/src/geospatial/model.ts → apps/web/src/geospatial/dxf.ts (one verified cycle inside a mutually-dependent group of 3 files) — apps/web/src/geospatial/dxf.ts:1
  • packages/sheets/src/detect.ts → packages/sheets/src/standard.ts → packages/sheets/src/detect.ts — packages/sheets/src/detect.ts:1

What to do

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

Other · Security — Read from this repository's JavaScript/TypeScript source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. Of the server controls, two are read where the source shows them: every session or sign-in cookie the code sets is read for HttpOnly, Secure and SameSite at the line that sets it (a raw `Set-Cookie` header, Express, Fastify, Hono, Koa, Next.js, `cookie.serialize`, express-session and cookie-session), and every Node listener for HTTPS enforcement. HSTS, security response headers and input validation are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. 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.

  • MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. — REDACTED:33

What to do

  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key.
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 stream4.3 / 10Weak✓ Tool-verified

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.

  • `spawn` pipes both `stdout` and `stderr` here — it is given no `stdio` option, or `'pipe'` — and the parent waits for the child's end while nothing consumes either: nothing in this scope ever reads `child.stdout` or `child.stderr`. Node holds an unread pipe's output only up to its buffer: once the child writes more than that to either stream (measured on Linux: about 128 KB — the 64 KB pipe plus Node's 64 KB read-ahead — and less elsewhere), the child blocks on the write, never exits, and the `close`/`exit` this code waits for never fires. Nothing fails loudly: the promise never settles and the stuck child holds its resources until something kills it. Consume both streams before the wait (`.on('data', …)`, or `.resume()` to discard one), or stop piping what you do not want — `stdio: 'ignore'`, `'inherit'`, or those values in its slots. — apps/desktop/src/print.ts:131

What to do

  • Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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

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

X16 · Unfloored truncation loop8.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. 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 `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

  • `v` loses its last character (its last element, if it holds an array) on every pass — `v = v.slice(0, -1)` on line 147 — and the loop's only exit is the test on line 147 — which measures `v` only through `enc.encode(…).length`, as a TERM of a larger expression, and never compares its length against a bound of its own. So nothing stops the loop at one character: it runs until the test's other terms come under the bound WITHOUT any help from `v`, which leaves `v` empty — and if they never do, the loop never ends, because JavaScript's `slice`/`substring`/`substr`/`replace` hand back `""` for an empty value instead of throwing, so every later pass shortens nothing and the test never changes. Neither outcome announces itself: an empty value surfaces later, as a path that names no file, a key that matches nothing, or a record written blank — and a hang surfaces as a frozen tab or a request that never returns. Give the loop a floor (`&& v.length > 1`), or compute the length once and clamp it (`v = v.slice(0, Math.max(1, budget))`) — and decide explicitly what should happen when the budget cannot be met, rather than letting an empty value be the answer. — apps/web/src/studio/drive/DriveSession.ts:147

What to do

  • Each finding names the loop's exit test and the statement that shortens the value. Confirm from the two that nothing bounds the length below, then give the loop a floor and decide — out loud — what should happen when the budget cannot be met: truncating to nothing is a silent answer to that question.
X17 · Uncapped recursion over a caller-supplied document2.0 / 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.

  • `readBsiLegend` is exported, takes a document from its caller (line 175) and hands it to `plain`, which calls itself at line 169 (`plain`) with a piece of `v` (and at line 170) — and nowhere in `plain` 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. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `plain` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/markup/src/bsiLegend.ts:169
  • `readLineStyle` is exported, takes a document from its caller (line 41) and hands it to `plain`, which calls itself at line 43 (`plain`) with a piece of `v` — and nowhere in `plain` 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. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `plain` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/markup/src/lineStyle.ts:43
  • `canonical` is exported and takes `value: unknown` from its caller, and it calls itself at line 206 (`canonical`) with a piece of `value` (and at line 211) — and nowhere in `canonical` 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. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonical` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — apps/web/src/studio/crypto/keys.ts:206
  • `descendants` is exported and takes `el: XmlElement` from its caller, and it calls itself at line 101 (`descendants`) with a piece of `el` — and nowhere in `descendants` 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. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `descendants` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — apps/web/src/geospatial/xml.ts:101

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.
X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

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

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

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

X2 · Cancellation propagation7.3 / 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 10/18 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.
  • `runButton` 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 })`. — apps/web/src/App.tsx:3927
  • `readJson` 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 })`. — apps/web/src/studio/drive/onedrive.ts:674
  • `upload` 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 })`. — apps/web/src/studio/drive/onedrive.ts:774
  • `downloadOcr` 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 })`. — apps/web/src/offline/ocrCache.ts:49
  • `loadTip` 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 })`. — apps/web/src/components/StartScreen.tsx:32
  • `fonts` 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 })`. — apps/web/src/cad/convert.worker.ts:18
  • `postForm` 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 })`. — apps/desktop/src/auth.ts:34
  • `microsoftUser` 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 })`. — apps/desktop/src/auth.ts:193

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.

X24 · Document value interpolated into markup unescaped6.9 / 10Strong✓ Tool-verified

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.

  • `encodeURI(path.basename(p.file))` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — apps/desktop/src/print.ts:50
  • `html(blocks(md.replace(/\r/g,'').split('\n')))` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — apps/web/public/help/help.js:233
  • `html('<h1>'+esc(p.title)+'</h1><p class="missing">This page could not be loaded. If you are offline, open it once whi…` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — apps/web/public/help/help.js:235
  • `html((prev?'<a class="prev" href="#'+prev.id+'"><small>← Previous</small>'+esc(prev.title)+'</a>':'')+(next?'<a class…` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — apps/web/public/help/help.js:241
  • `html(renderToc(TOC,[]))` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — apps/web/public/help/help.js:298
  • `html(hits.length?hits.slice(0,40).map((h)=>'<a class="hit" href="#'+h.p.id+'"><b>'+esc(h.p.title)+'</b><small>'+esc(h…` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — apps/web/public/help/help.js:350
  • `xml(file)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path. — REDACTED:717
  • `root` is text this program did not author, and it is written into an unquoted attribute through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML text encoding does not help in an unquoted attribute — whitespace ends it; quote the attribute and encode the value. — packages/markup/src/setCategories.ts:43

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
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.

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

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

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

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling5.0 / 10Adequate✓ Tool-verified

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

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

  • `.catch(() => {})` 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. (×11) — packages/pdf-core/src/engine.ts:105, packages/pdf-core/src/worker.ts:497, apps/web/src/App.tsx:5081, …
  • 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. (×28) — packages/markup/src/bluebeam.ts:385, packages/markup/src/import.ts:333, packages/markup/src/render.ts:163, …
  • `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. — apps/web/src/App.tsx:3196

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.

X5 · Nullable reference types6.0 / 10Adequate✓ 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.

  • ~23.5 `!` null assertions per 1k TypeScript source lines — 3191 assertion(s) across the 135537 source line(s) of the 507 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: apps/web/src/markup/MarkupTools.ts (170), apps/web/src/App.tsx (151), packages/pdf-core/src/worker.ts (137). 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 Health57.3Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture60.1Adequate — gated by R9Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity70.0Adequate — gated by D15Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness44.0Adequate — gated by R8, P2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security71.1Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility50.7Adequate — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance100.0ExemplaryStrongest area.
Unscored — 3 check(s) recorded observations but carry no score

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

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

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

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 44 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 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.
  • AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • 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 — the dev server (`npm run dev`) exited before it served a page. Likely cause (our sandbox): a program the dev server needs is not installed in our sandbox image. This is a limit of our sandbox, not of your repository. Last output: "> dev / > pnpm --filter @nb/web dev / sh: 1: pnpm: not found" No runtime evidence was gathered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no data at rest for these controls to protect. If it does persist personal data (through a hosted backend configured outside this repository, for instance), the controls belong to wherever that data is stored.
  • C2 Access Controls — No access-control surface detected in the analyzed source — this repository stands up no server (no Express, Fastify, Koa, Hono, NestJS or similar app, no Next.js/SvelteKit/Nuxt server route, no edge function), creates no Supabase tables and talks to no hosted backend. Access control is therefore N/A here — a browser application or library is authorized by the server it calls, not by itself; a client-side route guard hides a page and authorizes nothing. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a hosted backend 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, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound. If it does (through a hosted backend configured outside this repository, for instance), the limit belongs wherever that data is stored.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over. If it does (through a hosted backend configured outside this repository, for instance), the rights are served wherever that data is stored.
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — 11 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.
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
  • 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
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage data present for 43 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • 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.
  • 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
  • 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
  • X23 Unguarded diagnostic materialisation — 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: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
  • X27 Collection changed while being enumerated — Not applicable: this check looks for a loop whose body adds to or removes from the very collection the loop is walking, invalidating the enumerator it holds, and in this repository's languages that cannot happen. JavaScript and TypeScript have no iterator that a change can invalidate: an `Array` is walked by index against its live length, and a `Map` or `Set` by the ECMAScript specification's live entry list, so a body that adds to, removes from or empties what it walks raises nothing — every loop form (`for…of`, `for…in`, `forEach`, `map`, `filter`, `reduce`, `entries()`) on every built-in collection (`Array`, `Map`, `Set`, plain objects, `URLSearchParams`, `Headers`, `FormData`) runs to completion. Such a loop can still skip an element or never end, which is a different defect and not the one this check asks about. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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 — 67 finding(s)
AC2 · Forms & labels · <input> without a programmatic label · ×17
  • <input> without a programmatic label apps/web/src/components/AskText.tsx:73 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/web/src/components/CalibrateDialog.tsx:74 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/web/src/components/ColumnsDialog.tsx:334 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/web/src/components/ColumnsDialog.tsx:352 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/web/src/components/ColumnsDialog.tsx:496 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/web/src/components/ColumnsDialog.tsx:497 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/web/src/components/FormsPanel.tsx:47 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/web/src/components/GeospatialPanel.tsx:568 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/web/src/components/InlineName.tsx:7 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/web/src/components/MarkupList.tsx:698 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/web/src/components/MarkupList.tsx:714 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/web/src/components/ProcessDialog.tsx:106 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/web/src/components/PropertiesPanel.tsx:279 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/web/src/components/PropertiesPanel.tsx:403 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/web/src/components/PropertiesPanel.tsx:408 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/web/src/components/PropertiesPanel.tsx:1001 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/web/src/components/PropertiesPanel.tsx:1057 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
AC2 · Forms & labels · <select> without a programmatic label · ×11
  • <select> without a programmatic label apps/web/src/components/CalibrateDialog.tsx:81 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/web/src/components/FieldEditor.tsx:54 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/web/src/components/FormsPanel.tsx:50 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/web/src/components/FormsPanel.tsx:61 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/web/src/components/LineStyleSelect.tsx:40 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/web/src/components/MarkupList.tsx:593 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/web/src/components/MarkupList.tsx:687 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/web/src/components/MarkupList.tsx:746 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/web/src/components/PropertiesPanel.tsx:393 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/web/src/components/PropertiesPanel.tsx:979 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/web/src/components/PublishDialog.tsx:83 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels · <textarea> without a programmatic label · ×5
  • <textarea> without a programmatic label apps/web/src/components/ColumnsDialog.tsx:380 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label apps/web/src/components/CommentDialog.tsx:27 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label apps/web/src/components/MarkupList.tsx:119 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label apps/web/src/components/MarkupList.tsx:701 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label apps/web/src/components/PropertiesPanel.tsx:405 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC4 · Keyboard semantics · Clickable element isn't keyboard-operable · ×5
  • Clickable element isn't keyboard-operable apps/web/src/App.tsx:6724 — The repo's own CSS styles .doc-tab with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Clickable element isn't keyboard-operable apps/web/src/components/BookmarksPanel.tsx:221 — The repo's own CSS styles .twisty with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Clickable element isn't keyboard-operable apps/web/src/components/ColorMenu.tsx:112 — The repo's own CSS styles .color-swatch with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Clickable element isn't keyboard-operable apps/web/src/components/LayersPanel.tsx:722 — The repo's own CSS styles .layer-twisty-space with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Clickable element isn't keyboard-operable apps/web/src/components/LinksPanel.tsx:115 — The repo's own CSS styles .link-row with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
D30 · Dependency Vulnerabilities · High CVE · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R9 · Circular Imports · Import cycle (2 files) · ×4
  • Import cycle (2 files) apps/web/src/cad/dwg/container.ts:4 — apps/web/src/cad/dwg/container.ts → apps/web/src/cad/dwg/r2007.ts → apps/web/src/cad/dwg/container.ts
  • Import cycle (2 files) apps/web/src/desktop/assistant.ts:5 — apps/web/src/desktop/assistant.ts → apps/web/src/desktop/assistantScales.ts → apps/web/src/desktop/assistant.ts (one verified cycle inside a mutually-dependent group of 6 files)
  • Import cycle (2 files) apps/web/src/geospatial/dxf.ts:1 — apps/web/src/geospatial/dxf.ts → apps/web/src/geospatial/model.ts → apps/web/src/geospatial/dxf.ts (one verified cycle inside a mutually-dependent group of 3 files)
  • Import cycle (2 files) packages/sheets/src/detect.ts:1 — packages/sheets/src/detect.ts → packages/sheets/src/standard.ts → packages/sheets/src/detect.ts
AC4 · Keyboard semantics · Click handler on a non-interactive <tr> · ×3
  • Click handler on a non-interactive <tr> apps/web/src/components/ExportDialog.tsx:340 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <tr> apps/web/src/components/LayersPanel.tsx:684 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <tr> apps/web/src/components/MarkupList.tsx:976 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
AC4 · Keyboard semantics · Clickable role="separator" that no keyboard user can reach · ×2
  • Clickable role="separator" that no keyboard user can reach apps/web/src/App.tsx:9602 — This <div> announces itself as a role="separator" and is operated by pointerdown, but nothing can put focus on it: no tabIndex={0}, no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabIndex={0}="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds).
  • Clickable role="separator" that no keyboard user can reach apps/web/src/App.tsx:9993 — This <div> announces itself as a role="separator" and is operated by pointerdown, but nothing can put focus on it: no tabIndex={0}, no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabIndex={0}="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds).
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×2
  • Click handler on a non-interactive <div> apps/web/src/App.tsx:9946 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> apps/web/src/App.tsx:9951 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
AC4 · Keyboard semantics · Clickable role="option" that no keyboard user can reach · ×2
  • Clickable role="option" that no keyboard user can reach apps/web/src/components/BulkInsertDialog.tsx:51 — This <li> announces itself as a role="option" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="option" or point aria-activedescendant at it.
  • Clickable role="option" that no keyboard user can reach apps/web/src/components/CombineDialog.tsx:49 — This <li> announces itself as a role="option" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="option" or point aria-activedescendant at it.
AC2 · Forms & labels · <label> that labels no control · ×1
  • <label> that labels no control apps/web/src/components/PublishDialog.tsx:82 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC4 · Keyboard semantics · Double-click handler on a non-interactive <div> · ×1
  • Double-click handler on a non-interactive <div> apps/web/src/components/LinkPreview.tsx:240 — This <div> binds pointerdown, pointerup, pointermove and double-click — pointer gestures with no keyboard form, a double-click among them. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
AC4 · Keyboard semantics · Click handler on a non-interactive <th> · ×1
  • Click handler on a non-interactive <th> apps/web/src/components/MarkupList.tsx:907 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
AC4 · Keyboard semantics · Double-click handler on a non-interactive <span> · ×1
  • Double-click handler on a non-interactive <span> apps/web/src/components/PagesPanel.tsx:332 — This <span> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
D13 · Secret Scanning · Leaked 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
R8 · Dependency Hygiene · Unlisted import 'playwright' · ×1
  • Unlisted import 'playwright' apps/web/test/browser/csp.cjs:6 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'tesseract.js-core' · ×1
  • Unlisted import 'tesseract.js-core' apps/web/vite.config.ts:25 — Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Serious — 1519 finding(s)
D3 · God Classes · FunctionTooLong · ×99
  • FunctionTooLong: export.escapeXml packages/markup/src/export.ts:148 — FunctionTooLong — escapeXml runs 805 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 705 over it, 8.05× 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: PreferencesDialog.PreferencesDialog apps/web/src/components/PreferencesDialog.tsx:215 — FunctionTooLong — PreferencesDialog runs 774 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 674 over it, 7.74× 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: Ribbon.Ribbon apps/web/src/components/Ribbon.tsx:607 — FunctionTooLong — Ribbon runs 677 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 577 over it, 6.77× 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: MenuBar.MenuBar apps/web/src/components/MenuBar.tsx:221 — FunctionTooLong — MenuBar runs 478 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 378 over it, 4.78× 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: ColumnsDialog.ColumnsDialog apps/web/src/components/ColumnsDialog.tsx:64 — FunctionTooLong — ColumnsDialog runs 458 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 358 over it, 4.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: starters.starterGroups apps/web/src/assemblies/starters.ts:25 — FunctionTooLong — starterGroups runs 428 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 328 over it, 4.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: GeospatialPanel.GeospatialPanel apps/web/src/components/GeospatialPanel.tsx:72 — FunctionTooLong — GeospatialPanel runs 397 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 297 over it, 3.97× 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: AssembliesDialog.AssembliesDialog apps/web/src/components/AssembliesDialog.tsx:153 — FunctionTooLong — AssembliesDialog runs 394 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 294 over it, 3.94× 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: BatchDialog.BatchDialog apps/web/src/components/BatchDialog.tsx:142 — FunctionTooLong — BatchDialog 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: StandardsWizard.StandardsWizard apps/web/src/components/standardsWizard/StandardsWizard.tsx:80 — FunctionTooLong — StandardsWizard runs 338 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 238 over it, 3.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: MeasurementsPanel.PageScale apps/web/src/components/MeasurementsPanel.tsx:250 — FunctionTooLong — PageScale runs 336 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 236 over it, 3.36× 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: CompareDialog.CompareDialog apps/web/src/components/CompareDialog.tsx:57 — FunctionTooLong — CompareDialog runs 332 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 232 over it, 3.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: SetsPanel.SetsPanel apps/web/src/components/SetsPanel.tsx:51 — FunctionTooLong — SetsPanel runs 328 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 228 over it, 3.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: SearchPanel.SearchPanel apps/web/src/components/SearchPanel.tsx:122 — FunctionTooLong — SearchPanel runs 327 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 227 over it, 3.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: objects.entityData apps/web/src/cad/dwg/objects.ts:316 — FunctionTooLong — entityData runs 302 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 202 over it, 3.02× 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: ifc.parseIfc apps/web/src/geospatial/ifc.ts:186 — FunctionTooLong — parseIfc runs 302 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 202 over it, 3.02× 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: import.importAnnotations packages/markup/src/import.ts:136 — FunctionTooLong — importAnnotations runs 295 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 195 over it, 2.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: export.annotationDict packages/markup/src/export.ts:865 — FunctionTooLong — annotationDict runs 291 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 191 over it, 2.91× 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: export.appearance packages/markup/src/export.ts:399 — FunctionTooLong — appearance runs 278 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 178 over it, 2.78× 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: appCommands.buildCommands apps/web/src/commands/appCommands.ts:365 — FunctionTooLong — buildCommands runs 277 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× 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: ProjectsPanel.ProjectView apps/web/src/components/ProjectsPanel.tsx:325 — FunctionTooLong — ProjectView runs 267 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 167 over it, 2.67× 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: ProfilesDialog.ProfilesDialog apps/web/src/components/ProfilesDialog.tsx:101 — FunctionTooLong — ProfilesDialog runs 259 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 159 over it, 2.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: FormsPanel.Properties apps/web/src/components/FormsPanel.tsx:90 — FunctionTooLong — Properties runs 247 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 147 over it, 2.47× 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: SessionsPanel.InSession apps/web/src/components/SessionsPanel.tsx:352 — FunctionTooLong — InSession runs 247 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 147 over it, 2.47× 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: import.fromRaw packages/markup/src/import.ts:635 — FunctionTooLong — fromRaw runs 236 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 136 over it, 2.36× 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.
  • + 74 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×85
  • Hotspot: apps/web/src/App.tsx apps/web/src/App.tsx:909 — apps/web/src/App.tsx changed 217 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 2991 in App.App at line 909. 8 of those changes were fix/bug commits, and the other 209 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/App.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: apps/web/src/markup/MarkupTools.ts apps/web/src/markup/MarkupTools.ts:2961 — apps/web/src/markup/MarkupTools.ts changed 73 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 249 in MarkupTools.pointerDown at line 2961. 2 of those changes were fix/bug commits, and the other 71 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/markup/MarkupTools.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: apps/web/src/commands/appCommands.ts apps/web/src/commands/appCommands.ts:365 — apps/web/src/commands/appCommands.ts changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 142 in appCommands.buildCommands at line 365. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/commands/appCommands.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: packages/markup/src/export.ts packages/markup/src/export.ts:2064 — packages/markup/src/export.ts changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 129 in export.exportWithAnnotations at line 2064. 2 of those changes were fix/bug commits, and the other 51 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- packages/markup/src/export.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: apps/web/src/components/MarkupList.tsx apps/web/src/components/MarkupList.tsx:169 — apps/web/src/components/MarkupList.tsx changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 294 in MarkupList.MarkupList at line 169. 2 of those changes were fix/bug commits, and the other 19 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/components/MarkupList.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: apps/web/src/components/PreferencesDialog.tsx apps/web/src/components/PreferencesDialog.tsx:215 — apps/web/src/components/PreferencesDialog.tsx changed 41 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 107 in PreferencesDialog.PreferencesDialog at line 215. 2 of those changes were fix/bug commits, and the other 39 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/components/PreferencesDialog.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: packages/markup/src/import.ts packages/markup/src/import.ts:136 — packages/markup/src/import.ts changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 182 in import.importAnnotations at line 136. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- packages/markup/src/import.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: apps/web/src/components/ToolBar.tsx apps/web/src/components/ToolBar.tsx:327 — apps/web/src/components/ToolBar.tsx changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 89 in ToolBar.StyleControls at line 327. 2 of those changes were fix/bug commits, and the other 29 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/components/ToolBar.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: apps/desktop/src/main.ts apps/desktop/src/main.ts:80 — apps/desktop/src/main.ts changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 98 in main.start at line 80. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/desktop/src/main.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: packages/markup/src/geometry.ts packages/markup/src/geometry.ts:65 — packages/markup/src/geometry.ts changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 91 in geometry.baseShape at line 65. 1 of those changes was a fix/bug commit, 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- packages/markup/src/geometry.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: packages/markup/src/render.ts packages/markup/src/render.ts:358 — packages/markup/src/render.ts changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in render.drawMarkup at line 358. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- packages/markup/src/render.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: apps/web/src/components/PropertiesPanel.tsx apps/web/src/components/PropertiesPanel.tsx:63 — apps/web/src/components/PropertiesPanel.tsx changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in PropertiesPanel.PropertiesPanel at line 63. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/components/PropertiesPanel.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: apps/web/src/components/SessionsPanel.tsx apps/web/src/components/SessionsPanel.tsx:352 — apps/web/src/components/SessionsPanel.tsx changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in SessionsPanel.InSession at line 352. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/components/SessionsPanel.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: apps/web/src/components/MenuBar.tsx apps/web/src/components/MenuBar.tsx:221 — apps/web/src/components/MenuBar.tsx changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in MenuBar.MenuBar at line 221. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/components/MenuBar.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: apps/web/src/components/Ribbon.tsx apps/web/src/components/Ribbon.tsx:607 — apps/web/src/components/Ribbon.tsx changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in Ribbon.Ribbon at line 607. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/components/Ribbon.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: packages/pdf-core/src/worker.ts packages/pdf-core/src/worker.ts:1041 — packages/pdf-core/src/worker.ts changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in worker.redact at line 1041. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- packages/pdf-core/src/worker.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: packages/markup/src/store.ts packages/markup/src/store.ts:1340 — packages/markup/src/store.ts changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in store.describeChange at line 1340. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- packages/markup/src/store.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: apps/web/src/components/ProjectsPanel.tsx apps/web/src/components/ProjectsPanel.tsx:759 — apps/web/src/components/ProjectsPanel.tsx changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in ProjectsPanel.FileActions at line 759. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/components/ProjectsPanel.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:268 — REDACTED changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in toolchest.parseBtx at line 268. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --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: apps/web/src/viewer/TileViewer.ts apps/web/src/viewer/TileViewer.ts:1054 — apps/web/src/viewer/TileViewer.ts changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in TileViewer.draw at line 1054. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/viewer/TileViewer.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: apps/web/src/components/PagesPanel.tsx apps/web/src/components/PagesPanel.tsx:390 — apps/web/src/components/PagesPanel.tsx changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in PagesPanel.PagesPanel at line 390. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/components/PagesPanel.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: apps/web/src/columns/listColumns.ts apps/web/src/columns/listColumns.ts:186 — apps/web/src/columns/listColumns.ts changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in listColumns.cellsFor at line 186. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/columns/listColumns.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: apps/web/src/components/BatchDialog.tsx apps/web/src/components/BatchDialog.tsx:142 — apps/web/src/components/BatchDialog.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in BatchDialog.BatchDialog at line 142. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- apps/web/src/components/BatchDialog.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: packages/markup/src/bluebeam.ts packages/markup/src/bluebeam.ts:134 — packages/markup/src/bluebeam.ts changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in bluebeam.parseDefaultStyle at line 134. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --full-history --no-merges -- packages/markup/src/bluebeam.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:52 — REDACTED changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in DigitalSignatures.DigitalSignaturesSection 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 21:39:50 +11:00' --until='2026-11-16 21:39:50 +11:00' --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.
  • + 60 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×39
  • FileTooLong: src/App.tsx apps/web/src/App.tsx — FileTooLong — 9072 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 8572 over it, 18.14× 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: markup/MarkupTools.ts apps/web/src/markup/MarkupTools.ts — FileTooLong — 3979 significant lines (blank, comment-only and punctuation-only lines excluded), about 77% of them inside a single declaration: MarkupTools (620-4991). The bar is 500 significant lines; this is 3479 over it, 7.96× 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: src/export.ts packages/markup/src/export.ts — FileTooLong — 1651 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1151 over it, 3.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: src/worker.ts packages/pdf-core/src/worker.ts — FileTooLong — 1517 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1017 over it, 3.03× 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: viewer/TileViewer.ts apps/web/src/viewer/TileViewer.ts — FileTooLong — 1387 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: TileViewer (240-2020). The bar is 500 significant lines; this is 887 over it, 2.77× 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: components/Ribbon.tsx apps/web/src/components/Ribbon.tsx — FileTooLong — 1222 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 722 over it, 2.44× 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: dwg/objects.ts apps/web/src/cad/dwg/objects.ts — FileTooLong — 1094 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 594 over it, 2.19× 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: components/PreferencesDialog.tsx apps/web/src/components/PreferencesDialog.tsx — FileTooLong — 1025 significant lines (blank, comment-only and punctuation-only lines excluded), about 76% of them inside a single declaration: PreferencesDialog (215-1134). The bar is 500 significant lines; this is 525 over it, 2.05× 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: components/MarkupList.tsx apps/web/src/components/MarkupList.tsx — FileTooLong — 974 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: lineKey (153-1194). The bar is 500 significant lines; this is 474 over it, 1.95× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: components/MeasurementsPanel.tsx apps/web/src/components/MeasurementsPanel.tsx — FileTooLong — 918 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 418 over it, 1.84× 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: components/ProjectsPanel.tsx apps/web/src/components/ProjectsPanel.tsx — FileTooLong — 897 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 397 over it, 1.79× 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: components/PropertiesPanel.tsx apps/web/src/components/PropertiesPanel.tsx — FileTooLong — 887 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 387 over it, 1.77× 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: src/store.ts packages/markup/src/store.ts — FileTooLong — 884 significant lines (blank, comment-only and punctuation-only lines excluded), about 83% of them inside a single declaration: MarkupStore (146-1337). The bar is 500 significant lines; this is 384 over it, 1.77× 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: desktop/assistant.ts apps/web/src/desktop/assistant.ts — FileTooLong — 873 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 373 over it, 1.75× 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: cad/render.ts apps/web/src/cad/render.ts — FileTooLong — 871 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 371 over it, 1.74× 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: drive/DriveSession.ts apps/web/src/studio/drive/DriveSession.ts — FileTooLong — 832 significant lines (blank, comment-only and punctuation-only lines excluded), about 87% of them inside a single declaration: MISSING_KEY (200-1203). The bar is 500 significant lines; this is 332 over it, 1.66× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 830 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 330 over it, 1.66× 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: assistant/message.ts apps/desktop/src/assistant/message.ts — FileTooLong — 783 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 283 over it, 1.57× 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: src/import.ts packages/markup/src/import.ts — FileTooLong — 719 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 219 over it, 1.44× 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: sessions/SessionDialogs.tsx apps/web/src/components/sessions/SessionDialogs.tsx — FileTooLong — 696 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 196 over it, 1.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: components/ExportDialog.tsx apps/web/src/components/ExportDialog.tsx — FileTooLong — 677 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 177 over it, 1.35× 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: components/ToolBar.tsx apps/web/src/components/ToolBar.tsx — FileTooLong — 668 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 168 over it, 1.34× 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: components/LayersPanel.tsx apps/web/src/components/LayersPanel.tsx — FileTooLong — 663 significant lines (blank, comment-only and punctuation-only lines excluded), about 73% of them inside a single declaration: pdfKey (154-768). The bar is 500 significant lines; this is 163 over it, 1.33× 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: components/SessionsPanel.tsx apps/web/src/components/SessionsPanel.tsx — FileTooLong — 658 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 158 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: components/MenuBar.tsx apps/web/src/components/MenuBar.tsx — FileTooLong — 642 significant lines (blank, comment-only and punctuation-only lines excluded), about 74% of them inside a single declaration: MenuBar (221-734). The bar is 500 significant lines; this is 142 over it, 1.28× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • + 14 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×39
  • Swallowed exception (empty catch) packages/pdf-core/src/engine.ts:105 — `.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) packages/pdf-core/src/worker.ts:497 — `.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) packages/markup/src/bluebeam.ts:385 — 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) packages/markup/src/import.ts:333 — 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) packages/markup/src/render.ts:163 — 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:380 — 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:658 — 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:707 — 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) packages/markup/src/xfdf.ts:272 — 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) apps/web/src/App.tsx:359 — 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) apps/web/src/App.tsx:500 — 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) apps/web/src/App.tsx:539 — 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) apps/web/src/App.tsx:1032 — 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) apps/web/src/App.tsx:1056 — 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) apps/web/src/App.tsx:2109 — 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) apps/web/src/App.tsx:2185 — 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) apps/web/src/App.tsx:2244 — 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) apps/web/src/App.tsx:3827 — 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) apps/web/src/App.tsx:4010 — 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) apps/web/src/App.tsx:4373 — 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) apps/web/src/App.tsx:5081 — `.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) apps/web/src/App.tsx:5108 — `.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) apps/web/src/App.tsx:5989 — `.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) apps/web/src/App.tsx:6478 — 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) apps/web/src/App.tsx:6488 — 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.
  • + 14 more in this group — see findings.md.
AC4 · Keyboard semantics · Modal dialog does not manage focus · ×23
  • Modal dialog does not manage focus apps/web/src/components/AskText.tsx:45 — This <form role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/AssembliesDialog.tsx:238 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/AssemblyInputs.tsx:79 — This <form role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/AssistantConfirmDialog.tsx:21 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/ColorMenu.tsx:108 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/ColumnsDialog.tsx:170 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/CommandPalette.tsx:52 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/CommentDialog.tsx:16 — This <form role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/CommentsTableDialog.tsx:38 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/CountToolDialog.tsx:20 — This <form role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/DeletePagesDialog.tsx:41 — This <form role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/EraseRegionsPanel.tsx:81 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/ExportDialog.tsx:308 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/FormulaBuilder.tsx:75 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/InstallDialog.tsx:12 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/ItemsDialog.tsx:82 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/LabelRegionsPanel.tsx:73 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/LibraryDialog.tsx:72 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/LineStylesDialog.tsx:355 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/LineStylesDialog.tsx:496 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/LinkPreview.tsx:211 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/ManualQuantityDialog.tsx:42 — This <form role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus apps/web/src/components/MeasurementsPanel.tsx:497 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
D10 · Test Quality · No assertions · ×13
  • No assertions: a document with unsaved markups moves with them, still unsaved e2e/specs/detach.spec.ts:28 — 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: document.bulkInsertPages puts several PDFs after the current page e2e/specs/document.spec.ts:104 — 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: document.insertBlank adds pages the size of the current one e2e/specs/document.spec.ts:114 — 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: document.insertBlank: a Letter page at the end e2e/specs/document.spec.ts:124 — 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: document.cropPages crops margins off the current page e2e/specs/document.spec.ts:191 — 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 smaller thumbnail size stacks the thumbnails in more columns e2e/specs/document.spec.ts:396 — 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: Layers columns resize from their header edges and keep the width e2e/specs/layers-panel-resize.spec.ts:29 — 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 Tool Chest tool is saved back with its edited subject e2e/specs/markup-identity.spec.ts:93 — 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: switching a PDF layer off hides the markups on it, and on again shows them e2e/specs/pdf-layer-markups.spec.ts:21 — 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: Ctrl+Shift+R rotates the page like document.rotatePages e2e/specs/shortcuts.spec.ts:115 — 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: page keys move like the page commands e2e/specs/shortcuts.spec.ts:123 — 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: chainage links: to the cross section at a station, else the plan that covers it; kept once a drawing standard says how e2e/specs/view.spec.ts:173 — 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: full screen e2e/specs/view.spec.ts:357 — 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.
R4 · Test Coverage · No test reaches this file · ×9
  • No test reaches this file apps/desktop/scripts/fetch-assistant-node.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 apps/desktop/src/preload.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 apps/web/src/components/resizablePanel.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 apps/desktop/src/assistant/stdio.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 apps/web/public/sw-share.js: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 apps/web/src/library/writeSeedPacks.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 apps/desktop/src/token-host.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 apps/desktop/scripts/before-pack.cjs: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 apps/desktop/src/assistant/mcp-cli.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.
D1 · Cyclomatic Complexity · App.App · ×8
  • App.App::sidePanel (cyclomatic 100) apps/web/src/App.tsx:9022 — App.App::sidePanel has cyclomatic complexity 100 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 8 other methods here (App.App, App.App::saveAsTemplate, App.App::useToolItem, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
  • App.App::markupMenu (cyclomatic 87) apps/web/src/App.tsx:6885 — App.App::markupMenu has cyclomatic complexity 87 (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. This shape REPEATS in the file: 8 other methods here (App.App, App.App::saveAsTemplate, App.App::useToolItem, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
  • App.App::useToolItem (cyclomatic 30) apps/web/src/App.tsx:6233 — App.App::useToolItem has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 8 other methods here (App.App, App.App::saveAsTemplate, App.App::runExport, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
  • App.App::runExport (cyclomatic 23) apps/web/src/App.tsx:6291 — App.App::runExport 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. This shape REPEATS in the file: 8 other methods here (App.App, App.App::saveAsTemplate, App.App::useToolItem, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
  • App.App::markupMenu::tableItems (cyclomatic 19) apps/web/src/App.tsx:6938 — App.App::markupMenu::tableItems 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. This shape REPEATS in the file: 8 other methods here (App.App, App.App::saveAsTemplate, App.App::useToolItem, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
  • App.App::runPublish (cyclomatic 17) apps/web/src/App.tsx:8823 — App.App::runPublish 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. This shape REPEATS in the file: 8 other methods here (App.App, App.App::saveAsTemplate, App.App::useToolItem, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
  • App.App::saveAsTemplate (cyclomatic 16) apps/web/src/App.tsx:6160 — App.App::saveAsTemplate 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. This shape REPEATS in the file: 8 other methods here (App.App, App.App::useToolItem, App.App::runExport, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
  • App.App::flattenSelected (cyclomatic 16) apps/web/src/App.tsx:6842 — App.App::flattenSelected 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. This shape REPEATS in the file: 8 other methods here (App.App, App.App::saveAsTemplate, App.App::useToolItem, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 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.
D3 · God Classes · TooManyMethods · ×8
  • TooManyMethods: MarkupTools apps/web/src/markup/MarkupTools.ts:620 — TooManyMethods — 202 methods. The bar is 30 methods; this is 172 over it, 6.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TileViewer apps/web/src/viewer/TileViewer.ts:240 — TooManyMethods — 101 methods. The bar is 30 methods; this is 71 over it, 3.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MarkupStore packages/markup/src/store.ts:146 — TooManyMethods — 96 methods. The bar is 30 methods; this is 66 over it, 3.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: DriveSession apps/web/src/studio/drive/DriveSession.ts:202 — TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Project apps/web/src/studio/projects/Project.ts:118 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BitReader apps/web/src/cad/dwg/bits.ts:88 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OneDrive apps/web/src/studio/drive/onedrive.ts:501 — TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PdfEngine packages/pdf-core/src/engine.ts:13 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
X2 · Cancellation propagation · Async function without AbortSignal · ×8
  • Async function without AbortSignal: runButton apps/web/src/App.tsx:3927 — `runButton` 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: readJson apps/web/src/studio/drive/onedrive.ts:674 — `readJson` 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: upload apps/web/src/studio/drive/onedrive.ts:774 — `upload` 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: downloadOcr apps/web/src/offline/ocrCache.ts:49 — `downloadOcr` 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: loadTip apps/web/src/components/StartScreen.tsx:32 — `loadTip` 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: fonts apps/web/src/cad/convert.worker.ts:18 — `fonts` 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: postForm apps/desktop/src/auth.ts:34 — `postForm` 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: microsoftUser apps/desktop/src/auth.ts:193 — `microsoftUser` 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 })`.
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×8
  • Untrusted text written into markup unescaped apps/desktop/src/print.ts:50 — `encodeURI(path.basename(p.file))` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
  • Untrusted text written into markup unescaped apps/web/public/help/help.js:233 — `html(blocks(md.replace(/\r/g,'').split('\n')))` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped apps/web/public/help/help.js:235 — `html('<h1>'+esc(p.title)+'</h1><p class="missing">This page could not be loaded. If you are offline, open it once whi…` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped apps/web/public/help/help.js:241 — `html((prev?'<a class="prev" href="#'+prev.id+'"><small>← Previous</small>'+esc(prev.title)+'</a>':'')+(next?'<a class…` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped apps/web/public/help/help.js:298 — `html(renderToc(TOC,[]))` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped apps/web/public/help/help.js:350 — `html(hits.length?hits.slice(0,40).map((h)=>'<a class="hit" href="#'+h.p.id+'"><b>'+esc(h.p.title)+'</b><small>'+esc(h…` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:717 — `xml(file)` is text this program did not author, and it is written into the start of a URL attribute, where it chooses the scheme through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML encoding does not help here — a `javascript:` URL contains nothing it changes; allow only http(s) or a relative path.
  • Untrusted text written into markup unescaped packages/markup/src/setCategories.ts:43 — `root` is text this program did not author, and it is written into an unquoted attribute through markup this function returns with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. HTML text encoding does not help in an unquoted attribute — whitespace ends it; quote the attribute and encode the value.
AC1 · Text alternatives · <canvas> without a text alternative · ×7
  • <canvas> without a text alternative apps/web/src/App.tsx:9906 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative apps/web/src/App.tsx:10030 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative apps/web/src/components/LineStylesDialog.tsx:86 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative apps/web/src/components/PagesPanel.tsx:309 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative apps/web/src/components/SignaturesPanel.tsx:110 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative apps/web/src/components/StampsDialog.tsx:54 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative packages/markup/src/render.ts:106 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
AC3 · Page structure · Data table has no header cells · ×7
  • Data table has no header cells apps/web/src/components/AssembliesDialog.tsx:73 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
  • Data table has no header cells apps/web/src/components/AssembliesDialog.tsx:352 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
  • Data table has no header cells apps/web/src/components/RevisionsDialog.tsx:30 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
  • Data table has no header cells apps/web/src/components/TemplatesDialog.tsx:97 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
  • Data table has no header cells apps/web/src/components/sessions/AccessEditor.tsx:74 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
  • Data table has no header cells apps/web/src/components/standardsWizard/StandardsWizard.tsx:558 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
  • Data table has no header cells apps/web/src/components/standardsWizard/StandardsWizard.tsx:649 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
D35 · Change Coupling · Change coupling · ×7
  • Change coupling: message.ts ↔ assistant.ts apps/desktop/src/assistant/message.ts:1 — `apps/desktop/src/assistant/message.ts` and `apps/web/src/desktop/assistant.ts` change together 100% of the time (11 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 `6f91172c` MCP auto count: find_symbol_matches, propose_counts, list_count_propo…; `5f22edcd` Scale checks, viewports from view titles, and AI scale tools (phase 0…; `61a17e7d` Add AI Compare: semantic document comparison through the local assistant — run `git show` on any of them.
  • Change coupling: preload.ts ↔ host.ts apps/desktop/src/preload.ts:1 — `apps/desktop/src/preload.ts` and `apps/web/src/desktop/host.ts` change together 89% of the time (16 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 16 shared commits counted here, the most recent 3 are `07ff62c2` Revu migration wizard, Revu keyboard import and preset, landing page …; `784b3db5` Takeoff reports: quantity, assembly, sheet, detail and count reports …; `09617429` Use installed fonts in markups, embedded in exported PDFs (#273) — run `git show` on any of them.
  • Change coupling: export.ts ↔ import.ts packages/markup/src/export.ts:1 — `packages/markup/src/export.ts` and `packages/markup/src/import.ts` change together 81% of the time (17 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 17 shared commits counted here, the most recent 3 are `74441ece` Import: Bluebeam rotated text boxes keep their rotation (#309) (#330); `09617429` Use installed fonts in markups, embedded in exported PDFs (#273); `10a7524e` Blend modes for images, shapes and lines (#260) — run `git show` on any of them.
  • Change coupling: toc.js ↔ MenuBar.tsx apps/web/public/help/toc.js:1 — `apps/web/public/help/toc.js` and `apps/web/src/components/MenuBar.tsx` change together 75% of the time (9 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 `07ff62c2` Revu migration wizard, Revu keyboard import and preset, landing page …; `784b3db5` Takeoff reports: quantity, assembly, sheet, detail and count reports …; `2d705dd6` Sloped measurements: pitch, rise:run, elevations, hips and valleys (#… — run `git show` on any of them.
  • Change coupling: toc.js ↔ appCommands.ts apps/web/public/help/toc.js:1 — `apps/web/public/help/toc.js` and `apps/web/src/commands/appCommands.ts` change together 67% of the time (8 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 8 shared commits counted here, the most recent 3 are `07ff62c2` Revu migration wizard, Revu keyboard import and preset, landing page …; `784b3db5` Takeoff reports: quantity, assembly, sheet, detail and count reports …; `2d705dd6` Sloped measurements: pitch, rise:run, elevations, hips and valleys (#… — run `git show` on any of them.
  • Change coupling: bluebeam.ts ↔ render.ts packages/markup/src/bluebeam.ts:1 — `packages/markup/src/bluebeam.ts` and `packages/markup/src/render.ts` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) 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 8 shared commits counted here, the most recent 3 are `09617429` Use installed fonts in markups, embedded in exported PDFs (#273); `ba560204` Match Bluebeam callouts and text boxes on import (#237) (#248); `1a4e939c` Justified text alignment; version in About; text layout in ribbon (#229) — run `git show` on any of them.
  • Change coupling: ProjectsPanel.tsx ↔ SessionsPanel.tsx apps/web/src/components/ProjectsPanel.tsx:1 — `apps/web/src/components/ProjectsPanel.tsx` and `apps/web/src/components/SessionsPanel.tsx` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 6 shared commits counted here, the most recent 3 are `816ecd34` Show every comment in a Project or Live Session in one table; `e0336d4b` Hide OneDrive sharing for Projects and Sessions behind VITE_ENABLE_ON…; `de8795b2` Match Bluebeam Studio's sessions and projects layout — run `git show` on any of them.
D2 · Cognitive Complexity · App.App · ×6
  • App.App::sidePanel (cognitive 607) apps/web/src/App.tsx:9022 — App.App::sidePanel has cognitive complexity 607 (threshold 15). Drivers by points: ternaries 57 (574 pts), boolean chains 32, if/else 1 (nesting depth added 517). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 6 other methods here (App.App, App.App::useToolItem, App.App::runExport, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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.
  • App.App::markupMenu (cognitive 77) apps/web/src/App.tsx:6885 — App.App::markupMenu has cognitive complexity 77 (threshold 15). Drivers by points: boolean chains 49, ternaries 24 (26 pts), if/else 2 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: 6 other methods here (App.App, App.App::useToolItem, App.App::runExport, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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.
  • App.App::useToolItem (cognitive 39) apps/web/src/App.tsx:6233 — App.App::useToolItem has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 18 (28 pts), boolean chains 6, if/else 4 (5 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. This shape REPEATS in the file: 6 other methods here (App.App, App.App::runExport, App.App::markupMenu, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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.
  • App.App::runExport (cognitive 31) apps/web/src/App.tsx:6291 — App.App::runExport has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 4 (10 pts), loops 4 (5 pts), boolean chains 3, error handling 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. This shape REPEATS in the file: 6 other methods here (App.App, App.App::useToolItem, App.App::markupMenu, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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.
  • App.App::runPublish (cognitive 26) apps/web/src/App.tsx:8823 — App.App::runPublish has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 6 (12 pts), boolean chains 1, error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 6 other methods here (App.App, App.App::useToolItem, App.App::runExport, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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.
  • App.App::tabMenu (cognitive 17) apps/web/src/App.tsx:7451 — App.App::tabMenu has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 6 other methods here (App.App, App.App::useToolItem, App.App::runExport, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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.
D3 · God Classes · MethodTooLong · ×6
  • MethodTooLong: MarkupTools.pointerDown apps/web/src/markup/MarkupTools.ts:2961 — MethodTooLong — pointerDown runs 302 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 202 over it, 3.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MarkupTools.draw apps/web/src/markup/MarkupTools.ts:2388 — MethodTooLong — draw runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.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.
  • MethodTooLong: MarkupTools.pointerUp apps/web/src/markup/MarkupTools.ts:3568 — MethodTooLong — pointerUp runs 156 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 56 over it, 1.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.
  • MethodTooLong: MarkupTools.pointerMove apps/web/src/markup/MarkupTools.ts:3386 — MethodTooLong — pointerMove runs 153 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: TileViewer.draw apps/web/src/viewer/TileViewer.ts:1054 — MethodTooLong — draw runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MarkupTools.commitDraft apps/web/src/markup/MarkupTools.ts:4370 — MethodTooLong — commitDraft runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01× 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.
AC2 · Forms & labels · <fieldset> without a <legend> · ×5
  • <fieldset> without a <legend> apps/web/src/components/AssembliesDialog.tsx:336 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> apps/web/src/components/ColumnsDialog.tsx:289 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> apps/web/src/components/ProductListsDialog.tsx:145 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> apps/web/src/components/PropertiesPanel.tsx:273 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
  • <fieldset> without a <legend> apps/web/src/components/PropertiesPanel.tsx:476 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
D10 · Test Quality · Skipped test · ×5
  • Skipped test: (unnamed test) e2e/specs/detach.spec.ts:13 — Skipped — switched off by test.skip
  • Skipped test: (unnamed test) e2e/specs/document.spec.ts:412 — Skipped — switched off by test.skip
  • Skipped test: (unnamed test) e2e/specs/dont-save.spec.ts:8 — Skipped — switched off by test.skip
  • Skipped test: (unnamed test) e2e/specs/fonts.spec.ts:8 — Skipped — switched off by test.skip
  • Skipped test: (unnamed test) e2e/specs/session-review.spec.ts:13 — Skipped — switched off by test.skip
D3 · God Classes · ClassTooLong · ×5
  • ClassTooLong: PreferencesDialog apps/web/src/components/PreferencesDialog.tsx:1 — ClassTooLong — 774 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 374 over it, 1.94× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MarkupStore packages/markup/src/store.ts:146 — ClassTooLong — 733 significant lines (blank, comment-only and punctuation-only lines excluded), 96 methods. The bar is 400 significant lines; this is 333 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Ribbon apps/web/src/components/Ribbon.tsx:1 — ClassTooLong — 677 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 277 over it, 1.69× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MenuBar apps/web/src/components/MenuBar.tsx:1 — ClassTooLong — 478 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 78 over it, 1.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ColumnsDialog apps/web/src/components/ColumnsDialog.tsx:1 — ClassTooLong — 458 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 58 over it, 1.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities · Medium CVE · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×4
  • Focus outline removed in CSS without a :focus replacement apps/web/src/features.css:1725 — `.modal .prefs-search-box input.prefs-search:not([type='checkbox']):not([type='radio']):not([type='color'])` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement apps/web/src/styles.css:884 — `.text-editor` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement apps/web/src/styles.css:1639 — `.pages-panel .thumbs:focus` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
  • Focus outline removed in CSS without a :focus replacement apps/web/public/home/home.css:226 — `.grid.cards h3 a:focus-visible` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×4
  • Animation without a prefers-reduced-motion guard apps/web/src/features.css:2011 — `.prefs-dialog .pref-grid .pref-check input[type='checkbox']::before` moves (`transition: transform 0.15s`) 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 apps/web/src/styles.css:4112 — `.spinner` moves (`animation: spin 0.7s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard apps/web/public/help/help.css:165 — `.toc .caret` moves (`transition: transform 0.15s`) 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 apps/web/public/help/help.css:459 — `.sidebar` moves (`transition: transform 0.2s`) 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.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R10 · Code Duplication · Duplicated block (17 lines × 2 locations) · ×4
  • Duplicated block (17 lines × 2 locations) apps/web/src/components/PreferencesDialog.tsx:1186 — apps/web/src/components/PreferencesDialog.tsx:1186 · apps/web/src/components/PreferencesDialog.tsx:1243 — all 2 copies are in the same file, 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 (17 lines × 2 locations) apps/web/src/components/ToolChest.tsx:391 — apps/web/src/components/ToolChest.tsx:391 · apps/web/src/components/ToolChest.tsx:413 — all 2 copies are in the same file, 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 (17 lines × 2 locations) apps/web/src/markup/MarkupTools.ts:5475 — apps/web/src/markup/MarkupTools.ts:5475 · apps/web/src/markup/MarkupTools.ts:5539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2 locations) apps/web/src/studio/drive/DriveSession.ts:936 — apps/web/src/studio/drive/DriveSession.ts:936 · apps/web/src/studio/drive/rooms.ts:400 — 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.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×4
  • Recursive walk over a caller-supplied document has no depth cap packages/markup/src/bsiLegend.ts:169 — `readBsiLegend` is exported, takes a document from its caller (line 175) and hands it to `plain`, which calls itself at line 169 (`plain`) with a piece of `v` (and at line 170) — and nowhere in `plain` 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. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `plain` 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 packages/markup/src/lineStyle.ts:43 — `readLineStyle` is exported, takes a document from its caller (line 41) and hands it to `plain`, which calls itself at line 43 (`plain`) with a piece of `v` — and nowhere in `plain` 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. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `plain` 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 apps/web/src/studio/crypto/keys.ts:206 — `canonical` is exported and takes `value: unknown` from its caller, and it calls itself at line 206 (`canonical`) with a piece of `value` (and at line 211) — and nowhere in `canonical` 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. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonical` 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 apps/web/src/geospatial/xml.ts:101 — `descendants` is exported and takes `el: XmlElement` from its caller, and it calls itself at line 101 (`descendants`) with a piece of `el` — and nowhere in `descendants` 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. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `descendants` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D2 · Cognitive Complexity · MarkupList.MarkupList · ×3
  • MarkupList.MarkupList::editor (cognitive 31) apps/web/src/components/MarkupList.tsx:583 — MarkupList.MarkupList::editor has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 8 (16 pts), boolean chains 8, if/else 6, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (MarkupList.MarkupList, MarkupList.MarkupList::selectMarkup, MarkupList.MarkupList::filterInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
  • MarkupList.MarkupList::selectMarkup (cognitive 19) apps/web/src/components/MarkupList.tsx:518 — MarkupList.MarkupList::selectMarkup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 1 (3 pts), ternaries 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level. This shape REPEATS in the file: 3 other methods here (MarkupList.MarkupList, MarkupList.MarkupList::editor, MarkupList.MarkupList::filterInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
  • MarkupList.MarkupList::filterInput (cognitive 16) apps/web/src/components/MarkupList.tsx:732 — MarkupList.MarkupList::filterInput has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 1, if/else 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. This shape REPEATS in the file: 3 other methods here (MarkupList.MarkupList, MarkupList.MarkupList::selectMarkup, MarkupList.MarkupList::editor) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
D5 · Coupling · Off the main sequence · ×3
  • Off the main sequence: @nb/sheets — @nb/sheets: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
  • Off the main sequence: @nb/measure — @nb/measure: abstractness 0.08, instability 0.00, distance 0.92 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: @nb/pdf-core — @nb/pdf-core: abstractness 0.25, instability 0.00, distance 0.75 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
R11 · Import Boundaries · Boundary violation [package · ×3
  • Boundary violation [package:relative-cross-package] scripts/check-cad-samples.mjs:7 — scripts/check-cad-samples.mjs:7 reaches into another package with a relative path (../apps/web/src/cad/convert.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] scripts/check-cad-samples.mjs:8 — scripts/check-cad-samples.mjs:8 reaches into another package with a relative path (../packages/markup/src/pdfExtras.ts) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] scripts/check-cad-samples.mjs:9 — scripts/check-cad-samples.mjs:9 reaches into another package with a relative path (../packages/markup/src/bluebeam.ts) — import the package by name instead.
D1 · Cyclomatic Complexity · ifc.parseIfc · ×2
  • ifc.parseIfc::item (cyclomatic 22) apps/web/src/geospatial/ifc.ts:448 — ifc.parseIfc::item has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: 2 other methods here (ifc.parseIfc, ifc.parseIfc::curve) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • ifc.parseIfc::curve (cyclomatic 17) apps/web/src/geospatial/ifc.ts:293 — ifc.parseIfc::curve 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. This shape REPEATS in the file: 2 other methods here (ifc.parseIfc, ifc.parseIfc::item) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · SearchPanel.SearchPanel · ×2
  • SearchPanel.SearchPanel::search (cyclomatic 16) apps/web/src/components/SearchPanel.tsx:197 — SearchPanel.SearchPanel::search 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. This shape REPEATS in the file: 2 other methods here (SearchPanel.SearchPanel, SearchPanel.SearchPanel::onArrow) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • SearchPanel.SearchPanel::onArrow (cyclomatic 16) apps/web/src/components/SearchPanel.tsx:267 — SearchPanel.SearchPanel::onArrow 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. This shape REPEATS in the file: 2 other methods here (SearchPanel.SearchPanel, SearchPanel.SearchPanel::search) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D10 · Test Quality · Fixed-sleep synchronisation · ×2
  • Fixed-sleep synchronisation: selection follows the drawing on screen, and one confirmation shows at a time apps/web/src/desktop/assistant.test.ts:436 — This test starts work it did not wait for (`second`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 400))` — 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: calls made while the saved drivers load wait for them apps/desktop/src/token-ipc.test.ts:65 — This test starts work it did not wait for (`pending`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 20))` — 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.
D2 · Cognitive Complexity · content.optimizeContent · ×2
  • content.optimizeContent::flush (cognitive 19) apps/web/src/documents/renderCopy/content.ts:389 — content.optimizeContent::flush has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (content.optimizeContent, content.optimizeContent::take) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
  • content.optimizeContent::take (cognitive 16) apps/web/src/documents/renderCopy/content.ts:364 — content.optimizeContent::take has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (content.optimizeContent, content.optimizeContent::flush) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×2
  • Duplicated block (6 lines × 2) scripts/make_stitch_test_pdf.py:115 — scripts/make_stitch_test_pdf.py:115-120 | scripts/make_test_pdf.py:110-115 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) scripts/roadset/sheets_long.py:98 — scripts/roadset/sheets_long.py:98-103 | scripts/roadset/sheets_long.py:341-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (22 lines × 2 locations) · ×2
  • Duplicated block (22 lines × 2 locations) apps/web/src/components/ProductListsDialog.tsx:237 — apps/web/src/components/ProductListsDialog.tsx:237 · apps/web/src/components/TemplatesDialog.tsx:122 — 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.
  • Duplicated block (22 lines × 2 locations) apps/web/src/signatures/signatures.ts:12 — apps/web/src/signatures/signatures.ts:12 · apps/web/src/storage/fileGroups.ts:11 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (20 lines × 2 locations) · ×2
  • Duplicated block (20 lines × 2 locations) apps/web/src/components/AssembliesDialog.tsx:131 — apps/web/src/components/AssembliesDialog.tsx:131 · apps/web/src/components/ItemsDialog.tsx:32 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (20 lines × 2 locations) scripts/help/clips.cjs:21 — scripts/help/clips.cjs:21 · scripts/help/gifs.cjs:23 — 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 (18 lines × 3 locations) · ×2
  • Duplicated block (18 lines × 3 locations) apps/web/src/components/BulkInsertDialog.tsx:31 — apps/web/src/components/BulkInsertDialog.tsx:31 · apps/web/src/components/CombineDialog.tsx:29 · apps/web/src/components/MultiplyDialog.tsx:29 — 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.
  • Duplicated block (18 lines × 3 locations) apps/web/src/components/standardsWizard/StandardsWizard.tsx:330 — apps/web/src/components/standardsWizard/StandardsWizard.tsx:330 · apps/web/src/components/standardsWizard/StandardsWizard.tsx:356 · apps/web/src/components/standardsWizard/StandardsWizard.tsx:380 — all 3 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (18 lines × 2 locations) · ×2
  • Duplicated block (18 lines × 2 locations) apps/web/src/desktop/assistant.ts:413 — apps/web/src/desktop/assistant.ts:413 · apps/web/src/desktop/assistant.ts:688 — all 2 copies are in the same file, 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 (18 lines × 2 locations) scripts/help/clips/flow-diagrams.cjs:4 — scripts/help/clips/flow-diagrams.cjs:4 · scripts/help/clips/tables.cjs:5 — 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.
AC1 · Text alternatives · <video> without a captions track · ×1
  • <video> without a captions track apps/web/src/components/SoundDialog.tsx:103 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
AC2 · Forms & labels · <NumberField> field component without a label · ×1
  • <NumberField> field component without a label apps/web/src/components/PropertiesPanel.tsx:1045 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC3 · Page structure · Text directly inside a table row · ×1
  • Text directly inside a table row apps/web/src/components/MarkupList.tsx:1041 — A <tr> may hold only <td>/<th> cells. Text or a value written between the cells is moved out of the table by the browser, so it is read detached from its row. Wrap it in a <td>.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.7 · ×1
  • Low contrast colour pair in CSS (3.7:1) apps/web/src/features.css:6492 — `.geo-badge` sets color: #fff on background-color: #0891b2 — 3.7:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
AC6 · Visual & motion safety · Low contrast colour pair in CSS (3.0 · ×1
  • Low contrast colour pair in CSS (3.0:1) apps/web/public/help/help.css:265 — `.content ol.steps > li::before` sets color: #fff on background-color: #ff5a6e — 3.0:1, below the 4.5:1 WCAG AA minimum for normal text. Darken or lighten one of them.
D1 · Cyclomatic Complexity · App.App (cyclomatic 392) · ×1
  • App.App (cyclomatic 392) apps/web/src/App.tsx:909 — App.App has cyclomatic complexity 392 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 8 other methods here (App.App::saveAsTemplate, App.App::useToolItem, App.App::runExport, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 9 times rather than 9 independent problems. Splitting this body alone leaves the other 8 exactly as they are. Where these are variations on one operation, the change that clears all 9 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · MarkupTools.pointerDown (cyclomatic 249) · ×1
  • MarkupTools.pointerDown (cyclomatic 249) apps/web/src/markup/MarkupTools.ts:2961 — MarkupTools.pointerDown has cyclomatic complexity 249 (threshold 15). Of this number, 245 points are the body's own statements and 4 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 · GeospatialPanel.GeospatialPanel (cyclomatic 151) · ×1
  • GeospatialPanel.GeospatialPanel (cyclomatic 151) apps/web/src/components/GeospatialPanel.tsx:72 — GeospatialPanel.GeospatialPanel has cyclomatic complexity 151 (threshold 15). Of this number, 68 points are the body's own statements and 83 belong to 26 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 · appCommands.buildCommands (cyclomatic 142) · ×1
  • appCommands.buildCommands (cyclomatic 142) apps/web/src/commands/appCommands.ts:365 — appCommands.buildCommands has cyclomatic complexity 142 (threshold 15). Of this number, 124 points are the body's own statements and 18 belong to 11 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · import.fromRaw (cyclomatic 139) · ×1
  • import.fromRaw (cyclomatic 139) packages/markup/src/import.ts:635 — import.fromRaw has cyclomatic complexity 139 (threshold 15). Of this number, 122 points are the body's own statements and 17 belong to 9 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 · export.exportWithAnnotations (cyclomatic 129) · ×1
  • export.exportWithAnnotations (cyclomatic 129) packages/markup/src/export.ts:2064 — export.exportWithAnnotations has cyclomatic complexity 129 (threshold 15). Of this number, 100 points are the body's own statements and 29 belong to 10 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 · export.annotationDict (cyclomatic 125) · ×1
  • export.annotationDict (cyclomatic 125) packages/markup/src/export.ts:865 — export.annotationDict has cyclomatic complexity 125 (threshold 15). Of this number, 122 points are the body's own statements and 3 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 · AssembliesDialog.AssembliesDialog (cyclomatic 115) · ×1
  • AssembliesDialog.AssembliesDialog (cyclomatic 115) apps/web/src/components/AssembliesDialog.tsx:153 — AssembliesDialog.AssembliesDialog has cyclomatic complexity 115 (threshold 15). Of this number, 28 points are the body's own statements and 87 belong to 36 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 · MarkupTools.draw (cyclomatic 111) · ×1
  • MarkupTools.draw (cyclomatic 111) apps/web/src/markup/MarkupTools.ts:2388 — MarkupTools.draw has cyclomatic complexity 111 (threshold 15). Of this number, 109 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 · PreferencesDialog.PreferencesDialog (cyclomatic 107) · ×1
  • PreferencesDialog.PreferencesDialog (cyclomatic 107) apps/web/src/components/PreferencesDialog.tsx:215 — PreferencesDialog.PreferencesDialog has cyclomatic complexity 107 (threshold 15). Of this number, 32 points are the body's own statements and 75 belong to 29 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 · ExportDialog.MarkupSummaryDialog (cyclomatic 105) · ×1
  • ExportDialog.MarkupSummaryDialog (cyclomatic 105) apps/web/src/components/ExportDialog.tsx:134 — ExportDialog.MarkupSummaryDialog has cyclomatic complexity 105 (threshold 15). Of this number, 28 points are the body's own statements and 77 belong to 39 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 · SessionsPanel.InSession (cyclomatic 104) · ×1
  • SessionsPanel.InSession (cyclomatic 104) apps/web/src/components/SessionsPanel.tsx:352 — SessionsPanel.InSession has cyclomatic complexity 104 (threshold 15). Of this number, 70 points are the body's own statements and 34 belong to 15 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · export.appearance (cyclomatic 103) · ×1
  • export.appearance (cyclomatic 103) packages/markup/src/export.ts:399 — export.appearance has cyclomatic complexity 103 (threshold 15). Of this number, 96 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 · main.start (cyclomatic 98) · ×1
  • main.start (cyclomatic 98) apps/desktop/src/main.ts:80 — main.start has cyclomatic complexity 98 (threshold 15). Most of this is not in the body itself: 10 of the 98 points are its own statements and the rest belongs to 29 function items inside it that branch (a function literal at line 349, a function literal at line 148, a function literal at line 140, …). 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 · objects.entityData (cyclomatic 98) · ×1
  • objects.entityData (cyclomatic 98) apps/web/src/cad/dwg/objects.ts:316 — objects.entityData has cyclomatic complexity 98 (threshold 15). Of this number, 97 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 · MarkupTools.pointerUp (cyclomatic 95) · ×1
  • MarkupTools.pointerUp (cyclomatic 95) apps/web/src/markup/MarkupTools.ts:3568 — MarkupTools.pointerUp has cyclomatic complexity 95 (threshold 15). Of this number, 85 points are the body's own statements and 10 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 · StandardsWizard.StandardsWizard (cyclomatic 92) · ×1
  • StandardsWizard.StandardsWizard (cyclomatic 92) apps/web/src/components/standardsWizard/StandardsWizard.tsx:80 — StandardsWizard.StandardsWizard has cyclomatic complexity 92 (threshold 15). Of this number, 55 points are the body's own statements and 37 belong to 15 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 · geometry.baseShape (cyclomatic 91) · ×1
  • geometry.baseShape (cyclomatic 91) packages/markup/src/geometry.ts:65 — geometry.baseShape has cyclomatic complexity 91 (threshold 15). Of this number, 84 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ltv.oneValidationUpdate (cyclomatic 90) · ×1
  • ltv.oneValidationUpdate (cyclomatic 90) REDACTED:482 — ltv.oneValidationUpdate has cyclomatic complexity 90 (threshold 15). Of this number, 88 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 · PageNav.PageNav (cyclomatic 90) · ×1
  • PageNav.PageNav (cyclomatic 90) apps/web/src/components/PageNav.tsx:68 — PageNav.PageNav has cyclomatic complexity 90 (threshold 15). Of this number, 63 points are the body's own statements and 27 belong to 13 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ToolBar.StyleControls (cyclomatic 89) · ×1
  • ToolBar.StyleControls (cyclomatic 89) apps/web/src/components/ToolBar.tsx:327 — ToolBar.StyleControls has cyclomatic complexity 89 (threshold 15). Of this number, 81 points are the body's own statements and 8 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ColumnsDialog.ColumnsDialog (cyclomatic 88) · ×1
  • ColumnsDialog.ColumnsDialog (cyclomatic 88) apps/web/src/components/ColumnsDialog.tsx:64 — ColumnsDialog.ColumnsDialog has cyclomatic complexity 88 (threshold 15). Of this number, 43 points are the body's own statements and 45 belong to 24 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 · MeasurementsPanel.PageScale (cyclomatic 88) · ×1
  • MeasurementsPanel.PageScale (cyclomatic 88) apps/web/src/components/MeasurementsPanel.tsx:250 — MeasurementsPanel.PageScale has cyclomatic complexity 88 (threshold 15). Of this number, 27 points are the body's own statements and 61 belong to 14 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MarkupTools.pointerMove (cyclomatic 86) · ×1
  • MarkupTools.pointerMove (cyclomatic 86) apps/web/src/markup/MarkupTools.ts:3386 — MarkupTools.pointerMove has cyclomatic complexity 86 (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 · MarkupTools.hover (cyclomatic 84) · ×1
  • MarkupTools.hover (cyclomatic 84) apps/web/src/markup/MarkupTools.ts:3843 — MarkupTools.hover has cyclomatic complexity 84 (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 · import.importAnnotations (cyclomatic 83) · ×1
  • import.importAnnotations (cyclomatic 83) packages/markup/src/import.ts:136 — import.importAnnotations has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (import.importAnnotations::finish) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · SetsPanel.SetsPanel (cyclomatic 82) · ×1
  • SetsPanel.SetsPanel (cyclomatic 82) apps/web/src/components/SetsPanel.tsx:51 — SetsPanel.SetsPanel has cyclomatic complexity 82 (threshold 15). Most of this is not in the body itself: 7 of the 82 points are its own statements and the rest belongs to 27 function items inside it that branch (a function literal at line 298, a function literal at line 192, sheetRow, …). 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 · ChainageStep.ChainageStep (cyclomatic 79) · ×1
  • ChainageStep.ChainageStep (cyclomatic 79) apps/web/src/components/standardsWizard/ChainageStep.tsx:69 — ChainageStep.ChainageStep has cyclomatic complexity 79 (threshold 15). Of this number, 43 points are the body's own statements and 36 belong to 14 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 · cadTools.cadClick (cyclomatic 78) · ×1
  • cadTools.cadClick (cyclomatic 78) apps/web/src/markup/cadTools.ts:314 — cadTools.cadClick has cyclomatic complexity 78 (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 · toolchest.parseBtx (cyclomatic 76) · ×1
  • toolchest.parseBtx (cyclomatic 76) REDACTED:268 — toolchest.parseBtx has cyclomatic complexity 76 (threshold 15). Of this number, 75 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 · sets.setSheets (cyclomatic 75) · ×1
  • sets.setSheets (cyclomatic 75) REDACTED:250 — sets.setSheets has cyclomatic complexity 75 (threshold 15). Of this number, 35 points are the body's own statements and 40 belong to 8 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 · BatchDialog.BatchDialog (cyclomatic 74) · ×1
  • BatchDialog.BatchDialog (cyclomatic 74) apps/web/src/components/BatchDialog.tsx:142 — BatchDialog.BatchDialog has cyclomatic complexity 74 (threshold 15). Of this number, 45 points are the body's own statements and 29 belong to 8 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 · render.multileader (cyclomatic 74) · ×1
  • render.multileader (cyclomatic 74) apps/web/src/cad/render.ts:659 — render.multileader has cyclomatic complexity 74 (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 · LayersPanel.LayersPanel (cyclomatic 70) · ×1
  • LayersPanel.LayersPanel (cyclomatic 70) apps/web/src/components/LayersPanel.tsx:161 — LayersPanel.LayersPanel has cyclomatic complexity 70 (threshold 15). Most of this is not in the body itself: 9 of the 70 points are its own statements and the rest belongs to 20 function items inside it that branch (a function literal at line 680, dial, a function literal at line 243, …). 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 · ToolChest.ToolChestPanel (cyclomatic 68) · ×1
  • ToolChest.ToolChestPanel (cyclomatic 68) apps/web/src/components/ToolChest.tsx:194 — ToolChest.ToolChestPanel has cyclomatic complexity 68 (threshold 15). Most of this is not in the body itself: 11 of the 68 points are its own statements and the rest belongs to 23 function items inside it that branch (a function literal at line 449, a function literal at line 491, a function literal at line 226, …). 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 · worker.redact (cyclomatic 68) · ×1
  • worker.redact (cyclomatic 68) packages/pdf-core/src/worker.ts:1041 — worker.redact has cyclomatic complexity 68 (threshold 15). Of this number, 56 points are the body's own statements and 12 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 · CalloutStep.CalloutStep (cyclomatic 66) · ×1
  • CalloutStep.CalloutStep (cyclomatic 66) apps/web/src/components/standardsWizard/CalloutStep.tsx:80 — CalloutStep.CalloutStep has cyclomatic complexity 66 (threshold 15). Of this number, 45 points are the body's own statements and 21 belong to 10 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 · FormsPanel.Properties (cyclomatic 63) · ×1
  • FormsPanel.Properties (cyclomatic 63) apps/web/src/components/FormsPanel.tsx:90 — FormsPanel.Properties has cyclomatic complexity 63 (threshold 15). Of this number, 37 points are the body's own statements and 26 belong to 17 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · render.drawMarkup (cyclomatic 63) · ×1
  • render.drawMarkup (cyclomatic 63) packages/markup/src/render.ts:358 — render.drawMarkup has cyclomatic complexity 63 (threshold 15). Of this number, 60 points are the body's own statements and 3 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 · fieldDetect.detectFields (cyclomatic 62) · ×1
  • fieldDetect.detectFields (cyclomatic 62) apps/web/src/documents/fieldDetect.ts:51 — fieldDetect.detectFields has cyclomatic complexity 62 (threshold 15). Of this number, 35 points are the body's own statements and 27 belong to 9 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ProjectsPanel.FileActions (cyclomatic 61) · ×1
  • ProjectsPanel.FileActions (cyclomatic 61) apps/web/src/components/ProjectsPanel.tsx:759 — ProjectsPanel.FileActions has cyclomatic complexity 61 (threshold 15). Of this number, 44 points are the body's own statements and 17 belong to 9 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ProjectsPanel.ProjectView (cyclomatic 60) · ×1
  • ProjectsPanel.ProjectView (cyclomatic 60) apps/web/src/components/ProjectsPanel.tsx:325 — ProjectsPanel.ProjectView has cyclomatic complexity 60 (threshold 15). Of this number, 35 points are the body's own statements and 25 belong to 16 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 · dxf.readDxf (cyclomatic 59) · ×1
  • dxf.readDxf (cyclomatic 59) apps/web/src/cad/dxf.ts:114 — dxf.readDxf has cyclomatic complexity 59 (threshold 15). Of this number, 52 points are the body's own statements and 7 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 · pdfa.archiveAsPdfA (cyclomatic 59) · ×1
  • pdfa.archiveAsPdfA (cyclomatic 59) apps/web/src/documents/pdfa.ts:19 — pdfa.archiveAsPdfA has cyclomatic complexity 59 (threshold 15). Of this number, 52 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · toolchest.toolType (cyclomatic 59) · ×1
  • toolchest.toolType (cyclomatic 59) REDACTED:488 — toolchest.toolType has cyclomatic complexity 59 (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 · MarkupTools.commitDraft (cyclomatic 58) · ×1
  • MarkupTools.commitDraft (cyclomatic 58) apps/web/src/markup/MarkupTools.ts:4370 — MarkupTools.commitDraft has cyclomatic complexity 58 (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 · PropertiesPanel.PropertiesPanel (cyclomatic 58) · ×1
  • PropertiesPanel.PropertiesPanel (cyclomatic 58) apps/web/src/components/PropertiesPanel.tsx:63 — PropertiesPanel.PropertiesPanel has cyclomatic complexity 58 (threshold 15). Of this number, 44 points are the body's own statements and 14 belong to 11 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · forms.updateField (cyclomatic 58) · ×1
  • forms.updateField (cyclomatic 58) REDACTED:536 — forms.updateField has cyclomatic complexity 58 (threshold 15). Of this number, 57 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 · MatchLineStep.MatchLineStep (cyclomatic 56) · ×1
  • MatchLineStep.MatchLineStep (cyclomatic 56) apps/web/src/components/standardsWizard/MatchLineStep.tsx:44 — MatchLineStep.MatchLineStep has cyclomatic complexity 56 (threshold 15). Of this number, 36 points are the body's own statements and 20 belong to 9 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 · toolchest.toolStyle (cyclomatic 56) · ×1
  • toolchest.toolStyle (cyclomatic 56) REDACTED:577 — toolchest.toolStyle 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 · Ribbon.Ribbon (cyclomatic 55) · ×1
  • Ribbon.Ribbon (cyclomatic 55) apps/web/src/components/Ribbon.tsx:607 — Ribbon.Ribbon has cyclomatic complexity 55 (threshold 15). Of this number, 21 points are the body's own statements and 34 belong to 13 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · MarkupList.MarkupList (cyclomatic 54) · ×1
  • MarkupList.MarkupList (cyclomatic 54) apps/web/src/components/MarkupList.tsx:169 — MarkupList.MarkupList has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (MarkupList.MarkupList::editor) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · NewPdfDialog.NewPdfDialog (cyclomatic 54) · ×1
  • NewPdfDialog.NewPdfDialog (cyclomatic 54) apps/web/src/components/NewPdfDialog.tsx:41 — NewPdfDialog.NewPdfDialog has cyclomatic complexity 54 (threshold 15). Of this number, 44 points are the body's own statements and 10 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 · xfdf.element (cyclomatic 54) · ×1
  • xfdf.element (cyclomatic 54) packages/markup/src/xfdf.ts:53 — xfdf.element has cyclomatic complexity 54 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · LineStylesDialog.LineStylesDialog (cyclomatic 53) · ×1
  • LineStylesDialog.LineStylesDialog (cyclomatic 53) apps/web/src/components/LineStylesDialog.tsx:422 — LineStylesDialog.LineStylesDialog has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 10 of the 53 points are its own statements and the rest belongs to 21 function items inside it that branch (a function literal at line 589, a function literal at line 506, a function literal at line 572, …). 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 · FontPicker.FontPicker (cyclomatic 53) · ×1
  • FontPicker.FontPicker (cyclomatic 53) apps/web/src/components/FontPicker.tsx:22 — FontPicker.FontPicker has cyclomatic complexity 53 (threshold 15). Of this number, 21 points are the body's own statements and 32 belong to 11 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 · BookmarksPanel.BookmarksPanel (cyclomatic 53) · ×1
  • BookmarksPanel.BookmarksPanel (cyclomatic 53) apps/web/src/components/BookmarksPanel.tsx:53 — BookmarksPanel.BookmarksPanel has cyclomatic complexity 53 (threshold 15). Of this number, 17 points are the body's own statements and 36 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 · SetScaleDialog.SetScaleDialog (cyclomatic 53) · ×1
  • SetScaleDialog.SetScaleDialog (cyclomatic 53) apps/web/src/components/SetScaleDialog.tsx:49 — SetScaleDialog.SetScaleDialog has cyclomatic complexity 53 (threshold 15). Of this number, 25 points are the body's own statements and 28 belong to 14 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 · SlowDrawingPrompt.SlowDrawingPrompt (cyclomatic 50) · ×1
  • SlowDrawingPrompt.SlowDrawingPrompt (cyclomatic 50) apps/web/src/components/SlowDrawingPrompt.tsx:64 — SlowDrawingPrompt.SlowDrawingPrompt has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 8 of the 50 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 117, 160, 187, …). 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 · pdfSign.checkSignatures (cyclomatic 50) · ×1
  • pdfSign.checkSignatures (cyclomatic 50) apps/web/src/documents/pdfSign.ts:394 — pdfSign.checkSignatures has cyclomatic complexity 50 (threshold 15). Of this number, 46 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CompareDialog.CompareDialog (cyclomatic 50) · ×1
  • CompareDialog.CompareDialog (cyclomatic 50) apps/web/src/components/CompareDialog.tsx:57 — CompareDialog.CompareDialog has cyclomatic complexity 50 (threshold 15). Of this number, 33 points are the body's own statements and 17 belong to 11 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 · PropertiesPanel.StyleEditor (cyclomatic 49) · ×1
  • PropertiesPanel.StyleEditor (cyclomatic 49) apps/web/src/components/PropertiesPanel.tsx:468 — PropertiesPanel.StyleEditor has cyclomatic complexity 49 (threshold 15). Of this number, 41 points are the body's own statements and 8 belong to 8 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ItemsDialog.ItemsDialog (cyclomatic 49) · ×1
  • ItemsDialog.ItemsDialog (cyclomatic 49) apps/web/src/components/ItemsDialog.tsx:57 — ItemsDialog.ItemsDialog has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 12 of the 49 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 152, remove, problem, …). 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 · CadBar.CadBar (cyclomatic 49) · ×1
  • CadBar.CadBar (cyclomatic 49) apps/web/src/components/CadBar.tsx:28 — CadBar.CadBar has cyclomatic complexity 49 (threshold 15). Of this number, 33 points are the body's own statements and 16 belong to 5 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · SnapIndex.snap (cyclomatic 49) · ×1
  • SnapIndex.snap (cyclomatic 49) packages/measure/src/snap.ts:227 — SnapIndex.snap has cyclomatic complexity 49 (threshold 15). Of this number, 43 points are the body's own statements and 6 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 · listColumns.cellsFor (cyclomatic 48) · ×1
  • listColumns.cellsFor (cyclomatic 48) apps/web/src/columns/listColumns.ts:186 — listColumns.cellsFor has cyclomatic complexity 48 (threshold 15). Of this number, 38 points are the body's own statements and 10 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 · TileViewer.draw (cyclomatic 47) · ×1
  • TileViewer.draw (cyclomatic 47) apps/web/src/viewer/TileViewer.ts:1054 — TileViewer.draw has cyclomatic complexity 47 (threshold 15). Of this number, 44 points are the body's own statements and 3 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 · DigitalSignatures.DigitalSignaturesSection (cyclomatic 47) · ×1
  • DigitalSignatures.DigitalSignaturesSection (cyclomatic 47) REDACTED:52 — DigitalSignatures.DigitalSignaturesSection has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 4 of the 47 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 78, 135, 151). 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 · bluebeam.parseDefaultStyle (cyclomatic 47) · ×1
  • bluebeam.parseDefaultStyle (cyclomatic 47) packages/markup/src/bluebeam.ts:134 — bluebeam.parseDefaultStyle has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MeasurementsPanel.AssemblyPicker (cyclomatic 45) · ×1
  • MeasurementsPanel.AssemblyPicker (cyclomatic 45) apps/web/src/components/MeasurementsPanel.tsx:735 — MeasurementsPanel.AssemblyPicker has cyclomatic complexity 45 (threshold 15). Of this number, 19 points are the body's own statements and 26 belong to 6 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 · SemanticComparePanel.SemanticComparePanel (cyclomatic 45) · ×1
  • SemanticComparePanel.SemanticComparePanel (cyclomatic 45) apps/web/src/components/SemanticComparePanel.tsx:80 — SemanticComparePanel.SemanticComparePanel has cyclomatic complexity 45 (threshold 15). Of this number, 31 points are the body's own statements and 14 belong to 6 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 · RevuMigrationDialog.RevuMigrationDialog (cyclomatic 45) · ×1
  • RevuMigrationDialog.RevuMigrationDialog (cyclomatic 45) apps/web/src/components/RevuMigrationDialog.tsx:25 — RevuMigrationDialog.RevuMigrationDialog has cyclomatic complexity 45 (threshold 15). Of this number, 28 points are the body's own statements and 17 belong to 12 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SheetView.SheetView (cyclomatic 45) · ×1
  • SheetView.SheetView (cyclomatic 45) apps/web/src/components/standardsWizard/SheetView.tsx:54 — SheetView.SheetView has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 11 of the 45 points are its own statements and the rest belongs to 15 function items inside it that branch (down, a function literal at line 95, up, …). 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 · bax.exportBax (cyclomatic 45) · ×1
  • bax.exportBax (cyclomatic 45) packages/markup/src/bax.ts:232 — bax.exportBax has cyclomatic complexity 45 (threshold 15). Of this number, 26 points are the body's own statements and 19 belong to 7 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 · revuWrite.writeBtx (cyclomatic 45) · ×1
  • revuWrite.writeBtx (cyclomatic 45) packages/markup/src/revuWrite.ts:535 — revuWrite.writeBtx 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 · chainage.chainageReport (cyclomatic 45) · ×1
  • chainage.chainageReport (cyclomatic 45) packages/sheets/src/chainage.ts:472 — chainage.chainageReport has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 1 of the 45 points is its own statement and the rest belongs to 13 function literals inside it that branch (lines 502, 514, 485, …). 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 · paths.registerPathIpc (cyclomatic 44) · ×1
  • paths.registerPathIpc (cyclomatic 44) apps/desktop/src/paths.ts:64 — paths.registerPathIpc has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 1 of the 44 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 65, 81, 94, …). 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 · StitchPanel.StitchPanel (cyclomatic 44) · ×1
  • StitchPanel.StitchPanel (cyclomatic 44) apps/web/src/components/StitchPanel.tsx:44 — StitchPanel.StitchPanel has cyclomatic complexity 44 (threshold 15). Of this number, 17 points are the body's own statements and 27 belong to 9 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SketchBar.SketchBar (cyclomatic 44) · ×1
  • SketchBar.SketchBar (cyclomatic 44) apps/web/src/components/SketchBar.tsx:25 — SketchBar.SketchBar has cyclomatic complexity 44 (threshold 15). Of this number, 26 points are the body's own statements and 18 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 · render.renderEntity (cyclomatic 44) · ×1
  • render.renderEntity (cyclomatic 44) apps/web/src/cad/render.ts:348 — render.renderEntity has cyclomatic complexity 44 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · revuWrite.applyStyle (cyclomatic 44) · ×1
  • revuWrite.applyStyle (cyclomatic 44) packages/markup/src/revuWrite.ts:270 — revuWrite.applyStyle has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · links.detectLinks (cyclomatic 44) · ×1
  • links.detectLinks (cyclomatic 44) REDACTED:331 — links.detectLinks has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 1 of the 44 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 340, 368, 393, …). 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 · help.blocks (cyclomatic 43) · ×1
  • help.blocks (cyclomatic 43) apps/web/public/help/help.js:83 — help.blocks has cyclomatic complexity 43 (threshold 15). Of this number, 42 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 · MarkupTools.newMarkup (cyclomatic 43) · ×1
  • MarkupTools.newMarkup (cyclomatic 43) apps/web/src/markup/MarkupTools.ts:4029 — MarkupTools.newMarkup has cyclomatic complexity 43 (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 · starters.starterGroups (cyclomatic 43) · ×1
  • starters.starterGroups (cyclomatic 43) apps/web/src/assemblies/starters.ts:25 — starters.starterGroups has cyclomatic complexity 43 (threshold 15). Of this number, 41 points are the body's own statements and 2 belong to 2 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 · SessionsPanel.SessionList (cyclomatic 43) · ×1
  • SessionsPanel.SessionList (cyclomatic 43) apps/web/src/components/SessionsPanel.tsx:170 — SessionsPanel.SessionList has cyclomatic complexity 43 (threshold 15). Most of this is not in the body itself: 13 of the 43 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 192, 287, 201, …). 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 · ProductListsDialog.ProductListsDialog (cyclomatic 42) · ×1
  • ProductListsDialog.ProductListsDialog (cyclomatic 42) apps/web/src/components/ProductListsDialog.tsx:37 — ProductListsDialog.ProductListsDialog has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 10 of the 42 points are its own statements and the rest belongs to 19 function items inside it that branch (a function literal at line 257, remove, a function literal at line 87, …). 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 · TakeoffReview.Proposal (cyclomatic 42) · ×1
  • TakeoffReview.Proposal (cyclomatic 42) apps/web/src/components/TakeoffReview.tsx:112 — TakeoffReview.Proposal has cyclomatic complexity 42 (threshold 15). Of this number, 29 points are the body's own statements and 13 belong to 5 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 · ProjectsPanel.ProjectList (cyclomatic 42) · ×1
  • ProjectsPanel.ProjectList (cyclomatic 42) apps/web/src/components/ProjectsPanel.tsx:105 — ProjectsPanel.ProjectList has cyclomatic complexity 42 (threshold 15). Of this number, 16 points are the body's own statements and 26 belong to 8 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 · bax.injectBax (cyclomatic 42) · ×1
  • bax.injectBax (cyclomatic 42) packages/markup/src/bax.ts:467 — bax.injectBax has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 11 of the 42 points are its own statements and the rest belongs to 7 function items inside it that branch (resolve, add, walk, …). 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 · content.readItem (cyclomatic 41) · ×1
  • content.readItem (cyclomatic 41) apps/web/src/documents/renderCopy/content.ts:592 — content.readItem has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionDialogs.StartSessionDialog (cyclomatic 41) · ×1
  • SessionDialogs.StartSessionDialog (cyclomatic 41) apps/web/src/components/sessions/SessionDialogs.tsx:95 — SessionDialogs.StartSessionDialog has cyclomatic complexity 41 (threshold 15). Of this number, 25 points are the body's own statements and 16 belong to 10 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 · detect.candidatesFor (cyclomatic 41) · ×1
  • detect.candidatesFor (cyclomatic 41) packages/sheets/src/detect.ts:171 — detect.candidatesFor has cyclomatic complexity 41 (threshold 15). Of this number, 28 points are the body's own statements and 13 belong to 4 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 · script.test (cyclomatic 40) · ×1
  • script.test (cyclomatic 40) apps/web/src/scripts/script.ts:359 — script.test has cyclomatic complexity 40 (threshold 15). Of this number, 37 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ltv.xrefAt (cyclomatic 40) · ×1
  • ltv.xrefAt (cyclomatic 40) REDACTED:266 — ltv.xrefAt has cyclomatic complexity 40 (threshold 15). Of this number, 38 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 · pdfSign.addValidationData (cyclomatic 40) · ×1
  • pdfSign.addValidationData (cyclomatic 40) apps/web/src/documents/pdfSign.ts:637 — pdfSign.addValidationData has cyclomatic complexity 40 (threshold 15). Of this number, 23 points are the body's own statements and 17 belong to 4 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 · index.assemble (cyclomatic 40) · ×1
  • index.assemble (cyclomatic 40) apps/web/src/cad/dwg/index.ts:126 — index.assemble has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (index.assemble::toEntity) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · LabelRegionsPanel.LabelRegionsPanel (cyclomatic 40) · ×1
  • LabelRegionsPanel.LabelRegionsPanel (cyclomatic 40) apps/web/src/components/LabelRegionsPanel.tsx:40 — LabelRegionsPanel.LabelRegionsPanel has cyclomatic complexity 40 (threshold 15). Of this number, 31 points are the body's own statements and 9 belong to 4 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 · SearchPanel.SearchPanel (cyclomatic 40) · ×1
  • SearchPanel.SearchPanel (cyclomatic 40) apps/web/src/components/SearchPanel.tsx:122 — SearchPanel.SearchPanel has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (SearchPanel.SearchPanel::search, SearchPanel.SearchPanel::onArrow) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · detect.detectSheets (cyclomatic 40) · ×1
  • detect.detectSheets (cyclomatic 40) packages/sheets/src/detect.ts:398 — detect.detectSheets has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 7 of the 40 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 460, a function literal at line 429, pagesNear, …). 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 · MarkupTools.setTool (cyclomatic 39) · ×1
  • MarkupTools.setTool (cyclomatic 39) apps/web/src/markup/MarkupTools.ts:1018 — MarkupTools.setTool has cyclomatic complexity 39 (threshold 15). Of this number, 37 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 · DriveSession.update (cyclomatic 39) · ×1
  • DriveSession.update (cyclomatic 39) apps/web/src/studio/drive/DriveSession.ts:1019 — DriveSession.update has cyclomatic complexity 39 (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 · assistant.reportDocumentChanges (cyclomatic 39) · ×1
  • assistant.reportDocumentChanges (cyclomatic 39) apps/web/src/desktop/assistant.ts:1114 — assistant.reportDocumentChanges has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 10 of the 39 points are its own statements and the rest belongs to one function literal inside it that branches (line 1128). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · toolchest.parsePdfObject · ×1
  • toolchest.parsePdfObject::value (cyclomatic 39) REDACTED:103 — toolchest.parsePdfObject::value has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · landxml.parseLandXml (cyclomatic 38) · ×1
  • landxml.parseLandXml (cyclomatic 38) apps/web/src/geospatial/landxml.ts:13 — landxml.parseLandXml has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (landxml.parseLandXml::coordGeom) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · PageToolsDialog.PageToolsDialog (cyclomatic 38) · ×1
  • PageToolsDialog.PageToolsDialog (cyclomatic 38) apps/web/src/components/PageToolsDialog.tsx:74 — PageToolsDialog.PageToolsDialog has cyclomatic complexity 38 (threshold 15). Of this number, 29 points are the body's own statements and 9 belong to 6 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.writePdf (cyclomatic 38) · ×1
  • pdf.writePdf (cyclomatic 38) apps/web/src/cad/pdf.ts:64 — pdf.writePdf has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 14 of the 38 points are its own statements and the rest belongs to 5 function items inside it that branch (draw, fontFor, walk, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · assemblies.sanitizeAssemblies (cyclomatic 38) · ×1
  • assemblies.sanitizeAssemblies (cyclomatic 38) packages/markup/src/assemblies.ts:65 — assemblies.sanitizeAssemblies has cyclomatic complexity 38 (threshold 15). Of this number, 36 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · export.nativeForm (cyclomatic 38) · ×1
  • export.nativeForm (cyclomatic 38) packages/markup/src/export.ts:1426 — export.nativeForm has cyclomatic complexity 38 (threshold 15). Of this number, 37 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ToolBar.MarkupFields (cyclomatic 37) · ×1
  • ToolBar.MarkupFields (cyclomatic 37) apps/web/src/components/ToolBar.tsx:591 — ToolBar.MarkupFields has cyclomatic complexity 37 (threshold 15). Of this number, 18 points are the body's own statements and 19 belong to 10 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 · SignaturesPanel.SignatureDialog (cyclomatic 37) · ×1
  • SignaturesPanel.SignatureDialog (cyclomatic 37) apps/web/src/components/SignaturesPanel.tsx:18 — SignaturesPanel.SignatureDialog has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 10 of the 37 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 33, save, a function literal at line 120, …). 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 · EraseRegionsPanel.EraseRegionsPanel (cyclomatic 37) · ×1
  • EraseRegionsPanel.EraseRegionsPanel (cyclomatic 37) apps/web/src/components/EraseRegionsPanel.tsx:42 — EraseRegionsPanel.EraseRegionsPanel has cyclomatic complexity 37 (threshold 15). Of this number, 19 points are the body's own statements and 18 belong to 6 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 · teachLinks.learnLink (cyclomatic 37) · ×1
  • teachLinks.learnLink (cyclomatic 37) apps/web/src/sheets/teachLinks.ts:127 — teachLinks.learnLink has cyclomatic complexity 37 (threshold 15). Of this number, 35 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 · DriveSession.readFolder (cyclomatic 36) · ×1
  • DriveSession.readFolder (cyclomatic 36) apps/web/src/studio/drive/DriveSession.ts:572 — DriveSession.readFolder has cyclomatic complexity 36 (threshold 15). Of this number, 34 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 · marks.marksToLinks (cyclomatic 36) · ×1
  • marks.marksToLinks (cyclomatic 36) apps/web/src/sheets/marks.ts:447 — marks.marksToLinks 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 · StampsDialog.StampMenu (cyclomatic 36) · ×1
  • StampsDialog.StampMenu (cyclomatic 36) apps/web/src/components/StampsDialog.tsx:486 — StampsDialog.StampMenu has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 5 of the 36 points are its own statements and the rest belongs to 11 function items inside it that branch (onMenuKey, a function literal at line 521, a function literal at line 518, …). 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 · process.recolourContent (cyclomatic 36) · ×1
  • process.recolourContent (cyclomatic 36) apps/web/src/documents/process.ts:233 — process.recolourContent 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. This shape REPEATS in the file: one other method here (process.recolourContent::replaceColour) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · chainage.readTicks (cyclomatic 36) · ×1
  • chainage.readTicks (cyclomatic 36) packages/sheets/src/chainage.ts:163 — chainage.readTicks has cyclomatic complexity 36 (threshold 15). Of this number, 28 points are the body's own statements and 8 belong to 4 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 · ifc.parseIfc (cyclomatic 35) · ×1
  • ifc.parseIfc (cyclomatic 35) apps/web/src/geospatial/ifc.ts:186 — ifc.parseIfc 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. This shape REPEATS in the file: 2 other methods here (ifc.parseIfc::curve, ifc.parseIfc::item) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · MenuSearch.MenuSearch (cyclomatic 35) · ×1
  • MenuSearch.MenuSearch (cyclomatic 35) apps/web/src/components/MenuSearch.tsx:36 — MenuSearch.MenuSearch has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 10 of the 35 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 177, row, runAt, …). 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 · ComparePagePicker.ComparePagePicker (cyclomatic 35) · ×1
  • ComparePagePicker.ComparePagePicker (cyclomatic 35) apps/web/src/components/ComparePagePicker.tsx:82 — ComparePagePicker.ComparePagePicker has cyclomatic complexity 35 (threshold 15). Of this number, 25 points are the body's own statements and 10 belong to 4 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 · header.readHeader (cyclomatic 35) · ×1
  • header.readHeader (cyclomatic 35) apps/web/src/cad/dwg/header.ts:15 — header.readHeader has cyclomatic complexity 35 (threshold 15). Of this number, 33 points are the body's own statements and 2 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 · cadTools.cadPreviewOf (cyclomatic 34) · ×1
  • cadTools.cadPreviewOf (cyclomatic 34) apps/web/src/markup/cadTools.ts:574 — cadTools.cadPreviewOf has cyclomatic complexity 34 (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 · DriveSession.join (cyclomatic 34) · ×1
  • DriveSession.join (cyclomatic 34) apps/web/src/studio/drive/DriveSession.ts:340 — DriveSession.join has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · standards.parseStandardFile (cyclomatic 34) · ×1
  • standards.parseStandardFile (cyclomatic 34) apps/web/src/sheets/standards.ts:296 — standards.parseStandardFile has cyclomatic complexity 34 (threshold 15). Of this number, 26 points are the body's own statements and 8 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 · process.recolourContent · ×1
  • process.recolourContent::replaceColour (cyclomatic 34) apps/web/src/documents/process.ts:252 — process.recolourContent::replaceColour has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (process.recolourContent) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · DigitalSignatures.DigitalIdsDialog (cyclomatic 34) · ×1
  • DigitalSignatures.DigitalIdsDialog (cyclomatic 34) REDACTED:183 — DigitalSignatures.DigitalIdsDialog has cyclomatic complexity 34 (threshold 15). Of this number, 22 points are the body's own statements and 12 belong to 8 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · render.readHatch (cyclomatic 34) · ×1
  • render.readHatch (cyclomatic 34) apps/web/src/cad/render.ts:959 — render.readHatch has cyclomatic complexity 34 (threshold 15). Of this number, 29 points are the body's own statements and 5 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 · geometry.hitTest (cyclomatic 34) · ×1
  • geometry.hitTest (cyclomatic 34) packages/markup/src/geometry.ts:766 — geometry.hitTest has cyclomatic complexity 34 (threshold 15). Of this number, 31 points are the body's own statements and 3 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 · toolchest.lexContent (cyclomatic 34) · ×1
  • toolchest.lexContent (cyclomatic 34) REDACTED:910 — toolchest.lexContent has cyclomatic complexity 34 (threshold 15). Of this number, 33 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 · TileViewer.onPointerDown (cyclomatic 33) · ×1
  • TileViewer.onPointerDown (cyclomatic 33) apps/web/src/viewer/TileViewer.ts:1749 — TileViewer.onPointerDown has cyclomatic complexity 33 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · dxf.parseDxf (cyclomatic 33) · ×1
  • dxf.parseDxf (cyclomatic 33) apps/web/src/geospatial/dxf.ts:12 — dxf.parseDxf has cyclomatic complexity 33 (threshold 15). Of this number, 30 points are the body's own statements and 3 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 · PropertiesPanel.SlopeRows (cyclomatic 33) · ×1
  • PropertiesPanel.SlopeRows (cyclomatic 33) apps/web/src/components/PropertiesPanel.tsx:718 — PropertiesPanel.SlopeRows has cyclomatic complexity 33 (threshold 15). Of this number, 16 points are the body's own statements and 17 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · pki.crlStatus (cyclomatic 33) · ×1
  • pki.crlStatus (cyclomatic 33) apps/web/src/documents/pki.ts:685 — pki.crlStatus has cyclomatic complexity 33 (threshold 15). Of this number, 32 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 · wizardLinks.learnAlignmentChain (cyclomatic 33) · ×1
  • wizardLinks.learnAlignmentChain (cyclomatic 33) apps/web/src/sheets/wizardLinks.ts:221 — wizardLinks.learnAlignmentChain has cyclomatic complexity 33 (threshold 15). Of this number, 30 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 · assistantStitch.updateMatchLines (cyclomatic 33) · ×1
  • assistantStitch.updateMatchLines (cyclomatic 33) apps/web/src/desktop/assistantStitch.ts:260 — assistantStitch.updateMatchLines has cyclomatic complexity 33 (threshold 15). Of this number, 31 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 · codebase-reach.canvas.CodebaseReach (cyclomatic 33) · ×1
  • codebase-reach.canvas.CodebaseReach (cyclomatic 33) docs/codebase-reach.canvas.tsx:261 — codebase-reach.canvas.CodebaseReach has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 11 of the 33 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 285, 275, 287, …). 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 · cad.transformMarkup (cyclomatic 33) · ×1
  • cad.transformMarkup (cyclomatic 33) packages/markup/src/cad.ts:626 — cad.transformMarkup has cyclomatic complexity 33 (threshold 15). Of this number, 31 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · import.toMarkups (cyclomatic 33) · ×1
  • import.toMarkups (cyclomatic 33) packages/markup/src/import.ts:540 — import.toMarkups has cyclomatic complexity 33 (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 · MarkupTools.doubleClick (cyclomatic 32) · ×1
  • MarkupTools.doubleClick (cyclomatic 32) apps/web/src/markup/MarkupTools.ts:3768 — MarkupTools.doubleClick has cyclomatic complexity 32 (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 · MarkupList.MarkupList · ×1
  • MarkupList.MarkupList::editor (cyclomatic 32) apps/web/src/components/MarkupList.tsx:583 — MarkupList.MarkupList::editor has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (MarkupList.MarkupList) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · ProfilesDialog.ProfilesDialog (cyclomatic 32) · ×1
  • ProfilesDialog.ProfilesDialog (cyclomatic 32) apps/web/src/components/ProfilesDialog.tsx:101 — ProfilesDialog.ProfilesDialog has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 13 of the 32 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 374, 122, 220, …). 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 · semantic.compareParagraphs (cyclomatic 32) · ×1
  • semantic.compareParagraphs (cyclomatic 32) apps/web/src/compare/semantic.ts:429 — semantic.compareParagraphs has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body's own statements and 3 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 · text.mtextParagraphs (cyclomatic 32) · ×1
  • text.mtextParagraphs (cyclomatic 32) apps/web/src/cad/text.ts:29 — text.mtextParagraphs has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · convert.convertCad (cyclomatic 32) · ×1
  • convert.convertCad (cyclomatic 32) apps/web/src/cad/convert.ts:83 — convert.convertCad has cyclomatic complexity 32 (threshold 15). Of this number, 28 points are the body's own statements and 4 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 · store.describeChange (cyclomatic 32) · ×1
  • store.describeChange (cyclomatic 32) packages/markup/src/store.ts:1340 — store.describeChange has cyclomatic complexity 32 (threshold 15). Of this number, 31 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 · content.optimizeContent (cyclomatic 31) · ×1
  • content.optimizeContent (cyclomatic 31) apps/web/src/documents/renderCopy/content.ts:354 — content.optimizeContent has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 14 of the 31 points are its own statements and the rest belongs to 2 function items inside it that branch (take, flush). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ContextMenu.MenuList (cyclomatic 31) · ×1
  • ContextMenu.MenuList (cyclomatic 31) apps/web/src/components/ContextMenu.tsx:44 — ContextMenu.MenuList has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 8 of the 31 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 88, 55, 50, …). 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 · Library.Library (cyclomatic 31) · ×1
  • Library.Library (cyclomatic 31) apps/web/src/components/Library.tsx:32 — Library.Library has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 10 of the 31 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 173, finishNaming, fileMenu, …). 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 · script.tokenize (cyclomatic 31) · ×1
  • script.tokenize (cyclomatic 31) apps/web/src/scripts/script.ts:97 — script.tokenize has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DigitalSignatures.SignDialog (cyclomatic 31) · ×1
  • DigitalSignatures.SignDialog (cyclomatic 31) REDACTED:553 — DigitalSignatures.SignDialog has cyclomatic complexity 31 (threshold 15). Of this number, 22 points are the body's own statements and 9 belong to 5 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 · SoundDialog.SoundDialog (cyclomatic 31) · ×1
  • SoundDialog.SoundDialog (cyclomatic 31) apps/web/src/components/SoundDialog.tsx:21 — SoundDialog.SoundDialog has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 12 of the 31 points are its own statements and the rest belongs to 6 function items inside it that branch (start, place, a function literal at line 49, …). 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 · HyperlinkDialog.HyperlinkDialog (cyclomatic 31) · ×1
  • HyperlinkDialog.HyperlinkDialog (cyclomatic 31) apps/web/src/components/HyperlinkDialog.tsx:31 — HyperlinkDialog.HyperlinkDialog has cyclomatic complexity 31 (threshold 15). Of this number, 18 points are the body's own statements and 13 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 · FormsPanel.FormsPanel (cyclomatic 31) · ×1
  • FormsPanel.FormsPanel (cyclomatic 31) apps/web/src/components/FormsPanel.tsx:370 — FormsPanel.FormsPanel has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 10 of the 31 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 387, a function literal at line 448, move, …). 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 · DocumentPropertiesDialog.DocumentPropertiesDialog (cyclomatic 31) · ×1
  • DocumentPropertiesDialog.DocumentPropertiesDialog (cyclomatic 31) apps/web/src/components/DocumentPropertiesDialog.tsx:34 — DocumentPropertiesDialog.DocumentPropertiesDialog has cyclomatic complexity 31 (threshold 15). Of this number, 23 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · render.hatch (cyclomatic 31) · ×1
  • render.hatch (cyclomatic 31) apps/web/src/cad/render.ts:1078 — render.hatch has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MarkupStore.remapPages (cyclomatic 31) · ×1
  • MarkupStore.remapPages (cyclomatic 31) packages/markup/src/store.ts:828 — MarkupStore.remapPages has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 2 of the 31 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 840, turn, a function literal at line 898, …). 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 · xfdf.markupsFromXfdf (cyclomatic 31) · ×1
  • xfdf.markupsFromXfdf (cyclomatic 31) packages/markup/src/xfdf.ts:250 — xfdf.markupsFromXfdf has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 9 of the 31 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 260, a function literal at line 285, date, …). 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 · fill.dynamicFill (cyclomatic 31) · ×1
  • fill.dynamicFill (cyclomatic 31) packages/measure/src/fill.ts:28 — fill.dynamicFill has cyclomatic complexity 31 (threshold 15). Of this number, 24 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · worker.clipStrokedPath (cyclomatic 31) · ×1
  • worker.clipStrokedPath (cyclomatic 31) packages/pdf-core/src/worker.ts:1417 — worker.clipStrokedPath has cyclomatic complexity 31 (threshold 15). Of this number, 29 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 · worker.handle (cyclomatic 31) · ×1
  • worker.handle (cyclomatic 31) packages/pdf-core/src/worker.ts:1983 — worker.handle has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · pki.pkiRequest (cyclomatic 30) · ×1
  • pki.pkiRequest (cyclomatic 30) apps/desktop/src/pki.ts:133 — pki.pkiRequest has cyclomatic complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cadTools.cadPrompt (cyclomatic 30) · ×1
  • cadTools.cadPrompt (cyclomatic 30) apps/web/src/markup/cadTools.ts:517 — cadTools.cadPrompt has cyclomatic complexity 30 (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 · ColorMenu.ColorMenu (cyclomatic 30) · ×1
  • ColorMenu.ColorMenu (cyclomatic 30) apps/web/src/components/ColorMenu.tsx:43 — ColorMenu.ColorMenu has cyclomatic complexity 30 (threshold 15). Of this number, 20 points are the body's own statements and 10 belong to 8 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 · LinkPreview.PreviewWindow (cyclomatic 30) · ×1
  • LinkPreview.PreviewWindow (cyclomatic 30) apps/web/src/components/LinkPreview.tsx:84 — LinkPreview.PreviewWindow has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 12 of the 30 points are its own statements and the rest belongs to 12 function items inside it that branch (zoomAt, panStart, a function literal at line 158, …). 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 · CameraDialog.CameraDialog (cyclomatic 30) · ×1
  • CameraDialog.CameraDialog (cyclomatic 30) apps/web/src/components/CameraDialog.tsx:37 — CameraDialog.CameraDialog has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 9 of the 30 points are its own statements and the rest belongs to 11 function items inside it that branch (capture, finish, a function literal at line 120, …). 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 · stampPdf.parseStampPdf (cyclomatic 30) · ×1
  • stampPdf.parseStampPdf (cyclomatic 30) packages/markup/src/stampPdf.ts:117 — stampPdf.parseStampPdf has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 11 of the 30 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 145, 123, 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.
D1 · Cyclomatic Complexity · chainage.assignAlignments (cyclomatic 30) · ×1
  • chainage.assignAlignments (cyclomatic 30) packages/sheets/src/chainage.ts:305 — chainage.assignAlignments has cyclomatic complexity 30 (threshold 15). Of this number, 26 points are the body's own statements and 4 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 · StampsDialog.StampsDialog (cyclomatic 29) · ×1
  • StampsDialog.StampsDialog (cyclomatic 29) apps/web/src/components/StampsDialog.tsx:312 — StampsDialog.StampsDialog has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 8 of the 29 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 372, insertField, a function literal at line 337, …). 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 · HeaderFooterDialog.HeaderFooterDialog (cyclomatic 29) · ×1
  • HeaderFooterDialog.HeaderFooterDialog (cyclomatic 29) apps/web/src/components/HeaderFooterDialog.tsx:43 — HeaderFooterDialog.HeaderFooterDialog has cyclomatic complexity 29 (threshold 15). Of this number, 16 points are the body's own statements and 13 belong to 9 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ShortcutsDialog.ShortcutsDialog (cyclomatic 29) · ×1
  • ShortcutsDialog.ShortcutsDialog (cyclomatic 29) apps/web/src/components/ShortcutsDialog.tsx:22 — ShortcutsDialog.ShortcutsDialog has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 2 of the 29 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 122, a function literal at line 82, a function literal at line 58, …). 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 · pdf.textOps (cyclomatic 29) · ×1
  • pdf.textOps (cyclomatic 29) apps/web/src/cad/pdf.ts:236 — pdf.textOps has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 257). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · catalog.parseIndex (cyclomatic 29) · ×1
  • catalog.parseIndex (cyclomatic 29) apps/web/src/library/catalog.ts:59 — catalog.parseIndex 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 · process.recolourPages (cyclomatic 28) · ×1
  • process.recolourPages (cyclomatic 28) apps/web/src/documents/process.ts:403 — process.recolourPages has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 10 of the 28 points are its own statements and the rest belongs to 2 function items inside it that branch (rewrite, rewriteForm). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · StatusBar.StatusBar (cyclomatic 28) · ×1
  • StatusBar.StatusBar (cyclomatic 28) apps/web/src/components/StatusBar.tsx:83 — StatusBar.StatusBar has cyclomatic complexity 28 (threshold 15). Of this number, 24 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · startTips.parseTip (cyclomatic 28) · ×1
  • startTips.parseTip (cyclomatic 28) apps/web/src/help/startTips.ts:51 — startTips.parseTip has cyclomatic complexity 28 (threshold 15). Of this number, 19 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · indexer.readPdfAnnotations (cyclomatic 28) · ×1
  • indexer.readPdfAnnotations (cyclomatic 28) apps/web/src/sheets/indexer.ts:259 — indexer.readPdfAnnotations has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 264, 298, 311). 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 · ProjectsPanel.Members (cyclomatic 28) · ×1
  • ProjectsPanel.Members (cyclomatic 28) apps/web/src/components/ProjectsPanel.tsx:995 — ProjectsPanel.Members has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 11 of the 28 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 1038, a function literal at line 1024, load, …). 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 · LibraryDialog.LibraryDialog (cyclomatic 28) · ×1
  • LibraryDialog.LibraryDialog (cyclomatic 28) apps/web/src/components/LibraryDialog.tsx:21 — LibraryDialog.LibraryDialog has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 9 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 108, a function literal at line 36, add, …). 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 · xml.parseXml (cyclomatic 28) · ×1
  • xml.parseXml (cyclomatic 28) packages/markup/src/xml.ts:21 — xml.parseXml has cyclomatic complexity 28 (threshold 15). Of this number, 27 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 · revuWrite.imageObjects (cyclomatic 28) · ×1
  • revuWrite.imageObjects (cyclomatic 28) packages/markup/src/revuWrite.ts:415 — revuWrite.imageObjects has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MenuBar.MenuBar (cyclomatic 27) · ×1
  • MenuBar.MenuBar (cyclomatic 27) apps/web/src/components/MenuBar.tsx:221 — MenuBar.MenuBar has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 9 function items inside it that branch (menu, a function literal at line 672, a function literal at line 696, …). 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 · semantic.similarPairs (cyclomatic 27) · ×1
  • semantic.similarPairs (cyclomatic 27) apps/web/src/compare/semantic.ts:351 — semantic.similarPairs has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 366, 355, 404, …). 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 · ToolPreviewCard.ToolPreviewCard (cyclomatic 27) · ×1
  • ToolPreviewCard.ToolPreviewCard (cyclomatic 27) apps/web/src/components/ToolPreviewCard.tsx:28 — ToolPreviewCard.ToolPreviewCard has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 82, 51, 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.
D1 · Cyclomatic Complexity · PagesPanel.Thumbnail (cyclomatic 27) · ×1
  • PagesPanel.Thumbnail (cyclomatic 27) apps/web/src/components/PagesPanel.tsx:212 — PagesPanel.Thumbnail has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 260, 289, 319, …). 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 · SessionDialogs.EndSessionDialog (cyclomatic 27) · ×1
  • SessionDialogs.EndSessionDialog (cyclomatic 27) apps/web/src/components/sessions/SessionDialogs.tsx:657 — SessionDialogs.EndSessionDialog has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · pack.parseTradePack (cyclomatic 27) · ×1
  • pack.parseTradePack (cyclomatic 27) apps/web/src/library/pack.ts:123 — pack.parseTradePack has cyclomatic complexity 27 (threshold 15). Of this number, 20 points are the body's own statements and 7 belong to 4 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 · assistant.assistantCall (cyclomatic 27) · ×1
  • assistant.assistantCall (cyclomatic 27) apps/web/src/desktop/assistant.ts:1162 — assistant.assistantCall has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MarkupStore.transformPages (cyclomatic 27) · ×1
  • MarkupStore.transformPages (cyclomatic 27) packages/markup/src/store.ts:977 — MarkupStore.transformPages has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 988, pt, rect, …). 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 · Scanner.next (cyclomatic 26) · ×1
  • Scanner.next (cyclomatic 26) apps/web/src/documents/renderCopy/content.ts:52 — Scanner.next 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 · MarkupTools.ownPreview (cyclomatic 26) · ×1
  • MarkupTools.ownPreview (cyclomatic 26) apps/web/src/markup/MarkupTools.ts:4974 — MarkupTools.ownPreview has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ScriptsDialog.ScriptsDialog (cyclomatic 26) · ×1
  • ScriptsDialog.ScriptsDialog (cyclomatic 26) apps/web/src/components/ScriptsDialog.tsx:50 — ScriptsDialog.ScriptsDialog has cyclomatic complexity 26 (threshold 15). Of this number, 20 points are the body's own statements and 6 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 · viewScales.proposeViews (cyclomatic 26) · ×1
  • viewScales.proposeViews (cyclomatic 26) apps/web/src/measure/viewScales.ts:128 — viewScales.proposeViews has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 168, inArea, a function literal at line 131, …). 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 · process.recolourPicture (cyclomatic 26) · ×1
  • process.recolourPicture (cyclomatic 26) apps/web/src/documents/process.ts:461 — process.recolourPicture 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 · OfflinePrefs.OfflinePrefs (cyclomatic 26) · ×1
  • OfflinePrefs.OfflinePrefs (cyclomatic 26) apps/web/src/components/OfflinePrefs.tsx:12 — OfflinePrefs.OfflinePrefs has cyclomatic complexity 26 (threshold 15). Of this number, 16 points are the body's own statements and 10 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 · objects.hatch (cyclomatic 26) · ×1
  • objects.hatch (cyclomatic 26) apps/web/src/cad/dwg/objects.ts:861 — objects.hatch 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 · objects.readTableObject (cyclomatic 26) · ×1
  • objects.readTableObject (cyclomatic 26) apps/web/src/cad/dwg/objects.ts:1182 — objects.readTableObject 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 · sheets.layoutSheet (cyclomatic 26) · ×1
  • sheets.layoutSheet (cyclomatic 26) apps/web/src/cad/sheets.ts:261 — sheets.layoutSheet has cyclomatic complexity 26 (threshold 15). Of this number, 24 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 · repeatedRegions.findRepeatedRegions (cyclomatic 26) · ×1
  • repeatedRegions.findRepeatedRegions (cyclomatic 26) apps/web/src/sheets/repeatedRegions.ts:65 — repeatedRegions.findRepeatedRegions has cyclomatic complexity 26 (threshold 15). 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, 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 · ProjectsPanel.ManageProject (cyclomatic 26) · ×1
  • ProjectsPanel.ManageProject (cyclomatic 26) apps/web/src/components/ProjectsPanel.tsx:634 — ProjectsPanel.ManageProject has cyclomatic complexity 26 (threshold 15). Of this number, 20 points are the body's own statements and 6 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 · estimating.sanitizeProductLists (cyclomatic 26) · ×1
  • estimating.sanitizeProductLists (cyclomatic 26) packages/markup/src/estimating.ts:147 — estimating.sanitizeProductLists 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 · bluebeam.scaleFromMeasure (cyclomatic 26) · ×1
  • bluebeam.scaleFromMeasure (cyclomatic 26) packages/markup/src/bluebeam.ts:296 — bluebeam.scaleFromMeasure has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · worker.extractSegments (cyclomatic 26) · ×1
  • worker.extractSegments (cyclomatic 26) packages/pdf-core/src/worker.ts:734 — worker.extractSegments has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (walkPath, paperOnly, walk, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · GraphBroker.request (cyclomatic 25) · ×1
  • GraphBroker.request (cyclomatic 25) apps/desktop/src/graph.ts:82 — GraphBroker.request has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RevuSettings.scan (cyclomatic 25) · ×1
  • RevuSettings.scan (cyclomatic 25) apps/desktop/src/revuSettings.ts:92 — RevuSettings.scan has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, rank). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · formula.evaluate (cyclomatic 25) · ×1
  • formula.evaluate (cyclomatic 25) apps/web/src/columns/formula.ts:251 — formula.evaluate 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 · PropertiesPanel.slopeOfKind (cyclomatic 25) · ×1
  • PropertiesPanel.slopeOfKind (cyclomatic 25) apps/web/src/components/PropertiesPanel.tsx:697 — PropertiesPanel.slopeOfKind has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ToolBar.HatchMenu (cyclomatic 25) · ×1
  • ToolBar.HatchMenu (cyclomatic 25) apps/web/src/components/ToolBar.tsx:730 — ToolBar.HatchMenu has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 belong to 6 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 · quantities.assemblyProblems (cyclomatic 25) · ×1
  • quantities.assemblyProblems (cyclomatic 25) apps/web/src/assemblies/quantities.ts:200 — quantities.assemblyProblems has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body's own statements and 6 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 · scaleCheck.dimensionScale (cyclomatic 25) · ×1
  • scaleCheck.dimensionScale (cyclomatic 25) apps/web/src/measure/scaleCheck.ts:119 — scaleCheck.dimensionScale 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 · pki.completeChain (cyclomatic 25) · ×1
  • pki.completeChain (cyclomatic 25) apps/web/src/documents/pki.ts:331 — pki.completeChain has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body's own statements and 3 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 · semantic.wordDiff (cyclomatic 25) · ×1
  • semantic.wordDiff (cyclomatic 25) apps/web/src/compare/semantic.ts:185 — semantic.wordDiff has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body's own statements and 3 belong to 2 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.
D1 · Cyclomatic Complexity · r2007.lz77ac21 (cyclomatic 25) · ×1
  • r2007.lz77ac21 (cyclomatic 25) apps/web/src/cad/dwg/r2007.ts:207 — r2007.lz77ac21 has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 5 of the 25 points are its own statements and the rest belongs to 4 function items inside it that branch (literal, chunks, instructions, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: r2007.copyRun (cyclomatic 32) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · index.assemble · ×1
  • index.assemble::toEntity (cyclomatic 25) apps/web/src/cad/dwg/index.ts:196 — index.assemble::toEntity 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. This shape REPEATS in the file: one other method here (index.assemble) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · pack.readStyle (cyclomatic 25) · ×1
  • pack.readStyle (cyclomatic 25) apps/web/src/library/pack.ts:52 — pack.readStyle 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 · pack.readTool (cyclomatic 25) · ×1
  • pack.readTool (cyclomatic 25) apps/web/src/library/pack.ts:74 — pack.readTool has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to one function literal 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 · assistant.styleOf (cyclomatic 25) · ×1
  • assistant.styleOf (cyclomatic 25) apps/web/src/desktop/assistant.ts:607 — assistant.styleOf has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · codebase-reach.canvas.FlowGraph (cyclomatic 25) · ×1
  • codebase-reach.canvas.FlowGraph (cyclomatic 25) docs/codebase-reach.canvas.tsx:144 — codebase-reach.canvas.FlowGraph has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 5 of the 25 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 200, 183). 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 · import.importAnnotations · ×1
  • import.importAnnotations::finish (cyclomatic 25) packages/markup/src/import.ts:249 — import.importAnnotations::finish 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. This shape REPEATS in the file: one other method here (import.importAnnotations) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · toolchest.contentTemplate (cyclomatic 25) · ×1
  • toolchest.contentTemplate (cyclomatic 25) REDACTED:1084 — toolchest.contentTemplate 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 · message.handleMcpMessage (cyclomatic 24) · ×1
  • message.handleMcpMessage (cyclomatic 24) apps/desktop/src/assistant/message.ts:1002 — message.handleMcpMessage 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 · content.readClipScope (cyclomatic 24) · ×1
  • content.readClipScope (cyclomatic 24) apps/web/src/documents/renderCopy/content.ts:539 — content.readClipScope has cyclomatic complexity 24 (threshold 15). Of this number, 23 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 · cadTools.cornerClick (cyclomatic 24) · ×1
  • cadTools.cornerClick (cyclomatic 24) apps/web/src/markup/cadTools.ts:235 — cadTools.cornerClick has cyclomatic complexity 24 (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 · formula.parseFormula (cyclomatic 24) · ×1
  • formula.parseFormula (cyclomatic 24) apps/web/src/columns/formula.ts:77 — formula.parseFormula has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 4 function items inside it that branch (primary, expr, isOp, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · marks.readLabel (cyclomatic 24) · ×1
  • marks.readLabel (cyclomatic 24) apps/web/src/sheets/marks.ts:312 — marks.readLabel has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 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 · marks.findOnPage (cyclomatic 24) · ×1
  • marks.findOnPage (cyclomatic 24) apps/web/src/sheets/marks.ts:365 — marks.findOnPage has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reports.detail (cyclomatic 24) · ×1
  • reports.detail (cyclomatic 24) apps/web/src/takeoff/reports.ts:246 — reports.detail has cyclomatic complexity 24 (threshold 15). Of this number, 22 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 · pdfSign.signPdf (cyclomatic 24) · ×1
  • pdfSign.signPdf (cyclomatic 24) apps/web/src/documents/pdfSign.ts:115 — pdfSign.signPdf has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · forms.modelOf (cyclomatic 24) · ×1
  • forms.modelOf (cyclomatic 24) REDACTED:273 — forms.modelOf has cyclomatic complexity 24 (threshold 15). Of this number, 12 points are the body's own statements and 12 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 · export.mergeAnnotation (cyclomatic 24) · ×1
  • export.mergeAnnotation (cyclomatic 24) packages/markup/src/export.ts:1533 — export.mergeAnnotation 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 · export.writeColumns.entries (cyclomatic 24) · ×1
  • export.writeColumns.entries (cyclomatic 24) packages/markup/src/export.ts:1672 — export.writeColumns.entries has cyclomatic complexity 24 (threshold 15). Of this number, 23 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 · toolchest.execContent (cyclomatic 24) · ×1
  • toolchest.execContent (cyclomatic 24) REDACTED:1006 — toolchest.execContent 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 · cadTools.cadPickTarget (cyclomatic 23) · ×1
  • cadTools.cadPickTarget (cyclomatic 23) apps/web/src/markup/cadTools.ts:489 — cadTools.cadPickTarget 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 · MarkupTools.joinSelected (cyclomatic 23) · ×1
  • MarkupTools.joinSelected (cyclomatic 23) apps/web/src/markup/MarkupTools.ts:4779 — MarkupTools.joinSelected has cyclomatic complexity 23 (threshold 15). Of this number, 21 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 · PropertiesPanel.MeasurementSection (cyclomatic 23) · ×1
  • PropertiesPanel.MeasurementSection (cyclomatic 23) apps/web/src/components/PropertiesPanel.tsx:885 — PropertiesPanel.MeasurementSection has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SheetScaleReview.SheetScaleReview (cyclomatic 23) · ×1
  • SheetScaleReview.SheetScaleReview (cyclomatic 23) apps/web/src/components/SheetScaleReview.tsx:52 — SheetScaleReview.SheetScaleReview has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 107, 170, 59, …). 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 · TextEditor.TextEditor · ×1
  • TextEditor.TextEditor::onKeyDown (cyclomatic 23) apps/web/src/components/TextEditor.tsx:139 — TextEditor.TextEditor::onKeyDown 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 · imagePdf.imageDpi (cyclomatic 23) · ×1
  • imagePdf.imageDpi (cyclomatic 23) apps/web/src/documents/imagePdf.ts:18 — imagePdf.imageDpi 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 · PublishDialog.PublishDialog (cyclomatic 23) · ×1
  • PublishDialog.PublishDialog (cyclomatic 23) apps/web/src/components/PublishDialog.tsx:24 — PublishDialog.PublishDialog has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 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 · TableCellEditor.TableCellEditor (cyclomatic 23) · ×1
  • TableCellEditor.TableCellEditor (cyclomatic 23) apps/web/src/components/TableCellEditor.tsx:24 — TableCellEditor.TableCellEditor has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (onKeyDown, finish, onKeyDown::along, …). 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 · CadConvertDialog.CadConvertDialog (cyclomatic 23) · ×1
  • CadConvertDialog.CadConvertDialog (cyclomatic 23) apps/web/src/components/CadConvertDialog.tsx:24 — CadConvertDialog.CadConvertDialog has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 35, 50, 57, …). 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 · assistantStandards.proposeSheetLinks (cyclomatic 23) · ×1
  • assistantStandards.proposeSheetLinks (cyclomatic 23) apps/web/src/desktop/assistantStandards.ts:135 — assistantStandards.proposeSheetLinks has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to one function literal inside it that branches (line 143). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · activeContent.findActiveContent (cyclomatic 23) · ×1
  • activeContent.findActiveContent (cyclomatic 23) apps/web/src/documents/activeContent.ts:27 — activeContent.findActiveContent has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (visit, runs, deref). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · RawWriter.write (cyclomatic 23) · ×1
  • RawWriter.write (cyclomatic 23) packages/markup/src/bax.ts:144 — RawWriter.write has cyclomatic complexity 23 (threshold 15). Of this number, 17 points are the body's own statements and 6 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 · fdf.fdfFromPdf (cyclomatic 23) · ×1
  • fdf.fdfFromPdf (cyclomatic 23) packages/markup/src/fdf.ts:267 — fdf.fdfFromPdf has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (visit, a function literal at line 271, nameOfAnnot). 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 · Scanner.skipInlineImage (cyclomatic 22) · ×1
  • Scanner.skipInlineImage (cyclomatic 22) apps/web/src/documents/renderCopy/content.ts:163 — Scanner.skipInlineImage 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 · content.parseStrokeForm (cyclomatic 22) · ×1
  • content.parseStrokeForm (cyclomatic 22) apps/web/src/documents/renderCopy/content.ts:266 — content.parseStrokeForm 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 · MarkupTools.finish (cyclomatic 22) · ×1
  • MarkupTools.finish (cyclomatic 22) apps/web/src/markup/MarkupTools.ts:2168 — MarkupTools.finish has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal 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 · DriveSession.readFile (cyclomatic 22) · ×1
  • DriveSession.readFile (cyclomatic 22) apps/web/src/studio/drive/DriveSession.ts:689 — DriveSession.readFile 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 · marks.sectionFrame (cyclomatic 22) · ×1
  • marks.sectionFrame (cyclomatic 22) apps/web/src/sheets/marks.ts:231 — marks.sectionFrame 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 · StampsDialog.StampFieldsBuilder (cyclomatic 22) · ×1
  • StampsDialog.StampFieldsBuilder (cyclomatic 22) apps/web/src/components/StampsDialog.tsx:177 — StampsDialog.StampFieldsBuilder has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 15 function items inside it that branch (a function literal at line 195, add, a function literal at line 236, …). 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 · revuLibraries.importRevuFiles (cyclomatic 22) · ×1
  • revuLibraries.importRevuFiles (cyclomatic 22) apps/web/src/toolchest/revuLibraries.ts:19 — revuLibraries.importRevuFiles 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 · process.reduceFileSize (cyclomatic 22) · ×1
  • process.reduceFileSize (cyclomatic 22) apps/web/src/documents/process.ts:153 — process.reduceFileSize has cyclomatic complexity 22 (threshold 15). Of this number, 20 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 · ltv.addDss (cyclomatic 22) · ×1
  • ltv.addDss (cyclomatic 22) REDACTED:72 — ltv.addDss 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 · pki.ocspStatus (cyclomatic 22) · ×1
  • pki.ocspStatus (cyclomatic 22) apps/web/src/documents/pki.ts:626 — pki.ocspStatus 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 · layers.layersOnPages (cyclomatic 22) · ×1
  • layers.layersOnPages (cyclomatic 22) apps/web/src/documents/layers.ts:88 — layers.layersOnPages has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 3 function items inside it that branch (ocgsOf, scan, a function literal at line 114). 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 · FieldEditor.FieldEditor (cyclomatic 22) · ×1
  • FieldEditor.FieldEditor (cyclomatic 22) apps/web/src/components/FieldEditor.tsx:17 — FieldEditor.FieldEditor has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (keys, a function literal at line 21, finish, …). 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 · CompareResultsPanel.CompareResultsPanel (cyclomatic 22) · ×1
  • CompareResultsPanel.CompareResultsPanel (cyclomatic 22) apps/web/src/components/CompareResultsPanel.tsx:37 — CompareResultsPanel.CompareResultsPanel has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 106, go, a function literal at line 40, …). 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 · text.mtextHeightRuns (cyclomatic 22) · ×1
  • text.mtextHeightRuns (cyclomatic 22) apps/web/src/cad/text.ts:97 — text.mtextHeightRuns has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 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 · callout.calloutLanding (cyclomatic 22) · ×1
  • callout.calloutLanding (cyclomatic 22) packages/markup/src/callout.ts:11 — callout.calloutLanding 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 · bookmarkTemplate.place (cyclomatic 22) · ×1
  • bookmarkTemplate.place (cyclomatic 22) packages/markup/src/bookmarkTemplate.ts:66 — bookmarkTemplate.place has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (walk, find, a function literal at line 84, …). 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 · bsiLegend.keyFor (cyclomatic 22) · ×1
  • bsiLegend.keyFor (cyclomatic 22) packages/markup/src/bsiLegend.ts:29 — bsiLegend.keyFor 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 · cad.stretchMarkup (cyclomatic 22) · ×1
  • cad.stretchMarkup (cyclomatic 22) packages/markup/src/cad.ts:757 — cad.stretchMarkup 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, 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 · pdfExtras.readPdfExtras (cyclomatic 22) · ×1
  • pdfExtras.readPdfExtras (cyclomatic 22) packages/markup/src/pdfExtras.ts:17 — pdfExtras.readPdfExtras has cyclomatic complexity 22 (threshold 15). Of this number, 21 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 · worker.extractWords (cyclomatic 22) · ×1
  • worker.extractWords (cyclomatic 22) packages/pdf-core/src/worker.ts:1813 — worker.extractWords has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · links.findDetailTitle (cyclomatic 22) · ×1
  • links.findDetailTitle (cyclomatic 22) REDACTED:139 — links.findDetailTitle has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · groupBox.groupAffine (cyclomatic 21) · ×1
  • groupBox.groupAffine (cyclomatic 21) apps/web/src/markup/groupBox.ts:114 — groupBox.groupAffine 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 · script.applySet (cyclomatic 21) · ×1
  • script.applySet (cyclomatic 21) apps/web/src/scripts/script.ts:406 — script.applySet 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 · ProcessDialog.ProcessDialog (cyclomatic 21) · ×1
  • ProcessDialog.ProcessDialog (cyclomatic 21) apps/web/src/components/ProcessDialog.tsx:27 — ProcessDialog.ProcessDialog has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 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 · SessionsPanel.RecordView (cyclomatic 21) · ×1
  • SessionsPanel.RecordView (cyclomatic 21) apps/web/src/components/SessionsPanel.tsx:639 — SessionsPanel.RecordView has cyclomatic complexity 21 (threshold 15). Of this number, 14 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · lineStyle.lineArt (cyclomatic 21) · ×1
  • lineStyle.lineArt (cyclomatic 21) packages/markup/src/lineStyle.ts:201 — lineStyle.lineArt has cyclomatic complexity 21 (threshold 15). 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, 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 · bsiLegend.bsiLegendValue (cyclomatic 21) · ×1
  • bsiLegend.bsiLegendValue (cyclomatic 21) packages/markup/src/bsiLegend.ts:86 — bsiLegend.bsiLegendValue has cyclomatic complexity 21 (threshold 15). Of this number, 19 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 · MarkupStore.importAnnotations (cyclomatic 21) · ×1
  • MarkupStore.importAnnotations (cyclomatic 21) packages/markup/src/store.ts:789 — MarkupStore.importAnnotations has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 791, 802). 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 · MarkupStore.update (cyclomatic 21) · ×1
  • MarkupStore.update (cyclomatic 21) packages/markup/src/store.ts:1213 — MarkupStore.update has cyclomatic complexity 21 (threshold 15). 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: 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 · geo.projectionOfEpsg (cyclomatic 21) · ×1
  • geo.projectionOfEpsg (cyclomatic 21) packages/markup/src/geo.ts:17 — geo.projectionOfEpsg 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 · lineStyleEdit.draftProblem (cyclomatic 21) · ×1
  • lineStyleEdit.draftProblem (cyclomatic 21) packages/markup/src/lineStyleEdit.ts:121 — lineStyleEdit.draftProblem has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 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 · fill.outerBoundary (cyclomatic 21) · ×1
  • fill.outerBoundary (cyclomatic 21) packages/measure/src/fill.ts:105 — fill.outerBoundary has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 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 · rasterSearch.rasterSearch (cyclomatic 21) · ×1
  • rasterSearch.rasterSearch (cyclomatic 21) packages/measure/src/rasterSearch.ts:101 — rasterSearch.rasterSearch has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 109, 137). 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 · worker.readAnnotations (cyclomatic 21) · ×1
  • worker.readAnnotations (cyclomatic 21) packages/pdf-core/src/worker.ts:1677 — worker.readAnnotations 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 · incremental.saveIncremental (cyclomatic 20) · ×1
  • incremental.saveIncremental (cyclomatic 20) apps/web/src/documents/incremental.ts:103 — incremental.saveIncremental has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 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 · MarkupTools.addNextShape (cyclomatic 20) · ×1
  • MarkupTools.addNextShape (cyclomatic 20) apps/web/src/markup/MarkupTools.ts:1333 — MarkupTools.addNextShape has cyclomatic complexity 20 (threshold 15). 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, 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 · MarkupTools.rest (cyclomatic 20) · ×1
  • MarkupTools.rest (cyclomatic 20) apps/web/src/markup/MarkupTools.ts:4252 — MarkupTools.rest has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 belong to one function literal 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 · MarkupTools.pickTargetsAt (cyclomatic 20) · ×1
  • MarkupTools.pickTargetsAt (cyclomatic 20) apps/web/src/markup/MarkupTools.ts:4581 — MarkupTools.pickTargetsAt 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 · listColumns.matchesFilter (cyclomatic 20) · ×1
  • listColumns.matchesFilter (cyclomatic 20) apps/web/src/columns/listColumns.ts:289 — listColumns.matchesFilter 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 · LineStyleSelect.LineStyleSelect (cyclomatic 20) · ×1
  • LineStyleSelect.LineStyleSelect (cyclomatic 20) apps/web/src/components/LineStyleSelect.tsx:21 — LineStyleSelect.LineStyleSelect has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 belong to 3 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 · TemplatesDialog.TemplatesDialog (cyclomatic 20) · ×1
  • TemplatesDialog.TemplatesDialog (cyclomatic 20) apps/web/src/components/TemplatesDialog.tsx:26 — TemplatesDialog.TemplatesDialog has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 65, a function literal at line 141, what, …). 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 · CommentsTableDialog.CommentsTableDialog (cyclomatic 20) · ×1
  • CommentsTableDialog.CommentsTableDialog (cyclomatic 20) apps/web/src/components/CommentsTableDialog.tsx:23 — CommentsTableDialog.CommentsTableDialog has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 77, 34, 88, …). 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 · process.flattenAnnotations (cyclomatic 20) · ×1
  • process.flattenAnnotations (cyclomatic 20) apps/web/src/documents/process.ts:49 — process.flattenAnnotations has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · semantic.counterpart (cyclomatic 20) · ×1
  • semantic.counterpart (cyclomatic 20) apps/web/src/compare/semantic.ts:504 — semantic.counterpart 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 · ScaleRegionsPanel.ScaleRegionsPanel (cyclomatic 20) · ×1
  • ScaleRegionsPanel.ScaleRegionsPanel (cyclomatic 20) apps/web/src/components/ScaleRegionsPanel.tsx:27 — ScaleRegionsPanel.ScaleRegionsPanel has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal 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 · CalibrateDialog.CalibrateDialog (cyclomatic 20) · ×1
  • CalibrateDialog.CalibrateDialog (cyclomatic 20) apps/web/src/components/CalibrateDialog.tsx:23 — CalibrateDialog.CalibrateDialog has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 2 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 · Project.poll (cyclomatic 20) · ×1
  • Project.poll (cyclomatic 20) apps/web/src/studio/projects/Project.ts:408 — Project.poll 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 · assistantSymbols.findSymbolMatches (cyclomatic 20) · ×1
  • assistantSymbols.findSymbolMatches (cyclomatic 20) apps/web/src/desktop/assistantSymbols.ts:75 — assistantSymbols.findSymbolMatches has cyclomatic complexity 20 (threshold 15). Of this number, 19 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 · pdfTemplates.drawingSheet (cyclomatic 20) · ×1
  • pdfTemplates.drawingSheet (cyclomatic 20) apps/web/src/documents/pdfTemplates.ts:103 — pdfTemplates.drawingSheet 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 · table.tableLineAt (cyclomatic 20) · ×1
  • table.tableLineAt (cyclomatic 20) packages/markup/src/table.ts:320 — table.tableLineAt has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · columns.bluebeamColumnsFromXml (cyclomatic 20) · ×1
  • columns.bluebeamColumnsFromXml (cyclomatic 20) packages/markup/src/columns.ts:112 — columns.bluebeamColumnsFromXml has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 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 · estimating.sanitizeItems (cyclomatic 20) · ×1
  • estimating.sanitizeItems (cyclomatic 20) packages/markup/src/estimating.ts:109 — estimating.sanitizeItems has cyclomatic complexity 20 (threshold 15). Of this number, 19 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 · flowchart.routeConnector (cyclomatic 20) · ×1
  • flowchart.routeConnector (cyclomatic 20) packages/markup/src/flowchart.ts:94 — flowchart.routeConnector has cyclomatic complexity 20 (threshold 15). Of this number, 16 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 · pdfExtras.imageDataUrl (cyclomatic 20) · ×1
  • pdfExtras.imageDataUrl (cyclomatic 20) packages/markup/src/pdfExtras.ts:117 — pdfExtras.imageDataUrl 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 · report.reportPdf (cyclomatic 20) · ×1
  • report.reportPdf (cyclomatic 20) packages/markup/src/report.ts:91 — report.reportPdf has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 belong to 4 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 · scale.parseLength (cyclomatic 20) · ×1
  • scale.parseLength (cyclomatic 20) packages/measure/src/scale.ts:278 — scale.parseLength 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 · content.polylines (cyclomatic 19) · ×1
  • content.polylines (cyclomatic 19) apps/web/src/documents/renderCopy/content.ts:464 — content.polylines 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 · RenderCopyBuilder.plan (cyclomatic 19) · ×1
  • RenderCopyBuilder.plan (cyclomatic 19) apps/web/src/documents/renderCopy/renderCopy.ts:154 — RenderCopyBuilder.plan has cyclomatic complexity 19 (threshold 15). Of this number, 18 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 · xml.parseXml (cyclomatic 19) · ×1
  • xml.parseXml (cyclomatic 19) apps/web/src/geospatial/xml.ts:27 — xml.parseXml 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 · landxml.parseLandXml · ×1
  • landxml.parseLandXml::coordGeom (cyclomatic 19) apps/web/src/geospatial/landxml.ts:49 — landxml.parseLandXml::coordGeom 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. This shape REPEATS in the file: one other method here (landxml.parseLandXml) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · protocol.cleanPolicy (cyclomatic 19) · ×1
  • protocol.cleanPolicy (cyclomatic 19) apps/web/src/studio/protocol.ts:136 — protocol.cleanPolicy 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 · OneDrive.shareWithLink (cyclomatic 19) · ×1
  • OneDrive.shareWithLink (cyclomatic 19) apps/web/src/studio/drive/onedrive.ts:866 — OneDrive.shareWithLink has cyclomatic complexity 19 (threshold 15). Of this number, 18 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 · marks.backgroundLines (cyclomatic 19) · ×1
  • marks.backgroundLines (cyclomatic 19) apps/web/src/sheets/marks.ts:127 — marks.backgroundLines has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 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 · PropertiesPanel.CustomFields (cyclomatic 19) · ×1
  • PropertiesPanel.CustomFields (cyclomatic 19) apps/web/src/components/PropertiesPanel.tsx:376 — PropertiesPanel.CustomFields has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 380, 382, 403, …). 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 · SignaturesPanel.SignaturesPanel (cyclomatic 19) · ×1
  • SignaturesPanel.SignaturesPanel (cyclomatic 19) apps/web/src/components/SignaturesPanel.tsx:223 — SignaturesPanel.SignaturesPanel has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 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 289, validity, a function literal at line 236, …). 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 · script.parseScript (cyclomatic 19) · ×1
  • script.parseScript (cyclomatic 19) apps/web/src/scripts/script.ts:270 — script.parseScript has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 273). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MeasurementsPanel.Properties (cyclomatic 19) · ×1
  • MeasurementsPanel.Properties (cyclomatic 19) apps/web/src/components/MeasurementsPanel.tsx:643 — MeasurementsPanel.Properties has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 6 function items inside it that branch (commit, a function literal at line 690, a function literal at line 660, …). 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 · MeasurementsPanel.Viewports (cyclomatic 19) · ×1
  • MeasurementsPanel.Viewports (cyclomatic 19) apps/web/src/components/MeasurementsPanel.tsx:893 — MeasurementsPanel.Viewports has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 8 function items inside it that branch (removeMany, a function literal at line 924, a function literal at line 910, …). 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 · ExportDialog.FilterMenu (cyclomatic 19) · ×1
  • ExportDialog.FilterMenu (cyclomatic 19) apps/web/src/components/ExportDialog.tsx:754 — ExportDialog.FilterMenu 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, 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 · pki.readTimestamp (cyclomatic 19) · ×1
  • pki.readTimestamp (cyclomatic 19) apps/web/src/documents/pki.ts:541 — pki.readTimestamp 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 · diff.diffMasks (cyclomatic 19) · ×1
  • diff.diffMasks (cyclomatic 19) apps/web/src/compare/diff.ts:160 — diff.diffMasks has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · diff.diffWords (cyclomatic 19) · ×1
  • diff.diffWords (cyclomatic 19) apps/web/src/compare/diff.ts:386 — diff.diffWords has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 4 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 · SecurityDialog.SecurityDialog (cyclomatic 19) · ×1
  • SecurityDialog.SecurityDialog (cyclomatic 19) apps/web/src/components/SecurityDialog.tsx:23 — SecurityDialog.SecurityDialog has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 3 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 · FormsPanel.ValueEditor (cyclomatic 19) · ×1
  • FormsPanel.ValueEditor (cyclomatic 19) apps/web/src/components/FormsPanel.tsx:43 — FormsPanel.ValueEditor has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 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 · PictureColoursDialog.PictureColoursDialog (cyclomatic 19) · ×1
  • PictureColoursDialog.PictureColoursDialog (cyclomatic 19) apps/web/src/components/PictureColoursDialog.tsx:36 — PictureColoursDialog.PictureColoursDialog has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 56, 66, 79, …). 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 · lz77.lz77ac18 (cyclomatic 19) · ×1
  • lz77.lz77ac18 (cyclomatic 19) apps/web/src/cad/dwg/lz77.ts:21 — lz77.lz77ac18 has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 4 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 · render.text (cyclomatic 19) · ×1
  • render.text (cyclomatic 19) apps/web/src/cad/render.ts:601 — render.text 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 · SessionsPanel.SessionsPanel (cyclomatic 19) · ×1
  • SessionsPanel.SessionsPanel (cyclomatic 19) apps/web/src/components/SessionsPanel.tsx:78 — SessionsPanel.SessionsPanel has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 3 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 · InviteDialog.InviteDialog (cyclomatic 19) · ×1
  • InviteDialog.InviteDialog (cyclomatic 19) apps/web/src/components/sessions/InviteDialog.tsx:12 — InviteDialog.InviteDialog has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 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 · estimating.sanitizeTemplates (cyclomatic 19) · ×1
  • estimating.sanitizeTemplates (cyclomatic 19) packages/markup/src/estimating.ts:184 — estimating.sanitizeTemplates 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 · arrange.segmentsCross (cyclomatic 19) · ×1
  • arrange.segmentsCross (cyclomatic 19) packages/markup/src/arrange.ts:195 — arrange.segmentsCross has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · arrange.drawnGeometry (cyclomatic 19) · ×1
  • arrange.drawnGeometry (cyclomatic 19) packages/markup/src/arrange.ts:211 — arrange.drawnGeometry 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 · export.writeViewports (cyclomatic 19) · ×1
  • export.writeViewports (cyclomatic 19) packages/markup/src/export.ts:1878 — export.writeViewports has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 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 · revuWrite.writeBlx (cyclomatic 19) · ×1
  • revuWrite.writeBlx (cyclomatic 19) packages/markup/src/revuWrite.ts:54 — revuWrite.writeBlx has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 56, 85). 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 · visualSearch.visualSearch (cyclomatic 19) · ×1
  • visualSearch.visualSearch (cyclomatic 19) packages/measure/src/visualSearch.ts:95 — visualSearch.visualSearch has cyclomatic complexity 19 (threshold 15). Of this number, 17 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 · chainage.readChainages (cyclomatic 19) · ×1
  • chainage.readChainages (cyclomatic 19) packages/sheets/src/chainage.ts:96 — chainage.readChainages 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 · excel.writeWorkbook (cyclomatic 18) · ×1
  • excel.writeWorkbook (cyclomatic 18) apps/desktop/src/excel.ts:221 — excel.writeWorkbook 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 · SystemFonts.scan (cyclomatic 18) · ×1
  • SystemFonts.scan (cyclomatic 18) apps/desktop/src/fonts.ts:220 — SystemFonts.scan has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 3 function items inside it that branch (walk, worker, a function literal at line 261). 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 · TokenService.sign (cyclomatic 18) · ×1
  • TokenService.sign (cyclomatic 18) apps/desktop/src/token.ts:257 — TokenService.sign 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 · keys.keyName (cyclomatic 18) · ×1
  • keys.keyName (cyclomatic 18) apps/web/src/commands/keys.ts:29 — keys.keyName 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 · TileViewer.onPointerMove (cyclomatic 18) · ×1
  • TileViewer.onPointerMove (cyclomatic 18) apps/web/src/viewer/TileViewer.ts:1803 — TileViewer.onPointerMove 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 · images.rescalable (cyclomatic 18) · ×1
  • images.rescalable (cyclomatic 18) apps/web/src/documents/renderCopy/images.ts:39 — images.rescalable 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 · MarkupTools.fillAt (cyclomatic 18) · ×1
  • MarkupTools.fillAt (cyclomatic 18) apps/web/src/markup/MarkupTools.ts:2245 — MarkupTools.fillAt 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 · MarkupTools.drawLinks (cyclomatic 18) · ×1
  • MarkupTools.drawLinks (cyclomatic 18) apps/web/src/markup/MarkupTools.ts:3986 — MarkupTools.drawLinks has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 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 · QuantitiesDialog.QuantitiesDialog (cyclomatic 18) · ×1
  • QuantitiesDialog.QuantitiesDialog (cyclomatic 18) apps/web/src/components/QuantitiesDialog.tsx:26 — QuantitiesDialog.QuantitiesDialog has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 93, a function literal at line 29, a function literal at line 38, …). 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 · scaleCheck.scaleBars (cyclomatic 18) · ×1
  • scaleCheck.scaleBars (cyclomatic 18) apps/web/src/measure/scaleCheck.ts:54 — scaleCheck.scaleBars 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 · semantic.compareParagraphs.changes (cyclomatic 18) · ×1
  • semantic.compareParagraphs.changes (cyclomatic 18) apps/web/src/compare/semantic.ts:464 — semantic.compareParagraphs.changes 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 · Ribbon.SlopePicker (cyclomatic 18) · ×1
  • Ribbon.SlopePicker (cyclomatic 18) apps/web/src/components/Ribbon.tsx:532 — Ribbon.SlopePicker has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (apply, a function literal at line 568, a function literal at line 542, …). 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 · revuMigration.runRevuMigration (cyclomatic 18) · ×1
  • revuMigration.runRevuMigration (cyclomatic 18) apps/web/src/migrate/revuMigration.ts:27 — revuMigration.runRevuMigration 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 · PagesPanel.PagesPanel · ×1
  • PagesPanel.PagesPanel::keys (cyclomatic 18) apps/web/src/components/PagesPanel.tsx:462 — PagesPanel.PagesPanel::keys 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 · LinksPanel.LinksPanel (cyclomatic 18) · ×1
  • LinksPanel.LinksPanel (cyclomatic 18) apps/web/src/components/LinksPanel.tsx:33 — LinksPanel.LinksPanel has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 5 function items inside it that branch (row, a function literal at line 81, a function literal at line 37, …). 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 · StandardSettings.StandardSettings (cyclomatic 18) · ×1
  • StandardSettings.StandardSettings (cyclomatic 18) apps/web/src/components/standardsWizard/StandardSettings.tsx:84 — StandardSettings.StandardSettings has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 6 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 · wizardLinks.learnMatchLine (cyclomatic 18) · ×1
  • wizardLinks.learnMatchLine (cyclomatic 18) apps/web/src/sheets/wizardLinks.ts:123 — wizardLinks.learnMatchLine 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 · assistantScales.proposePageScale (cyclomatic 18) · ×1
  • assistantScales.proposePageScale (cyclomatic 18) apps/web/src/desktop/assistantScales.ts:109 — assistantScales.proposePageScale 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 · table.cleanFormats (cyclomatic 18) · ×1
  • table.cleanFormats (cyclomatic 18) packages/markup/src/table.ts:95 — table.cleanFormats 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 · geometry.lineEnding (cyclomatic 18) · ×1
  • geometry.lineEnding (cyclomatic 18) packages/markup/src/geometry.ts:475 — geometry.lineEnding has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. 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 · bax.baxTypeInternal (cyclomatic 18) · ×1
  • bax.baxTypeInternal (cyclomatic 18) packages/markup/src/bax.ts:50 — bax.baxTypeInternal has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 54). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MarkupStore.constructor (cyclomatic 18) · ×1
  • MarkupStore.constructor (cyclomatic 18) packages/markup/src/store.ts:204 — MarkupStore.constructor has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 233, label, a function literal at line 225). 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 · MarkupStore.refresh (cyclomatic 18) · ×1
  • MarkupStore.refresh (cyclomatic 18) packages/markup/src/store.ts:305 — MarkupStore.refresh has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · pdfExtras.removePredictor (cyclomatic 18) · ×1
  • pdfExtras.removePredictor (cyclomatic 18) packages/markup/src/pdfExtras.ts:162 — pdfExtras.removePredictor 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 · snapPoints.unrotatedSnapPoints (cyclomatic 18) · ×1
  • snapPoints.unrotatedSnapPoints (cyclomatic 18) packages/markup/src/snapPoints.ts:20 — snapPoints.unrotatedSnapPoints has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 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 · tracking.track (cyclomatic 18) · ×1
  • tracking.track (cyclomatic 18) packages/measure/src/tracking.ts:121 — tracking.track 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 · server.listenForAssistant (cyclomatic 17) · ×1
  • server.listenForAssistant (cyclomatic 17) apps/desktop/src/assistant/server.ts:12 — server.listenForAssistant has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 28, 15, 57, …). 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 · selectionFormat.followFormat (cyclomatic 17) · ×1
  • selectionFormat.followFormat (cyclomatic 17) apps/web/src/markup/selectionFormat.ts:68 — selectionFormat.followFormat 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 · OneDrive.listPermissions (cyclomatic 17) · ×1
  • OneDrive.listPermissions (cyclomatic 17) apps/web/src/studio/drive/onedrive.ts:919 — OneDrive.listPermissions has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 924). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · exportSummary.outputColumns (cyclomatic 17) · ×1
  • exportSummary.outputColumns (cyclomatic 17) apps/web/src/summary/exportSummary.ts:179 — exportSummary.outputColumns has cyclomatic complexity 17 (threshold 15). Of this number, 16 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 · exportSummary.buildSummary (cyclomatic 17) · ×1
  • exportSummary.buildSummary (cyclomatic 17) apps/web/src/summary/exportSummary.ts:337 — exportSummary.buildSummary has cyclomatic complexity 17 (threshold 15). Of this number, 16 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 · pdfSign.statusAt (cyclomatic 17) · ×1
  • pdfSign.statusAt (cyclomatic 17) apps/web/src/documents/pdfSign.ts:549 — pdfSign.statusAt has cyclomatic complexity 17 (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 · DigitalSignatures.CardPicker (cyclomatic 17) · ×1
  • DigitalSignatures.CardPicker (cyclomatic 17) REDACTED:350 — DigitalSignatures.CardPicker has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 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 · CommandPalette.CommandPalette (cyclomatic 17) · ×1
  • CommandPalette.CommandPalette (cyclomatic 17) apps/web/src/components/CommandPalette.tsx:24 — CommandPalette.CommandPalette has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 64, a function literal at line 77, a function literal at line 34, …). 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 · SpellCheckDialog.SpellCheckDialog · ×1
  • SpellCheckDialog.SpellCheckDialog::change (cyclomatic 17) apps/web/src/components/SpellCheckDialog.tsx:112 — SpellCheckDialog.SpellCheckDialog::change 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 · revuFolder.classifyRevuPath (cyclomatic 17) · ×1
  • revuFolder.classifyRevuPath (cyclomatic 17) apps/web/src/migrate/revuFolder.ts:35 — revuFolder.classifyRevuPath 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 · objects.text (cyclomatic 17) · ×1
  • objects.text (cyclomatic 17) apps/web/src/cad/dwg/objects.ts:669 — objects.text 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 · SessionDialogs.SessionSettingsDialog (cyclomatic 17) · ×1
  • SessionDialogs.SessionSettingsDialog (cyclomatic 17) apps/web/src/components/sessions/SessionDialogs.tsx:410 — SessionDialogs.SessionSettingsDialog has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · assistantStitch.deleteMatchLines (cyclomatic 17) · ×1
  • assistantStitch.deleteMatchLines (cyclomatic 17) apps/web/src/desktop/assistantStitch.ts:328 — assistantStitch.deleteMatchLines has cyclomatic complexity 17 (threshold 15). Of this number, 16 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 · assistantStandards.listSheetLinks (cyclomatic 17) · ×1
  • assistantStandards.listSheetLinks (cyclomatic 17) apps/web/src/desktop/assistantStandards.ts:78 — assistantStandards.listSheetLinks 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 · assistant.requirePoints (cyclomatic 17) · ×1
  • assistant.requirePoints (cyclomatic 17) apps/web/src/desktop/assistant.ts:458 — assistant.requirePoints 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 · flowchart.routeCost (cyclomatic 17) · ×1
  • flowchart.routeCost (cyclomatic 17) packages/markup/src/flowchart.ts:298 — flowchart.routeCost 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 · pdfValue.toPdfValue (cyclomatic 17) · ×1
  • pdfValue.toPdfValue (cyclomatic 17) packages/markup/src/pdfValue.ts:8 — pdfValue.toPdfValue 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 · MarkupStore.setDetectedLinks (cyclomatic 17) · ×1
  • MarkupStore.setDetectedLinks (cyclomatic 17) packages/markup/src/store.ts:573 — MarkupStore.setDetectedLinks has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 583, overlaps). 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 · scale.scaleParts (cyclomatic 17) · ×1
  • scale.scaleParts (cyclomatic 17) packages/measure/src/scale.ts:443 — scale.scaleParts 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 · worker.editPdf (cyclomatic 17) · ×1
  • worker.editPdf (cyclomatic 17) packages/pdf-core/src/worker.ts:285 — worker.editPdf has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · detect.findTitle (cyclomatic 17) · ×1
  • detect.findTitle (cyclomatic 17) packages/sheets/src/detect.ts:290 — detect.findTitle has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 301, 302, 296, …). 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 · manual.manualEdges (cyclomatic 17) · ×1
  • manual.manualEdges (cyclomatic 17) packages/stitch/src/manual.ts:157 — manual.manualEdges 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 · token.signOn (cyclomatic 16) · ×1
  • token.signOn (cyclomatic 16) apps/desktop/src/token.ts:383 — token.signOn 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 · main.createWindow (cyclomatic 16) · ×1
  • main.createWindow (cyclomatic 16) apps/desktop/src/main.ts:383 — main.createWindow has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 3 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 · TileViewer.drawLoupe (cyclomatic 16) · ×1
  • TileViewer.drawLoupe (cyclomatic 16) apps/web/src/viewer/TileViewer.ts:1341 — TileViewer.drawLoupe has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 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 · clip.asRect (cyclomatic 16) · ×1
  • clip.asRect (cyclomatic 16) apps/web/src/documents/renderCopy/clip.ts:37 — clip.asRect 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 · MarkupTools.drawConnectionPoints (cyclomatic 16) · ×1
  • MarkupTools.drawConnectionPoints (cyclomatic 16) apps/web/src/markup/MarkupTools.ts:2583 — MarkupTools.drawConnectionPoints 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 · MarkupTools.resolve (cyclomatic 16) · ×1
  • MarkupTools.resolve (cyclomatic 16) apps/web/src/markup/MarkupTools.ts:4188 — MarkupTools.resolve 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 · ifc.parseValue (cyclomatic 16) · ×1
  • ifc.parseValue (cyclomatic 16) apps/web/src/geospatial/ifc.ts:84 — ifc.parseValue 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 · formula.tokenize (cyclomatic 16) · ×1
  • formula.tokenize (cyclomatic 16) apps/web/src/columns/formula.ts:33 — formula.tokenize 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 · AskText.AskTextHost (cyclomatic 16) · ×1
  • AskText.AskTextHost (cyclomatic 16) apps/web/src/components/AskText.tsx:28 — AskText.AskTextHost has cyclomatic complexity 16 (threshold 15). Of this number, 10 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 · LineStylesDialog.SymbolCanvas (cyclomatic 16) · ×1
  • LineStylesDialog.SymbolCanvas (cyclomatic 16) apps/web/src/components/LineStylesDialog.tsx:145 — LineStylesDialog.SymbolCanvas has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 151, 189, 179). 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 · systemFonts.ensureMarkupFonts (cyclomatic 16) · ×1
  • systemFonts.ensureMarkupFonts (cyclomatic 16) apps/web/src/fonts/systemFonts.ts:169 — systemFonts.ensureMarkupFonts 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 · toolSets.fromRevu (cyclomatic 16) · ×1
  • toolSets.fromRevu (cyclomatic 16) apps/web/src/toolchest/toolSets.ts:9 — toolSets.fromRevu has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 17, 29). 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 · exportSummary.displayText (cyclomatic 16) · ×1
  • exportSummary.displayText (cyclomatic 16) apps/web/src/summary/exportSummary.ts:155 — exportSummary.displayText 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 · ltv.unpredict (cyclomatic 16) · ×1
  • ltv.unpredict (cyclomatic 16) REDACTED:185 — ltv.unpredict 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 · pdfSign.parseCms (cyclomatic 16) · ×1
  • pdfSign.parseCms (cyclomatic 16) apps/web/src/documents/pdfSign.ts:327 — pdfSign.parseCms has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal 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 · layers.readLayers (cyclomatic 16) · ×1
  • layers.readLayers (cyclomatic 16) apps/web/src/documents/layers.ts:23 — layers.readLayers has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, layer). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PrintDialog.PrintDialog (cyclomatic 16) · ×1
  • PrintDialog.PrintDialog (cyclomatic 16) apps/web/src/components/PrintDialog.tsx:19 — PrintDialog.PrintDialog has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · compare.comparePages (cyclomatic 16) · ×1
  • compare.comparePages (cyclomatic 16) apps/web/src/compare/compare.ts:114 — compare.comparePages has cyclomatic complexity 16 (threshold 15). Of this number, 15 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 · container.openR2004.section (cyclomatic 16) · ×1
  • container.openR2004.section (cyclomatic 16) apps/web/src/cad/dwg/container.ts:177 — container.openR2004.section 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 · geom.bspline (cyclomatic 16) · ×1
  • geom.bspline (cyclomatic 16) apps/web/src/cad/geom.ts:168 — geom.bspline has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · render.fontFor (cyclomatic 16) · ×1
  • render.fontFor (cyclomatic 16) apps/web/src/cad/render.ts:579 — render.fontFor 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 · render.insert (cyclomatic 16) · ×1
  • render.insert (cyclomatic 16) apps/web/src/cad/render.ts:835 — render.insert 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 · DeletePagesDialog.DeletePagesDialog (cyclomatic 16) · ×1
  • DeletePagesDialog.DeletePagesDialog (cyclomatic 16) apps/web/src/components/DeletePagesDialog.tsx:25 — DeletePagesDialog.DeletePagesDialog has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 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 · assistant.setPatch (cyclomatic 16) · ×1
  • assistant.setPatch (cyclomatic 16) apps/web/src/desktop/assistant.ts:331 — assistant.setPatch has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal 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 · pageImages.renderPageImages (cyclomatic 16) · ×1
  • pageImages.renderPageImages (cyclomatic 16) apps/web/src/documents/pageImages.ts:28 — pageImages.renderPageImages 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 · dialogFocus.installDialogFocus (cyclomatic 16) · ×1
  • dialogFocus.installDialogFocus (cyclomatic 16) apps/web/src/dialogFocus.ts:30 — dialogFocus.installDialogFocus has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 33, 62). 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 · columns.columnsFromXml (cyclomatic 16) · ×1
  • columns.columnsFromXml (cyclomatic 16) packages/markup/src/columns.ts:164 — columns.columnsFromXml has cyclomatic complexity 16 (threshold 15). Of this number, 14 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 · legend.legendSymbol (cyclomatic 16) · ×1
  • legend.legendSymbol (cyclomatic 16) packages/markup/src/legend.ts:109 — legend.legendSymbol 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 · MarkupStore.setMarkLinks (cyclomatic 16) · ×1
  • MarkupStore.setMarkLinks (cyclomatic 16) packages/markup/src/store.ts:604 — MarkupStore.setMarkLinks has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 613, a function literal at line 606, overlaps). 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 · store.editKind (cyclomatic 16) · ×1
  • store.editKind (cyclomatic 16) packages/markup/src/store.ts:1421 — store.editKind 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 · fdf.parseFdf (cyclomatic 16) · ×1
  • fdf.parseFdf (cyclomatic 16) packages/markup/src/fdf.ts:53 — fdf.parseFdf 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 · summary.appendSummary (cyclomatic 16) · ×1
  • summary.appendSummary (cyclomatic 16) packages/markup/src/summary.ts:75 — summary.appendSummary 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 6 function items inside it that branch (newPage, a function literal at line 120, a function literal at line 119, …). 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 · measure.labelAnchor (cyclomatic 16) · ×1
  • measure.labelAnchor (cyclomatic 16) packages/measure/src/measure.ts:718 — measure.labelAnchor 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 · worker.blankImagePixels (cyclomatic 16) · ×1
  • worker.blankImagePixels (cyclomatic 16) packages/pdf-core/src/worker.ts:1496 — worker.blankImagePixels has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 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 · confidence.stepMeter (cyclomatic 16) · ×1
  • confidence.stepMeter (cyclomatic 16) packages/sheets/src/confidence.ts:161 — confidence.stepMeter 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 · MarkupTools.pointerDown (cognitive 320) · ×1
  • MarkupTools.pointerDown (cognitive 320) apps/web/src/markup/MarkupTools.ts:2961 — MarkupTools.pointerDown has cognitive complexity 320 (threshold 15). Drivers by points: if/else 92 (177 pts), boolean chains 72, ternaries 31 (67 pts), loops 2 (4 pts) (nesting depth added 123). Of this number, 317 points are the body's own statements and 3 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 · export.exportWithAnnotations (cognitive 308) · ×1
  • export.exportWithAnnotations (cognitive 308) packages/markup/src/export.ts:2064 — export.exportWithAnnotations has cognitive complexity 308 (threshold 15). Drivers by points: if/else 57 (164 pts), ternaries 25 (71 pts), loops 20 (46 pts), boolean chains 27 (nesting depth added 179). Of this number, 242 points are the body's own statements and 66 belong to 10 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 · App.App (cognitive 288) · ×1
  • App.App (cognitive 288) apps/web/src/App.tsx:909 — App.App has cognitive complexity 288 (threshold 15). Drivers by points: ternaries 737 (1990 pts), if/else 769 (1306 pts), boolean chains 699, loops 114 (231 pts), error handling 68 (90 pts), match/switch 4 (5 pts) (nesting depth added 1930). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: 6 other methods here (App.App::useToolItem, App.App::runExport, App.App::markupMenu, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 7 times rather than 7 independent problems. Splitting this body alone leaves the other 6 exactly as they are. Where these are variations on one operation, the change that clears all 7 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 · export.appearance (cognitive 228) · ×1
  • export.appearance (cognitive 228) packages/markup/src/export.ts:399 — export.appearance has cognitive complexity 228 (threshold 15). Drivers by points: if/else 44 (95 pts), ternaries 33 (92 pts), loops 13 (30 pts), boolean chains 11 (nesting depth added 127). Of this number, 215 points are the body's own statements and 13 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 · import.fromRaw (cognitive 219) · ×1
  • import.fromRaw (cognitive 219) packages/markup/src/import.ts:635 — import.fromRaw has cognitive complexity 219 (threshold 15). Drivers by points: ternaries 46 (94 pts), if/else 36 (82 pts), boolean chains 41, loops 1, match/switch 1 (nesting depth added 94). Of this number, 198 points are the body's own statements and 21 belong to 9 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 · worker.redact (cognitive 172) · ×1
  • worker.redact (cognitive 172) packages/pdf-core/src/worker.ts:1041 — worker.redact has cognitive complexity 172 (threshold 15). Drivers by points: if/else 42 (114 pts), loops 17 (44 pts), boolean chains 10, ternaries 1 (4 pts) (nesting depth added 102). Of this number, 148 points are the body's own statements and 24 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 · import.importAnnotations (cognitive 164) · ×1
  • import.importAnnotations (cognitive 164) packages/markup/src/import.ts:136 — import.importAnnotations has cognitive complexity 164 (threshold 15). Drivers by points: if/else 75 (185 pts), ternaries 28 (62 pts), boolean chains 46, loops 11 (20 pts), error handling 1 (3 pts) (nesting depth added 155). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (import.importAnnotations::finish) 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 · MarkupTools.draw (cognitive 156) · ×1
  • MarkupTools.draw (cognitive 156) apps/web/src/markup/MarkupTools.ts:2388 — MarkupTools.draw has cognitive complexity 156 (threshold 15). Drivers by points: if/else 42 (70 pts), ternaries 17 (39 pts), boolean chains 36, loops 6 (11 pts) (nesting depth added 55). Of this number, 154 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 · MarkupTools.pointerUp (cognitive 140) · ×1
  • MarkupTools.pointerUp (cognitive 140) apps/web/src/markup/MarkupTools.ts:3568 — MarkupTools.pointerUp has cognitive complexity 140 (threshold 15). Drivers by points: if/else 57 (97 pts), boolean chains 22, ternaries 5 (11 pts), loops 3 (10 pts) (nesting depth added 53). Of this number, 115 points are the body's own statements and 25 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 · AssembliesDialog.AssembliesDialog (cognitive 125) · ×1
  • AssembliesDialog.AssembliesDialog (cognitive 125) apps/web/src/components/AssembliesDialog.tsx:153 — AssembliesDialog.AssembliesDialog has cognitive complexity 125 (threshold 15). Drivers by points: ternaries 40 (68 pts), boolean chains 45, if/else 8 (10 pts), error handling 1, loops 1 (nesting depth added 30). Of this number, 23 points are the body's own statements and 102 belong to 36 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 · PreferencesDialog.PreferencesDialog (cognitive 120) · ×1
  • PreferencesDialog.PreferencesDialog (cognitive 120) apps/web/src/components/PreferencesDialog.tsx:215 — PreferencesDialog.PreferencesDialog has cognitive complexity 120 (threshold 15). Drivers by points: ternaries 32 (36 pts), if/else 26 (35 pts), boolean chains 29, loops 7 (16 pts), error handling 4 (nesting depth added 22). Of this number, 44 points are the body's own statements and 76 belong to 29 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 · appCommands.buildCommands (cognitive 119) · ×1
  • appCommands.buildCommands (cognitive 119) apps/web/src/commands/appCommands.ts:365 — appCommands.buildCommands has cognitive complexity 119 (threshold 15). Drivers by points: boolean chains 106, ternaries 13. Of this number, 104 points are the body's own statements and 15 belong to 11 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · GeospatialPanel.GeospatialPanel (cognitive 118) · ×1
  • GeospatialPanel.GeospatialPanel (cognitive 118) apps/web/src/components/GeospatialPanel.tsx:72 — GeospatialPanel.GeospatialPanel has cognitive complexity 118 (threshold 15). Drivers by points: boolean chains 57, ternaries 31 (36 pts), if/else 22 (23 pts), error handling 1, loops 1 (nesting depth added 6). Of this number, 51 points are the body's own statements and 67 belong to 26 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 · ltv.oneValidationUpdate (cognitive 118) · ×1
  • ltv.oneValidationUpdate (cognitive 118) REDACTED:482 — ltv.oneValidationUpdate has cognitive complexity 118 (threshold 15). Drivers by points: if/else 39 (72 pts), boolean chains 25, loops 12 (16 pts), ternaries 4 (5 pts) (nesting depth added 38). Of this number, 117 points are the body's own statements and 1 belongs 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 · cadTools.cadClick (cognitive 113) · ×1
  • cadTools.cadClick (cognitive 113) apps/web/src/markup/cadTools.ts:314 — cadTools.cadClick has cognitive complexity 113 (threshold 15). Drivers by points: if/else 40 (87 pts), boolean chains 12, ternaries 5 (11 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 54). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkupTools.hover (cognitive 113) · ×1
  • MarkupTools.hover (cognitive 113) apps/web/src/markup/MarkupTools.ts:3843 — MarkupTools.hover has cognitive complexity 113 (threshold 15). Drivers by points: ternaries 20 (48 pts), if/else 32 (44 pts), boolean chains 21 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · forms.updateField (cognitive 112) · ×1
  • forms.updateField (cognitive 112) REDACTED:536 — forms.updateField has cognitive complexity 112 (threshold 15). Drivers by points: if/else 43 (77 pts), ternaries 7 (22 pts), boolean chains 10, loops 2 (3 pts) (nesting depth added 50). Of this number, 111 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 · MarkupTools.pointerMove (cognitive 109) · ×1
  • MarkupTools.pointerMove (cognitive 109) apps/web/src/markup/MarkupTools.ts:3386 — MarkupTools.pointerMove has cognitive complexity 109 (threshold 15). Drivers by points: if/else 57 (84 pts), boolean chains 13, ternaries 5 (12 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sets.setSheets (cognitive 102) · ×1
  • sets.setSheets (cognitive 102) REDACTED:250 — sets.setSheets has cognitive complexity 102 (threshold 15). Drivers by points: if/else 24 (55 pts), boolean chains 20, loops 10 (16 pts), ternaries 5 (9 pts), match/switch 2 (nesting depth added 41). Of this number, 63 points are the body's own statements and 39 belong to 8 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 · dxf.readDxf (cognitive 102) · ×1
  • dxf.readDxf (cognitive 102) apps/web/src/cad/dxf.ts:114 — dxf.readDxf has cognitive complexity 102 (threshold 15). Drivers by points: if/else 32 (62 pts), loops 12 (19 pts), ternaries 4 (11 pts), boolean chains 10 (nesting depth added 44). Of this number, 90 points are the body's own statements and 12 belong to 3 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 · objects.entityData (cognitive 102) · ×1
  • objects.entityData (cognitive 102) apps/web/src/cad/dwg/objects.ts:316 — objects.entityData has cognitive complexity 102 (threshold 15). Drivers by points: if/else 29 (57 pts), loops 11 (24 pts), ternaries 7 (14 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 49). Of this number, 100 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · toolchest.parseBtx (cognitive 102) · ×1
  • toolchest.parseBtx (cognitive 102) REDACTED:268 — toolchest.parseBtx has cognitive complexity 102 (threshold 15). Drivers by points: ternaries 25 (60 pts), boolean chains 31, if/else 5 (8 pts), loops 2 (3 pts) (nesting depth added 39). Of this number, 99 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 · render.readHatch (cognitive 101) · ×1
  • render.readHatch (cognitive 101) apps/web/src/cad/render.ts:959 — render.readHatch has cognitive complexity 101 (threshold 15). Drivers by points: loops 12 (45 pts), if/else 16 (43 pts), ternaries 3 (8 pts), boolean chains 5 (nesting depth added 65). Of this number, 94 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 · render.drawMarkup (cognitive 98) · ×1
  • render.drawMarkup (cognitive 98) packages/markup/src/render.ts:358 — render.drawMarkup has cognitive complexity 98 (threshold 15). Drivers by points: if/else 30 (56 pts), ternaries 6 (19 pts), loops 6 (13 pts), boolean chains 10 (nesting depth added 46). Of this number, 94 points are the body's own statements and 4 belong to 2 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 · main.start (cognitive 94) · ×1
  • main.start (cognitive 94) apps/desktop/src/main.ts:80 — main.start has cognitive complexity 94 (threshold 15). Drivers by points: if/else 39 (41 pts), boolean chains 29, ternaries 16 (20 pts), loops 3 (4 pts) (nesting depth added 7). Most of this is not in the body itself: 9 of the 94 points are its own statements and the rest belongs to 29 function items inside it that branch (a function literal at line 349, a function literal at line 140, a function literal at line 183, …). 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 · ColumnsDialog.ColumnsDialog (cognitive 94) · ×1
  • ColumnsDialog.ColumnsDialog (cognitive 94) apps/web/src/components/ColumnsDialog.tsx:64 — ColumnsDialog.ColumnsDialog has cognitive complexity 94 (threshold 15). Drivers by points: ternaries 24 (43 pts), boolean chains 38, if/else 9 (12 pts), error handling 1 (nesting depth added 22). Of this number, 36 points are the body's own statements and 58 belong to 24 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 · bax.exportBax (cognitive 90) · ×1
  • bax.exportBax (cognitive 90) packages/markup/src/bax.ts:232 — bax.exportBax has cognitive complexity 90 (threshold 15). Drivers by points: if/else 24 (56 pts), ternaries 8 (16 pts), loops 7 (12 pts), boolean chains 6 (nesting depth added 45). Of this number, 52 points are the body's own statements and 38 belong to 7 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 · blocks (cognitive 89) · ×1
  • blocks (cognitive 89) apps/web/public/help/help.js:83 — blocks has cognitive complexity 89 (threshold 15). Drivers by points: if/else 17 (43 pts), ternaries 6 (20 pts), loops 6 (15 pts), boolean chains 11 (nesting depth added 49). Of this number, 85 points are the body's own statements and 4 belong to 7 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 · BookmarksPanel.BookmarksPanel (cognitive 88) · ×1
  • BookmarksPanel.BookmarksPanel (cognitive 88) apps/web/src/components/BookmarksPanel.tsx:53 — BookmarksPanel.BookmarksPanel has cognitive complexity 88 (threshold 15). Drivers by points: ternaries 23 (56 pts), boolean chains 16, if/else 8 (15 pts), loops 1 (nesting depth added 40). Of this number, 17 points are the body's own statements and 71 belong to 15 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 · ExportDialog.MarkupSummaryDialog (cognitive 84) · ×1
  • ExportDialog.MarkupSummaryDialog (cognitive 84) apps/web/src/components/ExportDialog.tsx:134 — ExportDialog.MarkupSummaryDialog has cognitive complexity 84 (threshold 15). Drivers by points: boolean chains 35, ternaries 18 (23 pts), if/else 19 (22 pts), loops 3, error handling 1 (nesting depth added 8). Of this number, 24 points are the body's own statements and 60 belong to 39 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 · pdfa.archiveAsPdfA (cognitive 84) · ×1
  • pdfa.archiveAsPdfA (cognitive 84) apps/web/src/documents/pdfa.ts:19 — pdfa.archiveAsPdfA has cognitive complexity 84 (threshold 15). Drivers by points: if/else 27 (52 pts), ternaries 10 (20 pts), boolean chains 8, loops 3 (4 pts) (nesting depth added 36). Of this number, 80 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bluebeam.parseDefaultStyle (cognitive 84) · ×1
  • bluebeam.parseDefaultStyle (cognitive 84) packages/markup/src/bluebeam.ts:134 — bluebeam.parseDefaultStyle has cognitive complexity 84 (threshold 15). Drivers by points: if/else 25 (50 pts), ternaries 8 (25 pts), boolean chains 8, loops 1 (nesting depth added 42). 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 · pdfSign.checkSignatures (cognitive 83) · ×1
  • pdfSign.checkSignatures (cognitive 83) apps/web/src/documents/pdfSign.ts:394 — pdfSign.checkSignatures has cognitive complexity 83 (threshold 15). Drivers by points: if/else 23 (52 pts), boolean chains 11, loops 4 (8 pts), error handling 3 (7 pts), ternaries 2 (5 pts) (nesting depth added 40). Of this number, 75 points are the body's own statements and 8 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 · assemblies.sanitizeAssemblies (cognitive 82) · ×1
  • assemblies.sanitizeAssemblies (cognitive 82) packages/markup/src/assemblies.ts:65 — assemblies.sanitizeAssemblies has cognitive complexity 82 (threshold 15). Drivers by points: ternaries 14 (47 pts), if/else 8 (20 pts), boolean chains 10, loops 3 (5 pts) (nesting depth added 47). Of this number, 80 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MeasurementsPanel.PageScale (cognitive 81) · ×1
  • MeasurementsPanel.PageScale (cognitive 81) apps/web/src/components/MeasurementsPanel.tsx:250 — MeasurementsPanel.PageScale has cognitive complexity 81 (threshold 15). Drivers by points: boolean chains 38, ternaries 24 (26 pts), if/else 17 (nesting depth added 2). Of this number, 21 points are the body's own statements and 60 belong to 14 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 · SetsPanel.SetsPanel (cognitive 79) · ×1
  • SetsPanel.SetsPanel (cognitive 79) apps/web/src/components/SetsPanel.tsx:51 — SetsPanel.SetsPanel has cognitive complexity 79 (threshold 15). Drivers by points: ternaries 26 (31 pts), boolean chains 27, if/else 14 (20 pts), loops 1 (nesting depth added 11). Most of this is not in the body itself: 5 of the 79 points are its own statements and the rest belongs to 27 function items inside it that branch (a function literal at line 192, a function literal at line 298, a function literal at line 75, …). 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 · LayersPanel.LayersPanel (cognitive 79) · ×1
  • LayersPanel.LayersPanel (cognitive 79) apps/web/src/components/LayersPanel.tsx:161 — LayersPanel.LayersPanel has cognitive complexity 79 (threshold 15). Drivers by points: ternaries 30 (41 pts), if/else 14 (18 pts), boolean chains 14, loops 5 (6 pts) (nesting depth added 16). Most of this is not in the body itself: 6 of the 79 points are its own statements and the rest belongs to 20 function items inside it that branch (a function literal at line 680, dial, toggle, …). 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 · StandardsWizard.StandardsWizard (cognitive 77) · ×1
  • StandardsWizard.StandardsWizard (cognitive 77) apps/web/src/components/standardsWizard/StandardsWizard.tsx:80 — StandardsWizard.StandardsWizard has cognitive complexity 77 (threshold 15). Drivers by points: boolean chains 34, ternaries 24 (31 pts), if/else 12 (nesting depth added 7). Of this number, 46 points are the body's own statements and 31 belong to 15 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 · TileViewer.draw (cognitive 76) · ×1
  • TileViewer.draw (cognitive 76) apps/web/src/viewer/TileViewer.ts:1054 — TileViewer.draw has cognitive complexity 76 (threshold 15). Drivers by points: if/else 27 (51 pts), loops 6 (13 pts), boolean chains 8, ternaries 2 (4 pts) (nesting depth added 33). Of this number, 71 points are the body's own statements and 5 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 · landxml.parseLandXml (cognitive 75) · ×1
  • landxml.parseLandXml (cognitive 75) apps/web/src/geospatial/landxml.ts:13 — landxml.parseLandXml has cognitive complexity 75 (threshold 15). Drivers by points: if/else 21 (40 pts), ternaries 15 (37 pts), loops 14 (26 pts), boolean chains 9 (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function. This shape REPEATS in the file: one other method here (landxml.parseLandXml::coordGeom) 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 · render.multileader (cognitive 75) · ×1
  • render.multileader (cognitive 75) apps/web/src/cad/render.ts:659 — render.multileader has cognitive complexity 75 (threshold 15). Drivers by points: if/else 30 (39 pts), boolean chains 28, loops 3 (4 pts), ternaries 2 (4 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 · ChainageStep.ChainageStep (cognitive 75) · ×1
  • ChainageStep.ChainageStep (cognitive 75) apps/web/src/components/standardsWizard/ChainageStep.tsx:69 — ChainageStep.ChainageStep has cognitive complexity 75 (threshold 15). Drivers by points: boolean chains 32, ternaries 14 (22 pts), if/else 14 (20 pts), loops 1 (nesting depth added 14). Of this number, 31 points are the body's own statements and 44 belong to 14 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 · bax.injectBax (cognitive 75) · ×1
  • bax.injectBax (cognitive 75) packages/markup/src/bax.ts:467 — bax.injectBax has cognitive complexity 75 (threshold 15). Drivers by points: if/else 22 (44 pts), loops 8 (15 pts), ternaries 5 (11 pts), boolean chains 5 (nesting depth added 35). Of this number, 16 points are the body's own statements and 59 belong to 7 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 · BatchDialog.BatchDialog (cognitive 74) · ×1
  • BatchDialog.BatchDialog (cognitive 74) apps/web/src/components/BatchDialog.tsx:142 — BatchDialog.BatchDialog has cognitive complexity 74 (threshold 15). Drivers by points: ternaries 15 (34 pts), boolean chains 32, if/else 6 (7 pts), match/switch 1 (nesting depth added 20). Of this number, 45 points are the body's own statements and 29 belong to 8 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 · objects.hatch (cognitive 72) · ×1
  • objects.hatch (cognitive 72) apps/web/src/cad/dwg/objects.ts:861 — objects.hatch has cognitive complexity 72 (threshold 15). Drivers by points: if/else 16 (38 pts), loops 10 (33 pts), ternaries 1 (nesting depth added 45). 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 · SessionsPanel.InSession (cognitive 72) · ×1
  • SessionsPanel.InSession (cognitive 72) apps/web/src/components/SessionsPanel.tsx:352 — SessionsPanel.InSession has cognitive complexity 72 (threshold 15). Drivers by points: boolean chains 49, ternaries 12 (15 pts), if/else 3 (4 pts), loops 4 (nesting depth added 4). Of this number, 50 points are the body's own statements and 22 belong to 15 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · toolchest.parsePdfObject · ×1
  • toolchest.parsePdfObject::value (cognitive 71) REDACTED:103 — toolchest.parsePdfObject::value has cognitive complexity 71 (threshold 15). Drivers by points: if/else 25 (47 pts), loops 7 (16 pts), boolean chains 7, ternaries 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · content.readItem (cognitive 70) · ×1
  • content.readItem (cognitive 70) apps/web/src/documents/renderCopy/content.ts:592 — content.readItem has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (42 pts), ternaries 4 (12 pts), boolean chains 8, loops 3 (8 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · toolchest.lexContent (cognitive 70) · ×1
  • toolchest.lexContent (cognitive 70) REDACTED:910 — toolchest.lexContent has cognitive complexity 70 (threshold 15). Drivers by points: if/else 21 (44 pts), loops 7 (20 pts), boolean chains 6 (nesting depth added 36). Of this number, 69 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 · SnapIndex.snap (cognitive 70) · ×1
  • SnapIndex.snap (cognitive 70) packages/measure/src/snap.ts:227 — SnapIndex.snap has cognitive complexity 70 (threshold 15). Drivers by points: if/else 18 (34 pts), loops 10 (17 pts), ternaries 4 (10 pts), boolean chains 9 (nesting depth added 29). Of this number, 65 points are the body's own statements and 5 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 · MarkupTools.commitDraft (cognitive 68) · ×1
  • MarkupTools.commitDraft (cognitive 68) apps/web/src/markup/MarkupTools.ts:4370 — MarkupTools.commitDraft has cognitive complexity 68 (threshold 15). Drivers by points: if/else 42 (54 pts), boolean chains 12, ternaries 1 (2 pts) (nesting depth added 13). 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 · xml.parseXml (cognitive 68) · ×1
  • xml.parseXml (cognitive 68) packages/markup/src/xml.ts:21 — xml.parseXml has cognitive complexity 68 (threshold 15). Drivers by points: if/else 18 (40 pts), loops 7 (23 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 40). Of this number, 67 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 · geometry.baseShape (cognitive 68) · ×1
  • geometry.baseShape (cognitive 68) packages/markup/src/geometry.ts:65 — geometry.baseShape has cognitive complexity 68 (threshold 15). Drivers by points: if/else 13 (26 pts), ternaries 13 (26 pts), boolean chains 13, loops 1 (2 pts), match/switch 1 (nesting depth added 27). Of this number, 59 points are the body's own statements and 9 belong to 2 function literals inside it that branch. 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 · store.describeChange (cognitive 68) · ×1
  • store.describeChange (cognitive 68) packages/markup/src/store.ts:1340 — store.describeChange has cognitive complexity 68 (threshold 15). Drivers by points: ternaries 10 (39 pts), if/else 13 (22 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 39). Of this number, 66 points are the body's own statements and 2 belong to one function item 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 · chainage.chainageReport (cognitive 68) · ×1
  • chainage.chainageReport (cognitive 68) packages/sheets/src/chainage.ts:472 — chainage.chainageReport has cognitive complexity 68 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 17, ternaries 5 (13 pts), loops 4 (7 pts) (nesting depth added 26). None of this is in the body itself: all 68 points belong to 13 function literals inside it that branch (lines 502, 514, 485, …). 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 · marks.marksToLinks (cognitive 67) · ×1
  • marks.marksToLinks (cognitive 67) apps/web/src/sheets/marks.ts:447 — marks.marksToLinks has cognitive complexity 67 (threshold 15). Drivers by points: if/else 14 (35 pts), ternaries 8 (20 pts), boolean chains 10, loops 2 (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 · render.hatch (cognitive 67) · ×1
  • render.hatch (cognitive 67) apps/web/src/cad/render.ts:1078 — render.hatch has cognitive complexity 67 (threshold 15). Drivers by points: if/else 16 (43 pts), loops 7 (18 pts), boolean chains 6 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lineStyle.lineArt (cognitive 67) · ×1
  • lineStyle.lineArt (cognitive 67) packages/markup/src/lineStyle.ts:201 — lineStyle.lineArt has cognitive complexity 67 (threshold 15). Drivers by points: if/else 13 (54 pts), loops 4 (10 pts), boolean chains 2, ternaries 1 (nesting depth added 47). Of this number, 60 points are the body's own statements and 7 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 · CalloutStep.CalloutStep (cognitive 66) · ×1
  • CalloutStep.CalloutStep (cognitive 66) apps/web/src/components/standardsWizard/CalloutStep.tsx:80 — CalloutStep.CalloutStep has cognitive complexity 66 (threshold 15). Drivers by points: boolean chains 27, ternaries 16 (26 pts), if/else 10 (13 pts) (nesting depth added 13). Of this number, 40 points are the body's own statements and 26 belong to 10 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 · LineStylesDialog.LineStylesDialog (cognitive 65) · ×1
  • LineStylesDialog.LineStylesDialog (cognitive 65) apps/web/src/components/LineStylesDialog.tsx:422 — LineStylesDialog.LineStylesDialog has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 19 (27 pts), if/else 14 (20 pts), boolean chains 15, error handling 1 (2 pts), loops 1 (nesting depth added 15). Most of this is not in the body itself: 8 of the 65 points are its own statements and the rest belongs to 21 function items inside it that branch (a function literal at line 589, a function literal at line 506, targetSet, …). 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 · fieldDetect.detectFields (cognitive 64) · ×1
  • fieldDetect.detectFields (cognitive 64) apps/web/src/documents/fieldDetect.ts:51 — fieldDetect.detectFields has cognitive complexity 64 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 21, loops 6 (7 pts), ternaries 3 (7 pts) (nesting depth added 21). Of this number, 49 points are the body's own statements and 15 belong to 9 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 · export.annotationDict (cognitive 64) · ×1
  • export.annotationDict (cognitive 64) packages/markup/src/export.ts:865 — export.annotationDict has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 20, ternaries 14 (19 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 14). Of this number, 63 points are the body's own statements and 1 belongs 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 · content.readClipScope (cognitive 62) · ×1
  • content.readClipScope (cognitive 62) apps/web/src/documents/renderCopy/content.ts:539 — content.readClipScope has cognitive complexity 62 (threshold 15). Drivers by points: if/else 13 (42 pts), ternaries 3 (9 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 39). Of this number, 61 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 · DigitalSignatures.DigitalSignaturesSection (cognitive 62) · ×1
  • DigitalSignatures.DigitalSignaturesSection (cognitive 62) REDACTED:52 — DigitalSignatures.DigitalSignaturesSection has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 15 (48 pts), boolean chains 14 (nesting depth added 33). Most of this is not in the body itself: 4 of the 62 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 78, 135, 151). 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 · PageNav.PageNav (cognitive 62) · ×1
  • PageNav.PageNav (cognitive 62) apps/web/src/components/PageNav.tsx:68 — PageNav.PageNav has cognitive complexity 62 (threshold 15). Drivers by points: boolean chains 49, if/else 9, ternaries 3 (4 pts) (nesting depth added 1). Of this number, 41 points are the body's own statements and 21 belong to 13 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SessionsPanel.SessionList (cognitive 62) · ×1
  • SessionsPanel.SessionList (cognitive 62) apps/web/src/components/SessionsPanel.tsx:170 — SessionsPanel.SessionList has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 16 (33 pts), boolean chains 18, if/else 6 (11 pts) (nesting depth added 22). Of this number, 17 points are the body's own statements and 45 belong to 9 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 · script.tokenize (cognitive 61) · ×1
  • script.tokenize (cognitive 61) apps/web/src/scripts/script.ts:97 — script.tokenize has cognitive complexity 61 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 5 (13 pts), ternaries 4 (13 pts), boolean chains 10 (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 · toolchest.toolType (cognitive 61) · ×1
  • toolchest.toolType (cognitive 61) REDACTED:488 — toolchest.toolType has cognitive complexity 61 (threshold 15). Drivers by points: if/else 31, boolean chains 22, ternaries 4 (8 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 · MatchLineStep.MatchLineStep (cognitive 60) · ×1
  • MatchLineStep.MatchLineStep (cognitive 60) apps/web/src/components/standardsWizard/MatchLineStep.tsx:44 — MatchLineStep.MatchLineStep has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 17 (27 pts), boolean chains 21, if/else 9 (12 pts) (nesting depth added 13). Of this number, 35 points are the body's own statements and 25 belong to 9 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 · ToolChest.ToolChestPanel (cognitive 59) · ×1
  • ToolChest.ToolChestPanel (cognitive 59) apps/web/src/components/ToolChest.tsx:194 — ToolChest.ToolChestPanel has cognitive complexity 59 (threshold 15). Drivers by points: boolean chains 24, ternaries 14 (19 pts), if/else 15 (16 pts) (nesting depth added 6). Most of this is not in the body itself: 10 of the 59 points are its own statements and the rest belongs to 23 function items inside it that branch (a function literal at line 449, a function literal at line 226, finishNaming, …). 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 · ltv.xrefAt (cognitive 59) · ×1
  • ltv.xrefAt (cognitive 59) REDACTED:266 — ltv.xrefAt has cognitive complexity 59 (threshold 15). Drivers by points: if/else 14 (30 pts), ternaries 3 (12 pts), loops 5 (9 pts), boolean chains 8 (nesting depth added 29). Of this number, 58 points are the body's own statements and 1 belongs 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 · revuWrite.writeBtx (cognitive 59) · ×1
  • revuWrite.writeBtx (cognitive 59) packages/markup/src/revuWrite.ts:535 — revuWrite.writeBtx has cognitive complexity 59 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 6 (17 pts), boolean chains 15, loops 2 (4 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ifc.parseIfc (cognitive 58) · ×1
  • ifc.parseIfc (cognitive 58) apps/web/src/geospatial/ifc.ts:186 — ifc.parseIfc has cognitive complexity 58 (threshold 15). Drivers by points: if/else 41 (65 pts), ternaries 28 (49 pts), loops 21 (39 pts), boolean chains 17, match/switch 3 (nesting depth added 63). To reduce it, split the body into named stages: move each independent 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 (ifc.parseIfc::curve) 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 · scaleCheck.dimensionScale (cognitive 58) · ×1
  • scaleCheck.dimensionScale (cognitive 58) apps/web/src/measure/scaleCheck.ts:119 — scaleCheck.dimensionScale has cognitive complexity 58 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 9 (19 pts), boolean chains 5 (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 · toolchest.toolStyle (cognitive 58) · ×1
  • toolchest.toolStyle (cognitive 58) REDACTED:577 — toolchest.toolStyle has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 16, ternaries 7 (13 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 · pdfSign.addValidationData (cognitive 57) · ×1
  • pdfSign.addValidationData (cognitive 57) apps/web/src/documents/pdfSign.ts:637 — pdfSign.addValidationData has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 7 (20 pts), if/else 10 (15 pts), boolean chains 14, error handling 2 (5 pts), loops 3 (nesting depth added 21). Of this number, 37 points are the body's own statements and 20 belong to 4 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 · assistantStitch.updateMatchLines (cognitive 57) · ×1
  • assistantStitch.updateMatchLines (cognitive 57) apps/web/src/desktop/assistantStitch.ts:260 — assistantStitch.updateMatchLines has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (38 pts), ternaries 5 (12 pts), boolean chains 5, loops 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolBar.StyleControls (cognitive 56) · ×1
  • ToolBar.StyleControls (cognitive 56) apps/web/src/components/ToolBar.tsx:327 — ToolBar.StyleControls has cognitive complexity 56 (threshold 15). Drivers by points: boolean chains 36, ternaries 12 (17 pts), if/else 3 (nesting depth added 5). Of this number, 51 points are the body's own statements and 5 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ProjectsPanel.ProjectList (cognitive 56) · ×1
  • ProjectsPanel.ProjectList (cognitive 56) apps/web/src/components/ProjectsPanel.tsx:105 — ProjectsPanel.ProjectList has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (26 pts), ternaries 14 (20 pts), boolean chains 10 (nesting depth added 17). Of this number, 16 points are the body's own statements and 40 belong to 8 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 · SlowDrawingPrompt.SlowDrawingPrompt (cognitive 55) · ×1
  • SlowDrawingPrompt.SlowDrawingPrompt (cognitive 55) apps/web/src/components/SlowDrawingPrompt.tsx:64 — SlowDrawingPrompt.SlowDrawingPrompt has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (28 pts), boolean chains 13, ternaries 5 (9 pts), loops 3, error handling 2 (nesting depth added 9). Most of this is not in the body itself: 7 of the 55 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 117, 160, 187, …). 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 · process.recolourContent (cognitive 55) · ×1
  • process.recolourContent (cognitive 55) apps/web/src/documents/process.ts:233 — process.recolourContent has cognitive complexity 55 (threshold 15). Drivers by points: if/else 30 (51 pts), boolean chains 21, ternaries 7 (17 pts), loops 3 (6 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent 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 (process.recolourContent::replaceColour) 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 · chainage.readTicks (cognitive 55) · ×1
  • chainage.readTicks (cognitive 55) packages/sheets/src/chainage.ts:163 — chainage.readTicks has cognitive complexity 55 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 8 (13 pts), boolean chains 10 (nesting depth added 24). Of this number, 47 points are the body's own statements and 8 belong to 4 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 · SetScaleDialog.SetScaleDialog (cognitive 54) · ×1
  • SetScaleDialog.SetScaleDialog (cognitive 54) apps/web/src/components/SetScaleDialog.tsx:49 — SetScaleDialog.SetScaleDialog has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 17 (22 pts), if/else 15 (17 pts), boolean chains 15 (nesting depth added 7). Of this number, 26 points are the body's own statements and 28 belong to 14 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 · convert.convertCad (cognitive 53) · ×1
  • convert.convertCad (cognitive 53) apps/web/src/cad/convert.ts:83 — convert.convertCad has cognitive complexity 53 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 11 (13 pts), ternaries 3 (10 pts), error handling 2 (5 pts), boolean chains 3 (nesting depth added 22). Of this number, 48 points are the body's own statements and 5 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 · LabelRegionsPanel.LabelRegionsPanel (cognitive 53) · ×1
  • LabelRegionsPanel.LabelRegionsPanel (cognitive 53) apps/web/src/components/LabelRegionsPanel.tsx:40 — LabelRegionsPanel.LabelRegionsPanel has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 21 (39 pts), boolean chains 11, if/else 2 (3 pts) (nesting depth added 19). Of this number, 44 points are the body's own statements and 9 belong to 4 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 · repeatedRegions.findRepeatedRegions (cognitive 53) · ×1
  • repeatedRegions.findRepeatedRegions (cognitive 53) apps/web/src/sheets/repeatedRegions.ts:65 — repeatedRegions.findRepeatedRegions has cognitive complexity 53 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 7 (14 pts), ternaries 4 (12 pts), boolean chains 4 (nesting depth added 26). Of this number, 48 points are the body's own statements and 5 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 · MarkupStore.remapPages (cognitive 53) · ×1
  • MarkupStore.remapPages (cognitive 53) packages/markup/src/store.ts:828 — MarkupStore.remapPages has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (32 pts), ternaries 5 (11 pts), loops 7 (8 pts), boolean chains 2 (nesting depth added 20). Most of this is not in the body itself: 1 of the 53 points is its own statement and the rest belongs to 5 function items inside it that branch (a function literal at line 840, a function literal at line 898, turn, …). 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 · index.assemble (cognitive 52) · ×1
  • index.assemble (cognitive 52) apps/web/src/cad/dwg/index.ts:126 — index.assemble has cognitive complexity 52 (threshold 15). Drivers by points: if/else 22 (35 pts), boolean chains 30, loops 15 (20 pts), ternaries 12 (20 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (index.assemble::toEntity) 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 · PagesPanel.PagesPanel (cognitive 52) · ×1
  • PagesPanel.PagesPanel (cognitive 52) apps/web/src/components/PagesPanel.tsx:390 — PagesPanel.PagesPanel has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 15 (20 pts), if/else 18 (19 pts), boolean chains 12, error handling 1 (nesting depth added 6). Most of this is not in the body itself: 12 of the 52 points are its own statements and the rest belongs to 16 function items inside it that branch (keys, click, a function literal at line 566, …). 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 · detect.detectSheets (cognitive 52) · ×1
  • detect.detectSheets (cognitive 52) packages/sheets/src/detect.ts:398 — detect.detectSheets has cognitive complexity 52 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 10 (15 pts), boolean chains 10, ternaries 3 (4 pts) (nesting depth added 17). Most of this is not in the body itself: 9 of the 52 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 460, pagesNear, a function literal at line 429, …). 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 · revuMigration.runRevuMigration (cognitive 51) · ×1
  • revuMigration.runRevuMigration (cognitive 51) apps/web/src/migrate/revuMigration.ts:27 — revuMigration.runRevuMigration has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 5 (21 pts), if/else 6 (12 pts), error handling 3 (9 pts), loops 4 (9 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 · revuWrite.applyStyle (cognitive 51) · ×1
  • revuWrite.applyStyle (cognitive 51) packages/markup/src/revuWrite.ts:270 — revuWrite.applyStyle has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 14, ternaries 4 (11 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 · worker.clipStrokedPath (cognitive 51) · ×1
  • worker.clipStrokedPath (cognitive 51) packages/pdf-core/src/worker.ts:1417 — worker.clipStrokedPath has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (33 pts), loops 7 (12 pts), boolean chains 6 (nesting depth added 20). Of this number, 49 points are the body's own statements and 2 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 · NewPdfDialog.NewPdfDialog (cognitive 49) · ×1
  • NewPdfDialog.NewPdfDialog (cognitive 49) apps/web/src/components/NewPdfDialog.tsx:41 — NewPdfDialog.NewPdfDialog has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 21, ternaries 15 (20 pts), if/else 8 (nesting depth added 5). Of this number, 38 points are the body's own statements and 11 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, 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 · cad.transformMarkup (cognitive 49) · ×1
  • cad.transformMarkup (cognitive 49) packages/markup/src/cad.ts:626 — cad.transformMarkup has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 11, ternaries 4 (7 pts), loops 1 (2 pts) (nesting depth added 18). Of this number, 45 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dxf.parseDxf (cognitive 48) · ×1
  • dxf.parseDxf (cognitive 48) apps/web/src/geospatial/dxf.ts:12 — dxf.parseDxf has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 5 (9 pts), ternaries 3 (8 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 23). Of this number, 46 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 · CompareDialog.CompareDialog (cognitive 48) · ×1
  • CompareDialog.CompareDialog (cognitive 48) apps/web/src/components/CompareDialog.tsx:57 — CompareDialog.CompareDialog has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 16 (22 pts), boolean chains 18, if/else 7, error handling 1 (nesting depth added 6). Of this number, 27 points are the body's own statements and 21 belong to 11 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 · indexer.readPdfAnnotations (cognitive 48) · ×1
  • indexer.readPdfAnnotations (cognitive 48) apps/web/src/sheets/indexer.ts:259 — indexer.readPdfAnnotations has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 5, loops 3 (5 pts), ternaries 2 (5 pts) (nesting depth added 22). Most of this is not in the body itself: 1 of the 48 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 264, 298, 311). 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 · toolchest.execContent (cognitive 48) · ×1
  • toolchest.execContent (cognitive 48) REDACTED:1006 — toolchest.execContent has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (37 pts), ternaries 2 (6 pts), boolean chains 4, loops 1 (nesting depth added 24). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · pki.pkiRequest (cognitive 47) · ×1
  • pki.pkiRequest (cognitive 47) apps/desktop/src/pki.ts:133 — pki.pkiRequest has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 8, loops 3 (5 pts), error handling 2 (4 pts) (nesting depth added 19). Of this number, 45 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Scanner.next (cognitive 47) · ×1
  • Scanner.next (cognitive 47) apps/web/src/documents/renderCopy/content.ts:52 — Scanner.next has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 5 (12 pts), boolean chains 5 (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 · DriveSession.readFolder (cognitive 47) · ×1
  • DriveSession.readFolder (cognitive 47) apps/web/src/studio/drive/DriveSession.ts:572 — DriveSession.readFolder has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (29 pts), boolean chains 9, loops 4 (5 pts), error handling 2 (4 pts) (nesting depth added 14). Of this number, 45 points are the body's own statements and 2 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 · FontPicker.FontPicker (cognitive 47) · ×1
  • FontPicker.FontPicker (cognitive 47) apps/web/src/components/FontPicker.tsx:22 — FontPicker.FontPicker has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 16, ternaries 5 (7 pts), error handling 1 (nesting depth added 4). Most of this is not in the body itself: 14 of the 47 points are its own statements and the rest belongs to 11 function items inside it that branch (onKey, a function literal at line 53, a function literal at line 74, …). 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 · revuLibraries.importRevuFiles (cognitive 47) · ×1
  • revuLibraries.importRevuFiles (cognitive 47) apps/web/src/toolchest/revuLibraries.ts:19 — revuLibraries.importRevuFiles has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 5 (15 pts), error handling 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 24). Of this number, 45 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pki.crlStatus (cognitive 47) · ×1
  • pki.crlStatus (cognitive 47) apps/web/src/documents/pki.ts:685 — pki.crlStatus has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 11, ternaries 4 (6 pts), loops 3 (4 pts) (nesting depth added 17). Of this number, 46 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 · revuWrite.writeBlx (cognitive 47) · ×1
  • revuWrite.writeBlx (cognitive 47) packages/markup/src/revuWrite.ts:54 — revuWrite.writeBlx has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 7 (29 pts), if/else 5 (8 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 29). None of this is in the body itself: all 47 points belong to 2 function literals inside it that branch (lines 56, 85). 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 · pki.completeChain (cognitive 46) · ×1
  • pki.completeChain (cognitive 46) apps/web/src/documents/pki.ts:331 — pki.completeChain has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (22 pts), error handling 3 (9 pts), loops 5 (9 pts), boolean chains 6 (nesting depth added 23). Of this number, 42 points are the body's own statements and 4 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 · estimating.sanitizeProductLists (cognitive 46) · ×1
  • estimating.sanitizeProductLists (cognitive 46) packages/markup/src/estimating.ts:147 — estimating.sanitizeProductLists has cognitive complexity 46 (threshold 15). Drivers by points: if/else 8 (19 pts), ternaries 5 (13 pts), loops 4 (8 pts), boolean chains 6 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProjectsPanel.ProjectView (cognitive 45) · ×1
  • ProjectsPanel.ProjectView (cognitive 45) apps/web/src/components/ProjectsPanel.tsx:325 — ProjectsPanel.ProjectView has cognitive complexity 45 (threshold 15). Drivers by points: boolean chains 24, ternaries 10 (11 pts), if/else 7 (8 pts), loops 2 (nesting depth added 2). Of this number, 28 points are the body's own statements and 17 belong to 16 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · MarkupTools.newMarkup (cognitive 44) · ×1
  • MarkupTools.newMarkup (cognitive 44) apps/web/src/markup/MarkupTools.ts:4029 — MarkupTools.newMarkup has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 22 (28 pts), boolean chains 10, if/else 6 (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 · MarkupList.MarkupList (cognitive 44) · ×1
  • MarkupList.MarkupList (cognitive 44) apps/web/src/components/MarkupList.tsx:169 — MarkupList.MarkupList has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 84 (169 pts), if/else 78 (123 pts), boolean chains 84, loops 11 (19 pts), match/switch 1 (nesting depth added 138). To reduce it, split the body into named stages: move each independent 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: 3 other methods here (MarkupList.MarkupList::selectMarkup, MarkupList.MarkupList::editor, MarkupList.MarkupList::filterInput) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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 · imagePdf.imageDpi (cognitive 44) · ×1
  • imagePdf.imageDpi (cognitive 44) apps/web/src/documents/imagePdf.ts:18 — imagePdf.imageDpi has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (29 pts), boolean chains 7, loops 2 (4 pts), ternaries 1 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · links.detectLinks (cognitive 44) · ×1
  • links.detectLinks (cognitive 44) REDACTED:331 — links.detectLinks has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (23 pts), ternaries 8 (11 pts), boolean chains 8, loops 2 (nesting depth added 12). None of this is in the body itself: all 44 points belong to 7 function literals inside it that branch (lines 340, 368, 338, …). 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 · DriveSession.join (cognitive 43) · ×1
  • DriveSession.join (cognitive 43) apps/web/src/studio/drive/DriveSession.ts:340 — DriveSession.join has cognitive complexity 43 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 10, ternaries 4 (8 pts), error handling 4 (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 · listColumns.cellsFor (cognitive 43) · ×1
  • listColumns.cellsFor (cognitive 43) apps/web/src/columns/listColumns.ts:186 — listColumns.cellsFor has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 19 (22 pts), if/else 10 (11 pts), boolean chains 6, loops 4 (nesting depth added 4). Of this number, 32 points are the body's own statements and 11 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 · StampsDialog.StampsDialog (cognitive 43) · ×1
  • StampsDialog.StampsDialog (cognitive 43) apps/web/src/components/StampsDialog.tsx:312 — StampsDialog.StampsDialog has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 14 (28 pts), if/else 5 (9 pts), boolean chains 6 (nesting depth added 18). Most of this is not in the body itself: 11 of the 43 points are its own statements and the rest belongs to 15 function items inside it that branch (insertField, a function literal at line 372, a function literal at line 404, …). 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 · ProjectsPanel.FileActions (cognitive 43) · ×1
  • ProjectsPanel.FileActions (cognitive 43) apps/web/src/components/ProjectsPanel.tsx:759 — ProjectsPanel.FileActions has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 26, ternaries 8 (9 pts), if/else 6 (7 pts), error handling 1 (nesting depth added 2). Of this number, 32 points are the body's own statements and 11 belong to 9 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · paths.registerPathIpc (cognitive 42) · ×1
  • paths.registerPathIpc (cognitive 42) apps/desktop/src/paths.ts:64 — paths.registerPathIpc has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 11, ternaries 8 (9 pts), error handling 3 (nesting depth added 3). None of this is in the body itself: all 42 points belong to 8 function literals inside it that branch (lines 65, 94, 81, …). 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 · DriveSession.update (cognitive 42) · ×1
  • DriveSession.update (cognitive 42) apps/web/src/studio/drive/DriveSession.ts:1019 — DriveSession.update has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (20 pts), ternaries 6 (12 pts), boolean chains 10 (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 · starters.starterGroups (cognitive 42) · ×1
  • starters.starterGroups (cognitive 42) apps/web/src/assemblies/starters.ts:25 — starters.starterGroups has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 42. Of this number, 40 points are the body's own statements and 2 belong to 2 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 · semantic.compareParagraphs (cognitive 42) · ×1
  • semantic.compareParagraphs (cognitive 42) apps/web/src/compare/semantic.ts:429 — semantic.compareParagraphs has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 5 (10 pts), boolean chains 8, loops 7 (nesting depth added 13). Of this number, 41 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 · detect.candidatesFor (cognitive 42) · ×1
  • detect.candidatesFor (cognitive 42) packages/sheets/src/detect.ts:171 — detect.candidatesFor has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 13, ternaries 5 (8 pts), loops 2 (nesting depth added 11). Of this number, 35 points are the body's own statements and 7 belong to 4 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 · DriveSession.readFile (cognitive 41) · ×1
  • DriveSession.readFile (cognitive 41) apps/web/src/studio/drive/DriveSession.ts:689 — DriveSession.readFile has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 2 (7 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SignaturesPanel.SignatureDialog (cognitive 41) · ×1
  • SignaturesPanel.SignatureDialog (cognitive 41) apps/web/src/components/SignaturesPanel.tsx:18 — SignaturesPanel.SignatureDialog has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 9 (11 pts), boolean chains 9, loops 2 (5 pts) (nesting depth added 9). Most of this is not in the body itself: 8 of the 41 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 33, a function literal at line 103, save, …). 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 · ItemsDialog.ItemsDialog (cognitive 41) · ×1
  • ItemsDialog.ItemsDialog (cognitive 41) apps/web/src/components/ItemsDialog.tsx:57 — ItemsDialog.ItemsDialog has cognitive complexity 41 (threshold 15). Drivers by points: boolean chains 24, ternaries 13 (15 pts), if/else 1, loops 1 (nesting depth added 2). Most of this is not in the body itself: 9 of the 41 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 152, problem, a function literal at line 262, …). 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 · ProductListsDialog.ProductListsDialog (cognitive 41) · ×1
  • ProductListsDialog.ProductListsDialog (cognitive 41) apps/web/src/components/ProductListsDialog.tsx:37 — ProductListsDialog.ProductListsDialog has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 14 (20 pts), boolean chains 17, if/else 2, error handling 1, loops 1 (nesting depth added 6). Most of this is not in the body itself: 9 of the 41 points are its own statements and the rest belongs to 19 function items inside it that branch (a function literal at line 257, a function literal at line 87, a function literal at line 51, …). 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 · DigitalSignatures.SignDialog (cognitive 41) · ×1
  • DigitalSignatures.SignDialog (cognitive 41) REDACTED:553 — DigitalSignatures.SignDialog has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 15 (27 pts), boolean chains 12, if/else 2 (nesting depth added 12). Of this number, 32 points are the body's own statements and 9 belong to 5 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 · semantic.similarPairs (cognitive 41) · ×1
  • semantic.similarPairs (cognitive 41) apps/web/src/compare/semantic.ts:351 — semantic.similarPairs has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 9 (14 pts), boolean chains 5 (nesting depth added 15). Most of this is not in the body itself: 4 of the 41 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 366, 355, 404, …). 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 · SketchBar.SketchBar (cognitive 41) · ×1
  • SketchBar.SketchBar (cognitive 41) apps/web/src/components/SketchBar.tsx:25 — SketchBar.SketchBar has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 13 (19 pts), boolean chains 14, if/else 8 (nesting depth added 6). Of this number, 22 points are the body's own statements and 19 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 · teachLinks.learnLink (cognitive 41) · ×1
  • teachLinks.learnLink (cognitive 41) apps/web/src/sheets/teachLinks.ts:127 — teachLinks.learnLink has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 12, ternaries 6 (8 pts), error handling 1 (nesting depth added 9). Of this number, 40 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 · import.toMarkups (cognitive 41) · ×1
  • import.toMarkups (cognitive 41) packages/markup/src/import.ts:540 — import.toMarkups has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 11 (27 pts), if/else 5 (10 pts), boolean chains 3, match/switch 1 (nesting depth added 21). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · toolchest.contentTemplate (cognitive 41) · ×1
  • toolchest.contentTemplate (cognitive 41) REDACTED:1084 — toolchest.contentTemplate has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 7 (16 pts), boolean chains 5, loops 1 (3 pts) (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 · MarkupTools.joinSelected (cognitive 40) · ×1
  • MarkupTools.joinSelected (cognitive 40) apps/web/src/markup/MarkupTools.ts:4779 — MarkupTools.joinSelected has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 5 (17 pts), if/else 5 (12 pts), boolean chains 6, loops 4 (5 pts) (nesting depth added 20). Of this number, 38 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 · formula.evaluate (cognitive 40) · ×1
  • formula.evaluate (cognitive 40) apps/web/src/columns/formula.ts:251 — formula.evaluate has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 8 (34 pts), match/switch 2 (3 pts), if/else 1 (2 pts), boolean chains 1 (nesting depth added 28). 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 · process.flattenAnnotations (cognitive 40) · ×1
  • process.flattenAnnotations (cognitive 40) apps/web/src/documents/process.ts:49 — process.flattenAnnotations has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 4 (11 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 22). Of this number, 38 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pdfTemplates.drawingSheet (cognitive 40) · ×1
  • pdfTemplates.drawingSheet (cognitive 40) apps/web/src/documents/pdfTemplates.ts:103 — pdfTemplates.drawingSheet has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (21 pts), ternaries 5 (12 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PropertiesPanel.PropertiesPanel (cognitive 39) · ×1
  • PropertiesPanel.PropertiesPanel (cognitive 39) apps/web/src/components/PropertiesPanel.tsx:63 — PropertiesPanel.PropertiesPanel has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 24, if/else 8 (9 pts), ternaries 6 (nesting depth added 1). Of this number, 30 points are the body's own statements and 9 belong to 11 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · process.recolourContent · ×1
  • process.recolourContent::replaceColour (cognitive 39) apps/web/src/documents/process.ts:252 — process.recolourContent::replaceColour has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 12, ternaries 3 (5 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. This shape REPEATS in the file: one other method here (process.recolourContent) 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 · PageToolsDialog.PageToolsDialog (cognitive 39) · ×1
  • PageToolsDialog.PageToolsDialog (cognitive 39) apps/web/src/components/PageToolsDialog.tsx:74 — PageToolsDialog.PageToolsDialog has cognitive complexity 39 (threshold 15). Drivers by points: if/else 22 (25 pts), boolean chains 8, ternaries 5, loops 1 (nesting depth added 3). Of this number, 29 points are the body's own statements and 10 belong to 6 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, 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 · forms.modelOf (cognitive 39) · ×1
  • forms.modelOf (cognitive 39) REDACTED:273 — forms.modelOf has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 13 (29 pts), boolean chains 6, if/else 2 (3 pts), loops 1 (nesting depth added 17). Most of this is not in the body itself: 15 of the 39 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 310, 285, 305). 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 · SheetView.SheetView (cognitive 39) · ×1
  • SheetView.SheetView (cognitive 39) apps/web/src/components/standardsWizard/SheetView.tsx:54 — SheetView.SheetView has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18, boolean chains 15, ternaries 5, error handling 1. Most of this is not in the body itself: 8 of the 39 points are its own statements and the rest belongs to 15 function items inside it that branch (down, a function literal at line 95, a function literal at line 82, …). 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 · assistant.reportDocumentChanges (cognitive 39) · ×1
  • assistant.reportDocumentChanges (cognitive 39) apps/web/src/desktop/assistant.ts:1114 — assistant.reportDocumentChanges has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 15, if/else 10 (14 pts), ternaries 8, error handling 1, loops 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 39 points are its own statements and the rest belongs to one function literal inside it that branches (line 1128). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · import.importAnnotations · ×1
  • import.importAnnotations::finish (cognitive 39) packages/markup/src/import.ts:249 — import.importAnnotations::finish has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (35 pts), boolean chains 2, ternaries 1 (2 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. This shape REPEATS in the file: one other method here (import.importAnnotations) 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 · MarkupStore.transformPages (cognitive 39) · ×1
  • MarkupStore.transformPages (cognitive 39) packages/markup/src/store.ts:977 — MarkupStore.transformPages has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (19 pts), ternaries 6 (9 pts), loops 4 (6 pts), boolean chains 5 (nesting depth added 13). Most of this is not in the body itself: 2 of the 39 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 988, pt, rect, …). 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 · MarkupTools.setTool (cognitive 38) · ×1
  • MarkupTools.setTool (cognitive 38) apps/web/src/markup/MarkupTools.ts:1018 — MarkupTools.setTool has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 9 (13 pts), boolean chains 9 (nesting depth added 8). Of this number, 34 points are the body's own statements and 4 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 · script.test (cognitive 38) · ×1
  • script.test (cognitive 38) apps/web/src/scripts/script.ts:359 — script.test has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 6 (11 pts), boolean chains 10, match/switch 1 (nesting depth added 8). Of this number, 32 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RevuMigrationDialog.RevuMigrationDialog (cognitive 38) · ×1
  • RevuMigrationDialog.RevuMigrationDialog (cognitive 38) apps/web/src/components/RevuMigrationDialog.tsx:25 — RevuMigrationDialog.RevuMigrationDialog has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 19, ternaries 7 (10 pts), if/else 7 (8 pts), loops 1 (nesting depth added 4). Of this number, 25 points are the body's own statements and 13 belong to 12 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · startTips.parseTip (cognitive 38) · ×1
  • startTips.parseTip (cognitive 38) apps/web/src/help/startTips.ts:51 — startTips.parseTip has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 4, loops 3 (4 pts), ternaries 2 (nesting depth added 13). Of this number, 25 points are the body's own statements and 13 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EraseRegionsPanel.EraseRegionsPanel (cognitive 38) · ×1
  • EraseRegionsPanel.EraseRegionsPanel (cognitive 38) apps/web/src/components/EraseRegionsPanel.tsx:42 — EraseRegionsPanel.EraseRegionsPanel has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 18 (23 pts), boolean chains 11, if/else 4 (nesting depth added 5). Of this number, 20 points are the body's own statements and 18 belong to 6 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 · revuWrite.imageObjects (cognitive 38) · ×1
  • revuWrite.imageObjects (cognitive 38) packages/markup/src/revuWrite.ts:415 — revuWrite.imageObjects has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 5 (12 pts), loops 4 (6 pts), boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · report.reportPdf (cognitive 38) · ×1
  • report.reportPdf (cognitive 38) packages/markup/src/report.ts:91 — report.reportPdf has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 6 (12 pts), ternaries 5 (9 pts) (nesting depth added 19). Of this number, 20 points are the body's own statements and 18 belong to 4 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 · content.parseStrokeForm (cognitive 37) · ×1
  • content.parseStrokeForm (cognitive 37) apps/web/src/documents/renderCopy/content.ts:266 — content.parseStrokeForm has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 5, loops 3 (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 · systemFonts.ensureMarkupFonts (cognitive 37) · ×1
  • systemFonts.ensureMarkupFonts (cognitive 37) apps/web/src/fonts/systemFonts.ts:169 — systemFonts.ensureMarkupFonts has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 3 (11 pts), loops 3 (5 pts), error handling 1 (4 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 · MeasurementsPanel.AssemblyPicker (cognitive 37) · ×1
  • MeasurementsPanel.AssemblyPicker (cognitive 37) apps/web/src/components/MeasurementsPanel.tsx:735 — MeasurementsPanel.AssemblyPicker has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 17, ternaries 9 (11 pts), if/else 9 (nesting depth added 2). Most of this is not in the body itself: 14 of the 37 points are its own statements and the rest belongs to 6 function items inside it that branch (pick, apply, a function literal at line 764, …). 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 · ltv.addDss (cognitive 37) · ×1
  • ltv.addDss (cognitive 37) REDACTED:72 — ltv.addDss has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 9 (14 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 15). Of this number, 36 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 · MenuSearch.MenuSearch (cognitive 37) · ×1
  • MenuSearch.MenuSearch (cognitive 37) apps/web/src/components/MenuSearch.tsx:36 — MenuSearch.MenuSearch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 9, ternaries 5 (8 pts) (nesting depth added 5). Most of this is not in the body itself: 7 of the 37 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 177, row, runAt, …). 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 · ComparePagePicker.ComparePagePicker (cognitive 37) · ×1
  • ComparePagePicker.ComparePagePicker (cognitive 37) apps/web/src/components/ComparePagePicker.tsx:82 — ComparePagePicker.ComparePagePicker has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 17 (22 pts), boolean chains 7, if/else 5 (7 pts), error handling 1 (nesting depth added 7). Of this number, 23 points are the body's own statements and 14 belong to 4 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 · assistantSymbols.findSymbolMatches (cognitive 37) · ×1
  • assistantSymbols.findSymbolMatches (cognitive 37) apps/web/src/desktop/assistantSymbols.ts:75 — assistantSymbols.findSymbolMatches has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 6 (17 pts), loops 4 (10 pts), if/else 6 (7 pts), boolean chains 3 (nesting depth added 18). Of this number, 36 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 · pdfExtras.readPdfExtras (cognitive 37) · ×1
  • pdfExtras.readPdfExtras (cognitive 37) packages/markup/src/pdfExtras.ts:17 — pdfExtras.readPdfExtras has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (19 pts), ternaries 6 (11 pts), loops 3 (4 pts), boolean chains 2, error handling 1 (nesting depth added 18). Of this number, 35 points are the body's own statements and 2 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 · xfdf.markupsFromXfdf (cognitive 37) · ×1
  • xfdf.markupsFromXfdf (cognitive 37) packages/markup/src/xfdf.ts:250 — xfdf.markupsFromXfdf has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 10 (11 pts), boolean chains 7, loops 4 (5 pts), error handling 1 (2 pts) (nesting depth added 8). Most of this is not in the body itself: 14 of the 37 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 260, a function literal at line 285, date, …). 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 · fill.outerBoundary (cognitive 37) · ×1
  • fill.outerBoundary (cognitive 37) packages/measure/src/fill.ts:105 — fill.outerBoundary has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 4 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 19). Of this number, 34 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 · worker.readAnnotations (cognitive 37) · ×1
  • worker.readAnnotations (cognitive 37) packages/pdf-core/src/worker.ts:1677 — worker.readAnnotations has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (11 pts), ternaries 4 (8 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chainage.assignAlignments (cognitive 37) · ×1
  • chainage.assignAlignments (cognitive 37) packages/sheets/src/chainage.ts:305 — chainage.assignAlignments has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 7 (9 pts), boolean chains 8, ternaries 3 (nesting depth added 9). Of this number, 35 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 · quantities.rollup (cognitive 36) · ×1
  • quantities.rollup (cognitive 36) apps/web/src/assemblies/quantities.ts:148 — quantities.rollup has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (18 pts), ternaries 4 (14 pts), loops 2 (3 pts), boolean chains 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 · FormsPanel.Properties (cognitive 36) · ×1
  • FormsPanel.Properties (cognitive 36) apps/web/src/components/FormsPanel.tsx:90 — FormsPanel.Properties has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 33, ternaries 3. Of this number, 29 points are the body's own statements and 7 belong to 17 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · header.readHeader (cognitive 36) · ×1
  • header.readHeader (cognitive 36) apps/web/src/cad/dwg/header.ts:15 — header.readHeader has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (18 pts), loops 11 (12 pts), boolean chains 5, ternaries 1 (nesting depth added 2). Of this number, 34 points are the body's own statements and 2 belong to one function item inside it that branches. 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 · pdf.textOps (cognitive 36) · ×1
  • pdf.textOps (cognitive 36) apps/web/src/cad/pdf.ts:236 — pdf.textOps has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (8 pts), boolean chains 7, ternaries 3 (4 pts) (nesting depth added 13). Most of this is not in the body itself: 11 of the 36 points are its own statements and the rest belongs to one function literal inside it that branches (line 257). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · wizardLinks.learnAlignmentChain (cognitive 36) · ×1
  • wizardLinks.learnAlignmentChain (cognitive 36) apps/web/src/sheets/wizardLinks.ts:221 — wizardLinks.learnAlignmentChain has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 10, ternaries 5 (8 pts), loops 1 (nesting depth added 4). Of this number, 33 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 · codebase-reach.canvas.CodebaseReach (cognitive 36) · ×1
  • codebase-reach.canvas.CodebaseReach (cognitive 36) docs/codebase-reach.canvas.tsx:261 — codebase-reach.canvas.CodebaseReach has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 11, if/else 8 (11 pts), loops 1 (nesting depth added 5). Most of this is not in the body itself: 11 of the 36 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 285, 275, 287, …). 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 · fill.dynamicFill (cognitive 36) · ×1
  • fill.dynamicFill (cognitive 36) packages/measure/src/fill.ts:28 — fill.dynamicFill has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 6 (9 pts), boolean chains 8, ternaries 1 (nesting depth added 12). Of this number, 26 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolBar.MarkupFields (cognitive 35) · ×1
  • ToolBar.MarkupFields (cognitive 35) apps/web/src/components/ToolBar.tsx:591 — ToolBar.MarkupFields has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 12, boolean chains 11, if/else 10 (11 pts), loops 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 19 belong to 10 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 · SemanticComparePanel.SemanticComparePanel (cognitive 35) · ×1
  • SemanticComparePanel.SemanticComparePanel (cognitive 35) apps/web/src/components/SemanticComparePanel.tsx:80 — SemanticComparePanel.SemanticComparePanel has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 17, ternaries 9 (12 pts), if/else 4, error handling 2 (nesting depth added 3). Of this number, 20 points are the body's own statements and 15 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · Ribbon.Ribbon (cognitive 35) · ×1
  • Ribbon.Ribbon (cognitive 35) apps/web/src/components/Ribbon.tsx:607 — Ribbon.Ribbon has cognitive complexity 35 (threshold 15). Drivers by points: boolean chains 15, if/else 10, ternaries 8, error handling 1, match/switch 1. Most of this is not in the body itself: 12 of the 35 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 1291, body, pick, …). 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 · ShortcutsDialog.ShortcutsDialog (cognitive 35) · ×1
  • ShortcutsDialog.ShortcutsDialog (cognitive 35) apps/web/src/components/ShortcutsDialog.tsx:22 — ShortcutsDialog.ShortcutsDialog has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 7 (10 pts), boolean chains 7, error handling 2 (3 pts), loops 1 (nesting depth added 7). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 9 function items inside it that branch (a function literal at line 122, a function literal at line 82, a function literal at line 58, …). 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 · r2007.lz77ac21 (cognitive 35) · ×1
  • r2007.lz77ac21 (cognitive 35) apps/web/src/cad/dwg/r2007.ts:207 — r2007.lz77ac21 has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 4 (7 pts), boolean chains 3, match/switch 1 (nesting depth added 12). Most of this is not in the body itself: 5 of the 35 points are its own statements and the rest belongs to 4 function items inside it that branch (literal, chunks, instructions, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · text.mtextHeightRuns (cognitive 35) · ×1
  • text.mtextHeightRuns (cognitive 35) apps/web/src/cad/text.ts:97 — text.mtextHeightRuns has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 4, loops 1 (nesting depth added 16). Of this number, 31 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 · sheets.layoutSheet (cognitive 35) · ×1
  • sheets.layoutSheet (cognitive 35) apps/web/src/cad/sheets.ts:261 — sheets.layoutSheet has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 11 (19 pts), if/else 4 (7 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 12). Of this number, 32 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 · geometry.hitTest (cognitive 35) · ×1
  • geometry.hitTest (cognitive 35) packages/markup/src/geometry.ts:766 — geometry.hitTest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 9, loops 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 11). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RenderCopyBuilder.plan (cognitive 34) · ×1
  • RenderCopyBuilder.plan (cognitive 34) apps/web/src/documents/renderCopy/renderCopy.ts:154 — RenderCopyBuilder.plan has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (6 pts), boolean chains 5, ternaries 1 (nesting depth added 16). Of this number, 33 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 · StampsDialog.StampFieldsBuilder (cognitive 34) · ×1
  • StampsDialog.StampFieldsBuilder (cognitive 34) apps/web/src/components/StampsDialog.tsx:177 — StampsDialog.StampFieldsBuilder has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 14 (25 pts), boolean chains 6, if/else 2 (3 pts) (nesting depth added 12). None of this is in the body itself: all 34 points belong to 15 function items inside it that branch (add, a function literal at line 195, a function literal at line 257, …). 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 · ScriptsDialog.ScriptsDialog (cognitive 34) · ×1
  • ScriptsDialog.ScriptsDialog (cognitive 34) apps/web/src/components/ScriptsDialog.tsx:50 — ScriptsDialog.ScriptsDialog has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 11 (22 pts), boolean chains 11, if/else 1 (nesting depth added 11). Of this number, 27 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 · scaleCheck.scaleBars (cognitive 34) · ×1
  • scaleCheck.scaleBars (cognitive 34) apps/web/src/measure/scaleCheck.ts:54 — scaleCheck.scaleBars has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (7 pts), ternaries 2 (6 pts), boolean chains 5 (nesting depth added 17). Of this number, 33 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 · process.recolourPages (cognitive 34) · ×1
  • process.recolourPages (cognitive 34) apps/web/src/documents/process.ts:403 — process.recolourPages has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 6 (10 pts), loops 6 (9 pts), boolean chains 5 (nesting depth added 9). Of this number, 17 points are the body's own statements and 17 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 · semantic.wordDiff (cognitive 34) · ×1
  • semantic.wordDiff (cognitive 34) apps/web/src/compare/semantic.ts:185 — semantic.wordDiff has cognitive complexity 34 (threshold 15). Drivers by points: loops 11 (20 pts), if/else 7 (9 pts), boolean chains 5 (nesting depth added 11). Of this number, 30 points are the body's own statements and 4 belong to 2 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 · catalog.parseIndex (cognitive 34) · ×1
  • catalog.parseIndex (cognitive 34) apps/web/src/library/catalog.ts:59 — catalog.parseIndex has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 7, ternaries 3 (6 pts), loops 2 (4 pts), error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · visualSearch.visualSearch (cognitive 34) · ×1
  • visualSearch.visualSearch (cognitive 34) packages/measure/src/visualSearch.ts:95 — visualSearch.visualSearch has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 4 (7 pts), boolean chains 3, ternaries 1 (nesting depth added 16). Of this number, 32 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 · content.polylines (cognitive 33) · ×1
  • content.polylines (cognitive 33) apps/web/src/documents/renderCopy/content.ts:464 — content.polylines has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 6, loops 2 (3 pts), ternaries 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 · PropertiesPanel.StyleEditor (cognitive 33) · ×1
  • PropertiesPanel.StyleEditor (cognitive 33) apps/web/src/components/PropertiesPanel.tsx:468 — PropertiesPanel.StyleEditor has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 33. Of this number, 32 points are the body's own statements and 1 belongs to 8 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · viewScales.proposeViews (cognitive 33) · ×1
  • viewScales.proposeViews (cognitive 33) apps/web/src/measure/viewScales.ts:128 — viewScales.proposeViews has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 8, loops 5 (6 pts), ternaries 3 (5 pts) (nesting depth added 9). Of this number, 17 points are the body's own statements and 16 belong to 7 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 · SoundDialog.SoundDialog (cognitive 33) · ×1
  • SoundDialog.SoundDialog (cognitive 33) apps/web/src/components/SoundDialog.tsx:21 — SoundDialog.SoundDialog has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 12 (21 pts), boolean chains 8, if/else 3, error handling 1 (nesting depth added 9). Most of this is not in the body itself: 9 of the 33 points are its own statements and the rest belongs to 6 function items inside it that branch (start, place, a function literal at line 38, …). 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 · callout.calloutLanding (cognitive 33) · ×1
  • callout.calloutLanding (cognitive 33) packages/markup/src/callout.ts:11 — callout.calloutLanding has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 10 (22 pts), if/else 5 (7 pts), boolean chains 4 (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 · listColumns.matchesFilter (cognitive 32) · ×1
  • listColumns.matchesFilter (cognitive 32) apps/web/src/columns/listColumns.ts:289 — listColumns.matchesFilter has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 5 (18 pts), if/else 8 (11 pts), boolean chains 3 (nesting depth added 16). 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 · standards.parseStandardFile (cognitive 32) · ×1
  • standards.parseStandardFile (cognitive 32) apps/web/src/sheets/standards.ts:296 — standards.parseStandardFile has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 13, if/else 12, ternaries 6, error handling 1. Of this number, 25 points are the body's own statements and 7 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 · quantities.assemblyProblems (cognitive 32) · ×1
  • quantities.assemblyProblems (cognitive 32) apps/web/src/assemblies/quantities.ts:200 — quantities.assemblyProblems has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 7, ternaries 1 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 9). Of this number, 26 points are the body's own statements and 6 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 · diff.mergeBoxes (cognitive 32) · ×1
  • diff.mergeBoxes (cognitive 32) apps/web/src/compare/diff.ts:294 — diff.mergeBoxes has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 6 (13 pts), boolean chains 1 (nesting depth added 19). Of this number, 29 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 · CameraDialog.CameraDialog (cognitive 32) · ×1
  • CameraDialog.CameraDialog (cognitive 32) apps/web/src/components/CameraDialog.tsx:37 — CameraDialog.CameraDialog has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 14 (19 pts), if/else 5 (6 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 6). Most of this is not in the body itself: 9 of the 32 points are its own statements and the rest belongs to 11 function items inside it that branch (finish, capture, a function literal at line 120, …). 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 · r2007.readAc21.section (cognitive 32) · ×1
  • r2007.readAc21.section (cognitive 32) apps/web/src/cad/dwg/r2007.ts:403 — r2007.readAc21.section has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (28 pts), loops 2 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · export.mergeAnnotation (cognitive 32) · ×1
  • export.mergeAnnotation (cognitive 32) packages/markup/src/export.ts:1533 — export.mergeAnnotation has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 8, loops 4 (7 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 · fdf.fdfFromPdf (cognitive 32) · ×1
  • fdf.fdfFromPdf (cognitive 32) packages/markup/src/fdf.ts:267 — fdf.fdfFromPdf has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 7 (9 pts), boolean chains 2, ternaries 1 (nesting depth added 9). Most of this is not in the body itself: 13 of the 32 points are its own statements and the rest belongs to 3 function items inside it that branch (visit, a function literal at line 271, nameOfAnnot). 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 · TileViewer.onPointerDown (cognitive 31) · ×1
  • TileViewer.onPointerDown (cognitive 31) apps/web/src/viewer/TileViewer.ts:1749 — TileViewer.onPointerDown has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 13 (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 · reports.detail (cognitive 31) · ×1
  • reports.detail (cognitive 31) apps/web/src/takeoff/reports.ts:246 — reports.detail has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 7 (15 pts), boolean chains 8, if/else 3 (7 pts), loops 1 (nesting depth added 12). Of this number, 30 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 · HyperlinkDialog.HyperlinkDialog (cognitive 31) · ×1
  • HyperlinkDialog.HyperlinkDialog (cognitive 31) apps/web/src/components/HyperlinkDialog.tsx:31 — HyperlinkDialog.HyperlinkDialog has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 10, if/else 8 (10 pts) (nesting depth added 4). Most of this is not in the body itself: 15 of the 31 points are its own statements and the rest belongs to 4 function items inside it that branch (action, a function literal at line 78, a function literal at line 82, …). 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 · objects.readTableObject (cognitive 31) · ×1
  • objects.readTableObject (cognitive 31) apps/web/src/cad/dwg/objects.ts:1182 — objects.readTableObject has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 14). 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 · lineStyleEdit.draftProblem (cognitive 31) · ×1
  • lineStyleEdit.draftProblem (cognitive 31) packages/markup/src/lineStyleEdit.ts:121 — lineStyleEdit.draftProblem has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (7 pts), boolean chains 2, 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 · rasterSearch.rasterSearch (cognitive 31) · ×1
  • rasterSearch.rasterSearch (cognitive 31) packages/measure/src/rasterSearch.ts:101 — rasterSearch.rasterSearch has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 7 (12 pts), boolean chains 5 (nesting depth added 12). Most of this is not in the body itself: 7 of the 31 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 109, 137). 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 · cadTools.cadPrompt (cognitive 30) · ×1
  • cadTools.cadPrompt (cognitive 30) apps/web/src/markup/cadTools.ts:517 — cadTools.cadPrompt has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 11 (27 pts), boolean chains 1, if/else 1, match/switch 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 · StitchPanel.StitchPanel (cognitive 30) · ×1
  • StitchPanel.StitchPanel (cognitive 30) apps/web/src/components/StitchPanel.tsx:44 — StitchPanel.StitchPanel has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 18, ternaries 9 (10 pts), if/else 2 (nesting depth added 1). Most of this is not in the body itself: 10 of the 30 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 128, onKey, a function literal at line 103, …). 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 · Library.Library (cognitive 30) · ×1
  • Library.Library (cognitive 30) apps/web/src/components/Library.tsx:32 — Library.Library has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 9, if/else 9 (nesting depth added 2). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 11 function items inside it that branch (finishNaming, a function literal at line 173, fileMenu, …). 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 · marks.findOnPage (cognitive 30) · ×1
  • marks.findOnPage (cognitive 30) apps/web/src/sheets/marks.ts:365 — marks.findOnPage has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, ternaries 2 (7 pts), loops 3 (4 pts) (nesting depth added 11). Of this number, 27 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pdfSign.signPdf (cognitive 30) · ×1
  • pdfSign.signPdf (cognitive 30) apps/web/src/documents/pdfSign.ts:115 — pdfSign.signPdf has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 9 (12 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). 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: 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 · OfflinePrefs.OfflinePrefs (cognitive 30) · ×1
  • OfflinePrefs.OfflinePrefs (cognitive 30) apps/web/src/components/OfflinePrefs.tsx:12 — OfflinePrefs.OfflinePrefs has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 13 (21 pts), boolean chains 9 (nesting depth added 8). Of this number, 17 points are the body's own statements and 13 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 · diff.diffWords (cognitive 30) · ×1
  • diff.diffWords (cognitive 30) apps/web/src/compare/diff.ts:386 — diff.diffWords has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4 (10 pts), boolean chains 4, ternaries 2 (nesting depth added 12). Of this number, 22 points are the body's own statements and 8 belong to 4 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 · PagesPanel.Thumbnail (cognitive 30) · ×1
  • PagesPanel.Thumbnail (cognitive 30) apps/web/src/components/PagesPanel.tsx:212 — PagesPanel.Thumbnail has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (16 pts), ternaries 7, boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 30 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 260, 243, 289, …). 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 · tiff.writeTiff (cognitive 30) · ×1
  • tiff.writeTiff (cognitive 30) apps/web/src/documents/tiff.ts:53 — tiff.writeTiff has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 7 (16 pts), if/else 5 (10 pts), loops 2 (3 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 · bsiLegend.keyFor (cognitive 30) · ×1
  • bsiLegend.keyFor (cognitive 30) packages/markup/src/bsiLegend.ts:29 — bsiLegend.keyFor has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 6 (13 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 · bsiLegend.bsiLegendValue (cognitive 30) · ×1
  • bsiLegend.bsiLegendValue (cognitive 30) packages/markup/src/bsiLegend.ts:86 — bsiLegend.bsiLegendValue has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4, loops 3 (nesting depth added 10). Of this number, 28 points are the body's own statements and 2 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 · incremental.saveIncremental (cognitive 29) · ×1
  • incremental.saveIncremental (cognitive 29) apps/web/src/documents/incremental.ts:103 — incremental.saveIncremental has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 6 (10 pts), ternaries 5 (6 pts), boolean chains 2 (nesting depth added 8). Of this number, 26 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, 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 · clip.clipLines (cognitive 29) · ×1
  • clip.clipLines (cognitive 29) apps/web/src/documents/renderCopy/clip.ts:155 — clip.clipLines has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (6 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkupTools.finish (cognitive 29) · ×1
  • MarkupTools.finish (cognitive 29) apps/web/src/markup/MarkupTools.ts:2168 — MarkupTools.finish has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (25 pts), boolean chains 3, ternaries 1 (nesting depth added 6). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · xml.parseXml (cognitive 29) · ×1
  • xml.parseXml (cognitive 29) apps/web/src/geospatial/xml.ts:27 — xml.parseXml has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 3 (6 pts), ternaries 1 (2 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 · OneDrive.shareWithLink (cognitive 29) · ×1
  • OneDrive.shareWithLink (cognitive 29) apps/web/src/studio/drive/onedrive.ts:866 — OneDrive.shareWithLink has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 7 (10 pts), loops 3 (4 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 11). Of this number, 28 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 · bpxLayout.layoutFromBpx (cognitive 29) · ×1
  • bpxLayout.layoutFromBpx (cognitive 29) apps/web/src/columns/bpxLayout.ts:52 — bpxLayout.layoutFromBpx has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 2 (8 pts), boolean chains 5, loops 1 (nesting depth added 15). Of this number, 28 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 · forms.fromXfdf (cognitive 29) · ×1
  • forms.fromXfdf (cognitive 29) REDACTED:728 — forms.fromXfdf has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sheets.primsBox (cognitive 29) · ×1
  • sheets.primsBox (cognitive 29) apps/web/src/cad/sheets.ts:406 — sheets.primsBox has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 4 (15 pts), loops 3 (7 pts), if/else 5 (6 pts), boolean chains 1 (nesting depth added 16). 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 · pack.readStyle (cognitive 29) · ×1
  • pack.readStyle (cognitive 29) apps/web/src/library/pack.ts:52 — pack.readStyle has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 10, 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 · activeContent.findActiveContent · ×1
  • activeContent.findActiveContent::visit (cognitive 29) apps/web/src/documents/activeContent.ts:30 — activeContent.findActiveContent::visit has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (7 pts), ternaries 2 (5 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stamp.resolveStamp (cognitive 29) · ×1
  • stamp.resolveStamp (cognitive 29) packages/markup/src/stamp.ts:227 — stamp.resolveStamp has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (7 pts), ternaries 3 (6 pts) (nesting depth added 14). Of this number, 28 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 · stampPdf.parseStampPdf (cognitive 29) · ×1
  • stampPdf.parseStampPdf (cognitive 29) packages/markup/src/stampPdf.ts:117 — stampPdf.parseStampPdf has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 9, ternaries 6 (8 pts) (nesting depth added 3). Most of this is not in the body itself: 11 of the 29 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 145, 123, 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 · xfdf.element (cognitive 29) · ×1
  • xfdf.element (cognitive 29) packages/markup/src/xfdf.ts:53 — xfdf.element has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 12 (25 pts), boolean chains 3, match/switch 1 (nesting depth added 13). 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 · layout.chainGroups (cognitive 29) · ×1
  • layout.chainGroups (cognitive 29) packages/stitch/src/layout.ts:51 — layout.chainGroups has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (14 pts), ternaries 2 (8 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · content.optimizeContent (cognitive 28) · ×1
  • content.optimizeContent (cognitive 28) apps/web/src/documents/renderCopy/content.ts:354 — content.optimizeContent has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (37 pts), ternaries 3 (11 pts), loops 6 (10 pts), boolean chains 5 (nesting depth added 34). To reduce it, split the body into named stages: move each independent 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: 2 other methods here (content.optimizeContent::take, content.optimizeContent::flush) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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 · MarkupTools.doubleClick (cognitive 28) · ×1
  • MarkupTools.doubleClick (cognitive 28) apps/web/src/markup/MarkupTools.ts:3768 — MarkupTools.doubleClick has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 10, ternaries 2 (3 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 · ifc.parseValue (cognitive 28) · ×1
  • ifc.parseValue (cognitive 28) apps/web/src/geospatial/ifc.ts:84 — ifc.parseValue has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 4 (11 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · landxml.parseLandXml · ×1
  • landxml.parseLandXml::coordGeom (cognitive 28) apps/web/src/geospatial/landxml.ts:49 — landxml.parseLandXml::coordGeom has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 4 (5 pts), boolean chains 4, loops 2 (4 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. This shape REPEATS in the file: one other method here (landxml.parseLandXml) 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 · marks.sectionFrame (cognitive 28) · ×1
  • marks.sectionFrame (cognitive 28) apps/web/src/sheets/marks.ts:231 — marks.sectionFrame has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · process.reduceFileSize (cognitive 28) · ×1
  • process.reduceFileSize (cognitive 28) apps/web/src/documents/process.ts:153 — process.reduceFileSize has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 9). Of this number, 27 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 · SpellCheckDialog.SpellCheckDialog · ×1
  • SpellCheckDialog.SpellCheckDialog::change (cognitive 28) apps/web/src/components/SpellCheckDialog.tsx:112 — SpellCheckDialog.SpellCheckDialog::change has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 3 (6 pts), boolean chains 3, loops 2 (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 · layers.layersOnPages (cognitive 28) · ×1
  • layers.layersOnPages (cognitive 28) apps/web/src/documents/layers.ts:88 — layers.layersOnPages has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 5 (7 pts), boolean chains 4, loops 4 (nesting depth added 7). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 3 function items inside it that branch (ocgsOf, scan, a function literal at line 114). 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 · objects.multileader (cognitive 28) · ×1
  • objects.multileader (cognitive 28) apps/web/src/cad/dwg/objects.ts:996 — objects.multileader has cognitive complexity 28 (threshold 15). Drivers by points: loops 9 (20 pts), if/else 5 (8 pts) (nesting depth added 14). 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 · SessionDialogs.StartSessionDialog (cognitive 28) · ×1
  • SessionDialogs.StartSessionDialog (cognitive 28) apps/web/src/components/sessions/SessionDialogs.tsx:95 — SessionDialogs.StartSessionDialog has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 15, ternaries 9 (11 pts), if/else 2 (nesting depth added 2). Of this number, 17 points are the body's own statements and 11 belong to 10 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · pageImages.renderPageImages (cognitive 28) · ×1
  • pageImages.renderPageImages (cognitive 28) apps/web/src/documents/pageImages.ts:28 — pageImages.renderPageImages has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 3 (5 pts), boolean chains 3, loops 2 (3 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 · export.nativeForm (cognitive 28) · ×1
  • export.nativeForm (cognitive 28) packages/markup/src/export.ts:1426 — export.nativeForm has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 9, if/else 8 (9 pts), ternaries 4 (8 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · export.writeColumns.entries (cognitive 28) · ×1
  • export.writeColumns.entries (cognitive 28) packages/markup/src/export.ts:1672 — export.writeColumns.entries has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 6, ternaries 3 (6 pts) (nesting depth added 6). Of this number, 27 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 · pdfExtras.removePredictor (cognitive 28) · ×1
  • pdfExtras.removePredictor (cognitive 28) packages/markup/src/pdfExtras.ts:162 — pdfExtras.removePredictor has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (9 pts), loops 4 (8 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 · scale.parseLength (cognitive 28) · ×1
  • scale.parseLength (cognitive 28) packages/measure/src/scale.ts:278 — scale.parseLength has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 6, ternaries 2 (3 pts), 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 · Scanner.skipInlineImage (cognitive 27) · ×1
  • Scanner.skipInlineImage (cognitive 27) apps/web/src/documents/renderCopy/content.ts:163 — Scanner.skipInlineImage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 4 (7 pts), boolean chains 6 (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 · protocol.cleanPolicy (cognitive 27) · ×1
  • protocol.cleanPolicy (cognitive 27) apps/web/src/studio/protocol.ts:136 — protocol.cleanPolicy has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 4 (8 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 10). Of this number, 25 points are the body's own statements and 2 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 · onedrive.signInWithMicrosoft (cognitive 27) · ×1
  • onedrive.signInWithMicrosoft (cognitive 27) apps/web/src/studio/drive/onedrive.ts:309 — onedrive.signInWithMicrosoft has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 3 (12 pts), error handling 3 (7 pts), if/else 6, boolean chains 2 (nesting depth added 13). Of this number, 25 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextMenu.MenuList (cognitive 27) · ×1
  • ContextMenu.MenuList (cognitive 27) apps/web/src/components/ContextMenu.tsx:44 — ContextMenu.MenuList has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 10, if/else 4 (nesting depth added 2). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 88, 55, 50, …). 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 · formula.tokenize (cognitive 27) · ×1
  • formula.tokenize (cognitive 27) apps/web/src/columns/formula.ts:33 — formula.tokenize has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · marks.backgroundLines (cognitive 27) · ×1
  • marks.backgroundLines (cognitive 27) apps/web/src/sheets/marks.ts:127 — marks.backgroundLines has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 5 (9 pts), boolean chains 3, ternaries 1 (nesting depth added 11). Of this number, 26 points are the body's own statements and 1 belongs 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 · marks.readLabel (cognitive 27) · ×1
  • marks.readLabel (cognitive 27) apps/web/src/sheets/marks.ts:312 — marks.readLabel has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 6, loops 2 (3 pts), ternaries 1 (nesting depth added 11). Of this number, 25 points are the body's own statements and 2 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 · LinkPreview.PreviewWindow (cognitive 27) · ×1
  • LinkPreview.PreviewWindow (cognitive 27) apps/web/src/components/LinkPreview.tsx:84 — LinkPreview.PreviewWindow has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11, boolean chains 9, ternaries 7. Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 12 function items inside it that branch (zoomAt, panStart, a function literal at line 158, …). 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 · TakeoffReview.Proposal (cognitive 27) · ×1
  • TakeoffReview.Proposal (cognitive 27) apps/web/src/components/TakeoffReview.tsx:112 — TakeoffReview.Proposal has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 13 (nesting depth added 3). Of this number, 23 points are the body's own statements and 4 belong to 5 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 · CadBar.CadBar (cognitive 27) · ×1
  • CadBar.CadBar (cognitive 27) apps/web/src/components/CadBar.tsx:28 — CadBar.CadBar has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (8 pts), ternaries 5 (6 pts), match/switch 1 (nesting depth added 3). Of this number, 17 points are the body's own statements and 10 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 · lz77.lz77ac18 (cognitive 27) · ×1
  • lz77.lz77ac18 (cognitive 27) apps/web/src/cad/dwg/lz77.ts:21 — lz77.lz77ac18 has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 8). Of this number, 18 points are the body's own statements and 9 belong to 4 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 · container.openR2004.section (cognitive 27) · ×1
  • container.openR2004.section (cognitive 27) apps/web/src/cad/dwg/container.ts:177 — container.openR2004.section has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 2 (4 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 · geom.bspline (cognitive 27) · ×1
  • geom.bspline (cognitive 27) apps/web/src/cad/geom.ts:168 — geom.bspline has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (12 pts), ternaries 4 (10 pts), boolean chains 3, if/else 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 · wizardLinks.learnMatchLine (cognitive 27) · ×1
  • wizardLinks.learnMatchLine (cognitive 27) apps/web/src/sheets/wizardLinks.ts:123 — wizardLinks.learnMatchLine has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 3, loops 1 (2 pts), 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 · LibraryDialog.LibraryDialog (cognitive 27) · ×1
  • LibraryDialog.LibraryDialog (cognitive 27) apps/web/src/components/LibraryDialog.tsx:21 — LibraryDialog.LibraryDialog has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 9, error handling 2, if/else 2 (nesting depth added 4). Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 108, add, addFile, …). 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 · pdfTemplates.gridPaper (cognitive 27) · ×1
  • pdfTemplates.gridPaper (cognitive 27) apps/web/src/documents/pdfTemplates.ts:182 — pdfTemplates.gridPaper has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 4 (16 pts), if/else 2 (6 pts), loops 3 (5 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 · estimating.sanitizeItems (cognitive 27) · ×1
  • estimating.sanitizeItems (cognitive 27) packages/markup/src/estimating.ts:109 — estimating.sanitizeItems has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 3 (5 pts), boolean chains 3, loops 1 (nesting depth added 11). Of this number, 25 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkupStore.importAnnotations (cognitive 27) · ×1
  • MarkupStore.importAnnotations (cognitive 27) packages/markup/src/store.ts:789 — MarkupStore.importAnnotations has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 4, boolean chains 3, ternaries 1 (3 pts) (nesting depth added 7). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 791, 802). 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 · tracking.track (cognitive 27) · ×1
  • tracking.track (cognitive 27) packages/measure/src/tracking.ts:121 — tracking.track has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker.extractWords (cognitive 27) · ×1
  • worker.extractWords (cognitive 27) packages/pdf-core/src/worker.ts:1813 — worker.extractWords has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 4, loops 1 (nesting depth added 11). Of this number, 25 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PropertiesPanel.SlopeRows (cognitive 26) · ×1
  • PropertiesPanel.SlopeRows (cognitive 26) apps/web/src/components/PropertiesPanel.tsx:718 — PropertiesPanel.SlopeRows has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 16, if/else 5 (6 pts), ternaries 4 (nesting depth added 1). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 736, num, a function literal at line 746, …). 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 · xlsx.sheetXml (cognitive 26) · ×1
  • xlsx.sheetXml (cognitive 26) apps/web/src/sheetsync/xlsx.ts:133 — xlsx.sheetXml has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 9 (22 pts), boolean chains 2, if/else 2 (nesting depth added 13). None of this is in the body itself: all 26 points belong to 2 function literals inside it that branch (lines 143, 140). 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 · script.parseScript (cognitive 26) · ×1
  • script.parseScript (cognitive 26) apps/web/src/scripts/script.ts:270 — script.parseScript has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 8). Most of this is not in the body itself: 3 of the 26 points are its own statements and the rest belongs to one function literal inside it that branches (line 273). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · process.recolourPicture (cognitive 26) · ×1
  • process.recolourPicture (cognitive 26) apps/web/src/documents/process.ts:461 — process.recolourPicture has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, ternaries 3 (5 pts), loops 2, error handling 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 · HeaderFooterDialog.HeaderFooterDialog (cognitive 26) · ×1
  • HeaderFooterDialog.HeaderFooterDialog (cognitive 26) apps/web/src/components/HeaderFooterDialog.tsx:43 — HeaderFooterDialog.HeaderFooterDialog has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, ternaries 9 (10 pts), if/else 2, error handling 1 (nesting depth added 1). Of this number, 14 points are the body's own statements and 12 belong to 9 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ProfilesDialog.ProfilesDialog (cognitive 26) · ×1
  • ProfilesDialog.ProfilesDialog (cognitive 26) apps/web/src/components/ProfilesDialog.tsx:101 — ProfilesDialog.ProfilesDialog has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 11, ternaries 6 (9 pts), if/else 4 (5 pts), error handling 1 (nesting depth added 4). Most of this is not in the body itself: 10 of the 26 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 374, 122, 128, …). 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 · SearchPanel.SearchPanel · ×1
  • SearchPanel.SearchPanel::search (cognitive 26) apps/web/src/components/SearchPanel.tsx:197 — SearchPanel.SearchPanel::search has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 1 (3 pts), boolean chains 2, error handling 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. This shape REPEATS in the file: one other method here (SearchPanel.SearchPanel) 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 · Project.poll (cognitive 26) · ×1
  • Project.poll (cognitive 26) apps/web/src/studio/projects/Project.ts:408 — Project.poll has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, loops 5, ternaries 2 (4 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 · assistant.assistantCall (cognitive 26) · ×1
  • assistant.assistantCall (cognitive 26) apps/web/src/desktop/assistant.ts:1162 — assistant.assistantCall has cognitive complexity 26 (threshold 15). Drivers by points: if/else 26. 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 · codebase-reach.canvas.FlowGraph (cognitive 26) · ×1
  • codebase-reach.canvas.FlowGraph (cognitive 26) docs/codebase-reach.canvas.tsx:144 — codebase-reach.canvas.FlowGraph has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 7, if/else 3 (5 pts), loops 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 200, 183). 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 · estimating.sanitizeTemplates (cognitive 26) · ×1
  • estimating.sanitizeTemplates (cognitive 26) packages/markup/src/estimating.ts:184 — estimating.sanitizeTemplates has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 3 (5 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · message.handleMcpMessage (cognitive 25) · ×1
  • message.handleMcpMessage (cognitive 25) apps/desktop/src/assistant/message.ts:1002 — message.handleMcpMessage has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 5, if/else 4 (5 pts), error handling 3 (4 pts), match/switch 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 · RevuSettings.scan · ×1
  • RevuSettings.scan::walk (cognitive 25) apps/desktop/src/revuSettings.ts:105 — RevuSettings.scan::walk has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, error handling 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 · cadTools.cadPreviewOf (cognitive 25) · ×1
  • cadTools.cadPreviewOf (cognitive 25) apps/web/src/markup/cadTools.ts:574 — cadTools.cadPreviewOf has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 10, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MarkupTools.ownPreview (cognitive 25) · ×1
  • MarkupTools.ownPreview (cognitive 25) apps/web/src/markup/MarkupTools.ts:4974 — MarkupTools.ownPreview has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 11, 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 · ColorMenu.ColorMenu (cognitive 25) · ×1
  • ColorMenu.ColorMenu (cognitive 25) apps/web/src/components/ColorMenu.tsx:43 — ColorMenu.ColorMenu has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 11, ternaries 8 (10 pts), if/else 4 (nesting depth added 2). Of this number, 19 points are the body's own statements and 6 belong to 8 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 · scalePresets.pagesOf (cognitive 25) · ×1
  • scalePresets.pagesOf (cognitive 25) apps/web/src/measure/scalePresets.ts:49 — scalePresets.pagesOf has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · diff.clusterCells (cognitive 25) · ×1
  • diff.clusterCells (cognitive 25) apps/web/src/compare/diff.ts:199 — diff.clusterCells has cognitive complexity 25 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 4 (10 pts), boolean chains 3 (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 · PublishDialog.PublishDialog (cognitive 25) · ×1
  • PublishDialog.PublishDialog (cognitive 25) apps/web/src/components/PublishDialog.tsx:24 — PublishDialog.PublishDialog has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 9, if/else 4 (nesting depth added 4). Of this number, 19 points are the body's own statements and 6 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 · layers.readLayers (cognitive 25) · ×1
  • layers.readLayers (cognitive 25) apps/web/src/documents/layers.ts:23 — layers.readLayers has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (8 pts), loops 3, boolean chains 2 (nesting depth added 10). Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 2 function items inside it that branch (walk, layer). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · render.renderEntity (cognitive 25) · ×1
  • render.renderEntity (cognitive 25) apps/web/src/cad/render.ts:348 — render.renderEntity has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (4 pts), ternaries 2 (4 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · CadConvertDialog.CadConvertDialog (cognitive 25) · ×1
  • CadConvertDialog.CadConvertDialog (cognitive 25) apps/web/src/components/CadConvertDialog.tsx:24 — CadConvertDialog.CadConvertDialog has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 9, if/else 2 (nesting depth added 3). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 35, 50, 57, …). 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 · pack.parseTradePack (cognitive 25) · ×1
  • pack.parseTradePack (cognitive 25) apps/web/src/library/pack.ts:123 — pack.parseTradePack has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, if/else 7, ternaries 5 (7 pts), error handling 1 (nesting depth added 2). Of this number, 19 points are the body's own statements and 6 belong to 4 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 · columns.bluebeamColumnsFromXml (cognitive 25) · ×1
  • columns.bluebeamColumnsFromXml (cognitive 25) packages/markup/src/columns.ts:112 — columns.bluebeamColumnsFromXml has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 6, loops 1 (nesting depth added 9). Of this number, 23 points are the body's own statements and 2 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 · cad.joinPaths (cognitive 25) · ×1
  • cad.joinPaths (cognitive 25) packages/markup/src/cad.ts:454 — cad.joinPaths has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · fonts.readNames (cognitive 24) · ×1
  • fonts.readNames (cognitive 24) apps/desktop/src/fonts.ts:65 — fonts.readNames has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 3 (8 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TileViewer.pump (cognitive 24) · ×1
  • TileViewer.pump (cognitive 24) apps/web/src/viewer/TileViewer.ts:1554 — TileViewer.pump has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 3, loops 1 (nesting depth added 9). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1564, 1584, 1592). 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 · content.within (cognitive 24) · ×1
  • content.within (cognitive 24) apps/web/src/documents/renderCopy/content.ts:517 — content.within has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (7 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 14). Of this number, 23 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 · MarkupTools.snapOnPage (cognitive 24) · ×1
  • MarkupTools.snapOnPage (cognitive 24) apps/web/src/markup/MarkupTools.ts:4327 — MarkupTools.snapOnPage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (7 pts), boolean chains 1, 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 · ExportDialog.FilterMenu (cognitive 24) · ×1
  • ExportDialog.FilterMenu (cognitive 24) apps/web/src/components/ExportDialog.tsx:754 — ExportDialog.FilterMenu has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (13 pts), boolean chains 8, if/else 1 (2 pts), loops 1 (nesting depth added 7). Of this number, 21 points are the body's own statements and 3 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 · pki.ocspStatus (cognitive 24) · ×1
  • pki.ocspStatus (cognitive 24) apps/web/src/documents/pki.ts:626 — pki.ocspStatus has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (6 pts), boolean chains 4, 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 · diff.diffMasks (cognitive 24) · ×1
  • diff.diffMasks (cognitive 24) apps/web/src/compare/diff.ts:160 — diff.diffMasks has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 6, loops 4 (6 pts) (nesting depth added 9). Of this number, 22 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · semantic.counterpart (cognitive 24) · ×1
  • semantic.counterpart (cognitive 24) apps/web/src/compare/semantic.ts:504 — semantic.counterpart has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, loops 2 (3 pts), ternaries 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 · FieldEditor.FieldEditor (cognitive 24) · ×1
  • FieldEditor.FieldEditor (cognitive 24) apps/web/src/components/FieldEditor.tsx:17 — FieldEditor.FieldEditor has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8, ternaries 4 (7 pts) (nesting depth added 4). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 4 function items inside it that branch (finish, keys, a function literal at line 21, …). 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 · DocumentPropertiesDialog.DocumentPropertiesDialog (cognitive 24) · ×1
  • DocumentPropertiesDialog.DocumentPropertiesDialog (cognitive 24) apps/web/src/components/DocumentPropertiesDialog.tsx:34 — DocumentPropertiesDialog.DocumentPropertiesDialog has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 18, if/else 4, ternaries 2. Of this number, 16 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · render.insert (cognitive 24) · ×1
  • render.insert (cognitive 24) apps/web/src/cad/render.ts:835 — render.insert has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7, loops 2 (5 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 · model.buildFiles (cognitive 24) · ×1
  • model.buildFiles (cognitive 24) apps/web/src/studio/projects/model.ts:201 — model.buildFiles has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (12 pts), ternaries 3 (7 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Writer.clean (cognitive 24) · ×1
  • Writer.clean (cognitive 24) apps/web/src/studio/report.ts:46 — Writer.clean has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (21 pts), boolean chains 3 (nesting depth added 15). None of this is in the body itself: all 24 points belong to one function literal inside it that branches (line 47). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · bookmarkTemplate.place (cognitive 24) · ×1
  • bookmarkTemplate.place (cognitive 24) packages/markup/src/bookmarkTemplate.ts:66 — bookmarkTemplate.place has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7, ternaries 2 (4 pts), loops 2 (nesting depth added 6). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 4 function items inside it that branch (find, walk, a function literal at line 84, …). 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 · lineStyleEdit.writeComponent (cognitive 24) · ×1
  • lineStyleEdit.writeComponent (cognitive 24) packages/markup/src/lineStyleEdit.ts:95 — lineStyleEdit.writeComponent has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 8 (20 pts), if/else 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 13). Of this number, 15 points are the body's own statements and 9 belong to one function literal inside it that branches. 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 · worker.handle (cognitive 24) · ×1
  • worker.handle (cognitive 24) packages/pdf-core/src/worker.ts:1983 — worker.handle has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (15 pts), loops 2 (4 pts), if/else 1 (3 pts), error handling 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · detect.lines (cognitive 24) · ×1
  • detect.lines (cognitive 24) packages/sheets/src/detect.ts:232 — detect.lines has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 5 (9 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · excel.sheetNames (cognitive 23) · ×1
  • excel.sheetNames (cognitive 23) apps/desktop/src/excel.ts:168 — excel.sheetNames has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 1 (3 pts), loops 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SystemFonts.scan (cognitive 23) · ×1
  • SystemFonts.scan (cognitive 23) apps/desktop/src/fonts.ts:220 — SystemFonts.scan has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 6 (7 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 7). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (worker, walk, a function literal at line 261). 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 · MarkupTools.explodeSelected (cognitive 23) · ×1
  • MarkupTools.explodeSelected (cognitive 23) apps/web/src/markup/MarkupTools.ts:4818 — MarkupTools.explodeSelected has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 4 (13 pts), if/else 3 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 12). 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 · signatures.trimCanvas (cognitive 23) · ×1
  • signatures.trimCanvas (cognitive 23) apps/web/src/signatures/signatures.ts:72 — signatures.trimCanvas has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 2 (3 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 · csv.parseCsv (cognitive 23) · ×1
  • csv.parseCsv (cognitive 23) apps/web/src/assemblies/csv.ts:4 — csv.parseCsv has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4, 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 · SheetScaleReview.SheetScaleReview (cognitive 23) · ×1
  • SheetScaleReview.SheetScaleReview (cognitive 23) apps/web/src/components/SheetScaleReview.tsx:52 — SheetScaleReview.SheetScaleReview has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (14 pts), boolean chains 8, if/else 1 (nesting depth added 5). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 107, 170, 59, …). 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 · exportSummary.buildSummary (cognitive 23) · ×1
  • exportSummary.buildSummary (cognitive 23) apps/web/src/summary/exportSummary.ts:337 — exportSummary.buildSummary has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 5). Of this number, 21 points are the body's own statements and 2 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 · printPdf.printablePdf (cognitive 23) · ×1
  • printPdf.printablePdf (cognitive 23) apps/web/src/documents/printPdf.ts:90 — printPdf.printablePdf has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (8 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 · ltv.unpredict (cognitive 23) · ×1
  • ltv.unpredict (cognitive 23) REDACTED:185 — ltv.unpredict has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 3 (9 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 · diff.dilate (cognitive 23) · ×1
  • diff.dilate (cognitive 23) apps/web/src/compare/diff.ts:50 — diff.dilate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 6 (10 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 · TableCellEditor.TableCellEditor (cognitive 23) · ×1
  • TableCellEditor.TableCellEditor (cognitive 23) apps/web/src/components/TableCellEditor.tsx:24 — TableCellEditor.TableCellEditor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 5 (8 pts), boolean chains 5, loops 1 (nesting depth added 4). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 4 function items inside it that branch (onKeyDown, onKeyDown::along, finish, …). 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 · FormsPanel.FormsPanel (cognitive 23) · ×1
  • FormsPanel.FormsPanel (cognitive 23) apps/web/src/components/FormsPanel.tsx:370 — FormsPanel.FormsPanel has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 6, ternaries 5. Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 448, a function literal at line 387, move, …). 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 · ToolPreviewCard.ToolPreviewCard (cognitive 23) · ×1
  • ToolPreviewCard.ToolPreviewCard (cognitive 23) apps/web/src/components/ToolPreviewCard.tsx:28 — ToolPreviewCard.ToolPreviewCard has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, boolean chains 8, ternaries 2. Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 82, 51, 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 · pdf.writePdf (cognitive 23) · ×1
  • pdf.writePdf (cognitive 23) apps/web/src/cad/pdf.ts:64 — pdf.writePdf has cognitive complexity 23 (threshold 15). Drivers by points: if/else 22 (41 pts), loops 8 (14 pts), ternaries 4 (12 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent 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 (pdf.writePdf::draw) 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 · pack.readTool (cognitive 23) · ×1
  • pack.readTool (cognitive 23) apps/web/src/library/pack.ts:74 — pack.readTool has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 6 (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 · assistant.requirePoints (cognitive 23) · ×1
  • assistant.requirePoints (cognitive 23) apps/web/src/desktop/assistant.ts:458 — assistant.requirePoints has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, ternaries 1 (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 · tiff.pixelData (cognitive 23) · ×1
  • tiff.pixelData (cognitive 23) apps/web/src/documents/tiff.ts:106 — tiff.pixelData has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 5 (9 pts), ternaries 2 (3 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 · lineStyle.compile (cognitive 23) · ×1
  • lineStyle.compile (cognitive 23) packages/markup/src/lineStyle.ts:76 — lineStyle.compile has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 6 (10 pts) (nesting depth added 12). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 83, 81). 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 · arrange.drawnGeometry (cognitive 23) · ×1
  • arrange.drawnGeometry (cognitive 23) packages/markup/src/arrange.ts:211 — arrange.drawnGeometry has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 7, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RawWriter.write (cognitive 23) · ×1
  • RawWriter.write (cognitive 23) packages/markup/src/bax.ts:144 — RawWriter.write has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 7). Of this number, 19 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 · render.paintHatch (cognitive 23) · ×1
  • render.paintHatch (cognitive 23) packages/markup/src/render.ts:147 — render.paintHatch has cognitive complexity 23 (threshold 15). Drivers by points: loops 2 (7 pts), boolean chains 5, if/else 4 (5 pts), ternaries 3 (4 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker.editPdf (cognitive 23) · ×1
  • worker.editPdf (cognitive 23) packages/pdf-core/src/worker.ts:285 — worker.editPdf has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (8 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 12). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GraphBroker.request (cognitive 22) · ×1
  • GraphBroker.request (cognitive 22) apps/desktop/src/graph.ts:82 — GraphBroker.request has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, ternaries 3, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · RenderCopyBuilder.build (cognitive 22) · ×1
  • RenderCopyBuilder.build (cognitive 22) apps/web/src/documents/renderCopy/renderCopy.ts:223 — RenderCopyBuilder.build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · selectionFormat.followFormat (cognitive 22) · ×1
  • selectionFormat.followFormat (cognitive 22) apps/web/src/markup/selectionFormat.ts:68 — selectionFormat.followFormat has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 4 (8 pts), boolean chains 3, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · RoomFiles.readFolder (cognitive 22) · ×1
  • RoomFiles.readFolder (cognitive 22) apps/web/src/studio/drive/rooms.ts:223 — RoomFiles.readFolder has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 7). Of this number, 21 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 · LineStyleSelect.LineStyleSelect (cognitive 22) · ×1
  • LineStyleSelect.LineStyleSelect (cognitive 22) apps/web/src/components/LineStyleSelect.tsx:21 — LineStyleSelect.LineStyleSelect has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 5 (7 pts), boolean chains 6 (nesting depth added 4). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 42, 30, 34). 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 · SignaturesPanel.SignaturesPanel (cognitive 22) · ×1
  • SignaturesPanel.SignaturesPanel (cognitive 22) apps/web/src/components/SignaturesPanel.tsx:223 — SignaturesPanel.SignaturesPanel has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 12 (16 pts), boolean chains 4, if/else 2 (nesting depth added 4). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 289, validity, a function literal at line 236, …). 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 · pdfSign.revocationKept (cognitive 22) · ×1
  • pdfSign.revocationKept (cognitive 22) apps/web/src/documents/pdfSign.ts:563 — pdfSign.revocationKept has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts), error handling 1 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · slipSheet.planSlipSheet (cognitive 22) · ×1
  • slipSheet.planSlipSheet (cognitive 22) apps/web/src/documents/slipSheet.ts:28 — slipSheet.planSlipSheet has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 7). Of this number, 14 points are the body's own statements and 8 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 · forms.setValue (cognitive 22) · ×1
  • forms.setValue (cognitive 22) REDACTED:359 — forms.setValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FormsPanel.ValueEditor (cognitive 22) · ×1
  • FormsPanel.ValueEditor (cognitive 22) apps/web/src/components/FormsPanel.tsx:43 — FormsPanel.ValueEditor has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 6 (8 pts), boolean chains 5 (nesting depth added 6). Of this number, 14 points are the body's own statements and 8 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 · index.assemble · ×1
  • index.assemble::toEntity (cognitive 22) apps/web/src/cad/dwg/index.ts:196 — index.assemble::toEntity has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition. This shape REPEATS in the file: one other method here (index.assemble) 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 · SearchPanel.SearchPanel (cognitive 22) · ×1
  • SearchPanel.SearchPanel (cognitive 22) apps/web/src/components/SearchPanel.tsx:122 — SearchPanel.SearchPanel has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 41, if/else 30 (38 pts), ternaries 20 (35 pts), error handling 1 (2 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (SearchPanel.SearchPanel::search) 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 · assistantStandards.proposeSheetLinks (cognitive 22) · ×1
  • assistantStandards.proposeSheetLinks (cognitive 22) apps/web/src/desktop/assistantStandards.ts:135 — assistantStandards.proposeSheetLinks has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 7, ternaries 4 (6 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 143). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · lineSet.component (cognitive 22) · ×1
  • lineSet.component (cognitive 22) packages/markup/src/lineSet.ts:37 — lineSet.component has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 6 (15 pts), if/else 1 (3 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 12). 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 · fdf.parseFdf (cognitive 22) · ×1
  • fdf.parseFdf (cognitive 22) packages/markup/src/fdf.ts:53 — fdf.parseFdf has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 3 (5 pts), boolean chains 2, 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 · summary.wrap (cognitive 22) · ×1
  • summary.wrap (cognitive 22) packages/markup/src/summary.ts:49 — summary.wrap has cognitive complexity 22 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (9 pts), boolean chains 2, 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 · tracking.trackingPaths (cognitive 22) · ×1
  • tracking.trackingPaths (cognitive 22) packages/measure/src/tracking.ts:79 — tracking.trackingPaths has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 4 (6 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 10). 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 · worker.blankImagePixels (cognitive 22) · ×1
  • worker.blankImagePixels (cognitive 22) packages/pdf-core/src/worker.ts:1496 — worker.blankImagePixels has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts), ternaries 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 · chainage.readChainages (cognitive 22) · ×1
  • chainage.readChainages (cognitive 22) packages/sheets/src/chainage.ts:96 — chainage.readChainages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2 (4 pts), boolean chains 3, 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 · matchLines.lineProfile (cognitive 22) · ×1
  • matchLines.lineProfile (cognitive 22) packages/stitch/src/matchLines.ts:134 — matchLines.lineProfile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · clips (cognitive 22) · ×1
  • clips (cognitive 22) apps/web/public/home/home.js:32 — clips has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (6 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 9). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 40, 44, 39). 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 · token.listOn (cognitive 21) · ×1
  • token.listOn (cognitive 21) apps/desktop/src/token.ts:334 — token.listOn has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 2 (4 pts), error handling 1 (2 pts), loops 1 (nesting depth added 11). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 358, 352). 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 · MarkupTools.addNextShape (cognitive 21) · ×1
  • MarkupTools.addNextShape (cognitive 21) apps/web/src/markup/MarkupTools.ts:1333 — MarkupTools.addNextShape has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (13 pts), boolean chains 5, if/else 2, loops 1 (nesting depth added 5). Of this number, 19 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 · MarkupTools.rest (cognitive 21) · ×1
  • MarkupTools.rest (cognitive 21) apps/web/src/markup/MarkupTools.ts:4252 — MarkupTools.rest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 8, ternaries 1 (nesting depth added 2). Of this number, 11 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OneDrive.fetch (cognitive 21) · ×1
  • OneDrive.fetch (cognitive 21) apps/web/src/studio/drive/onedrive.ts:562 — OneDrive.fetch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (5 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 · formula.parseFormula · ×1
  • formula.parseFormula::primary (cognitive 21) apps/web/src/columns/formula.ts:90 — formula.parseFormula::primary has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 1 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PropertiesPanel.slopeOfKind (cognitive 21) · ×1
  • PropertiesPanel.slopeOfKind (cognitive 21) apps/web/src/components/PropertiesPanel.tsx:697 — PropertiesPanel.slopeOfKind has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (13 pts), boolean chains 7, 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 · CommentsTableDialog.CommentsTableDialog (cognitive 21) · ×1
  • CommentsTableDialog.CommentsTableDialog (cognitive 21) apps/web/src/components/CommentsTableDialog.tsx:23 — CommentsTableDialog.CommentsTableDialog has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 7 (nesting depth added 4). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 77, 34, 88, …). 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 · script.runScript (cognitive 21) · ×1
  • script.runScript (cognitive 21) apps/web/src/scripts/script.ts:457 — script.runScript has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (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 · TextEditor.TextEditor · ×1
  • TextEditor.TextEditor::onKeyDown (cognitive 21) apps/web/src/components/TextEditor.tsx:139 — TextEditor.TextEditor::onKeyDown has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6 (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 · forms.TYPE_OF (cognitive 21) · ×1
  • forms.TYPE_OF (cognitive 21) REDACTED:208 — forms.TYPE_OF has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (21 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · pdf.writePdf · ×1
  • pdf.writePdf::draw (cognitive 21) apps/web/src/cad/pdf.ts:144 — pdf.writePdf::draw has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), ternaries 2 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (pdf.writePdf) 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 · assistantStitch.deleteMatchLines (cognitive 21) · ×1
  • assistantStitch.deleteMatchLines (cognitive 21) apps/web/src/desktop/assistantStitch.ts:328 — assistantStitch.deleteMatchLines has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (13 pts), if/else 3 (4 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 · export.writeGroups (cognitive 21) · ×1
  • export.writeGroups (cognitive 21) packages/markup/src/export.ts:1777 — export.writeGroups has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts), ternaries 2 (4 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 · offset.offsetPath (cognitive 21) · ×1
  • offset.offsetPath (cognitive 21) packages/markup/src/offset.ts:50 — offset.offsetPath has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (14 pts), if/else 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · snapPoints.unrotatedSnapPoints (cognitive 21) · ×1
  • snapPoints.unrotatedSnapPoints (cognitive 21) packages/markup/src/snapPoints.ts:20 — snapPoints.unrotatedSnapPoints has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 7 (11 pts), boolean chains 5, if/else 5 (nesting depth added 4). Of this number, 11 points are the body's own statements and 10 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 · measure.measureDetails (cognitive 21) · ×1
  • measure.measureDetails (cognitive 21) packages/measure/src/measure.ts:651 — measure.measureDetails has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (13 pts), if/else 5 (7 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 · links.findDetailTitle (cognitive 21) · ×1
  • links.findDetailTitle (cognitive 21) REDACTED:139 — links.findDetailTitle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 9, loops 1, ternaries 1 (nesting depth added 5). Of this number, 19 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 · excel.writeWorkbook (cognitive 20) · ×1
  • excel.writeWorkbook (cognitive 20) apps/desktop/src/excel.ts:221 — excel.writeWorkbook has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (7 pts), error handling 2 (3 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 · cadTools.cornerClick (cognitive 20) · ×1
  • cadTools.cornerClick (cognitive 20) apps/web/src/markup/cadTools.ts:235 — cadTools.cornerClick has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, ternaries 5 (7 pts), boolean chains 3 (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 · cadTools.cadPickTarget (cognitive 20) · ×1
  • cadTools.cadPickTarget (cognitive 20) apps/web/src/markup/cadTools.ts:489 — cadTools.cadPickTarget has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 5, if/else 2, 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 · ifc.parseIfc · ×1
  • ifc.parseIfc::curve (cognitive 20) apps/web/src/geospatial/ifc.ts:293 — ifc.parseIfc::curve has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 3 (6 pts), boolean chains 2, loops 1 (2 pts), 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. This shape REPEATS in the file: one other method here (ifc.parseIfc) 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 · DriveSession.admitSeats (cognitive 20) · ×1
  • DriveSession.admitSeats (cognitive 20) apps/web/src/studio/drive/DriveSession.ts:659 — DriveSession.admitSeats has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, ternaries 2 (4 pts), error handling 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 · PropertiesPanel.MeasurementSection (cognitive 20) · ×1
  • PropertiesPanel.MeasurementSection (cognitive 20) apps/web/src/components/PropertiesPanel.tsx:885 — PropertiesPanel.MeasurementSection has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (5 pts), ternaries 4 (nesting depth added 1). Of this number, 14 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TemplatesDialog.TemplatesDialog (cognitive 20) · ×1
  • TemplatesDialog.TemplatesDialog (cognitive 20) apps/web/src/components/TemplatesDialog.tsx:26 — TemplatesDialog.TemplatesDialog has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, ternaries 5 (6 pts), error handling 1, if/else 1 (nesting depth added 1). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 141, a function literal at line 65, what, …). 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 · scaleReview.rowFor (cognitive 20) · ×1
  • scaleReview.rowFor (cognitive 20) apps/web/src/measure/scaleReview.ts:112 — scaleReview.rowFor has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (15 pts), if/else 3 (4 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 · MeasurementsPanel.Properties (cognitive 20) · ×1
  • MeasurementsPanel.Properties (cognitive 20) apps/web/src/components/MeasurementsPanel.tsx:643 — MeasurementsPanel.Properties has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 4 (nesting depth added 1). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (commit, a function literal at line 690, a function literal at line 665, …). 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 · exportSummary.outputColumns (cognitive 20) · ×1
  • exportSummary.outputColumns (cognitive 20) apps/web/src/summary/exportSummary.ts:179 — exportSummary.outputColumns has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 7, ternaries 1 (2 pts), loops 1 (nesting depth added 6). Of this number, 19 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 · semantic.pageParagraphs (cognitive 20) · ×1
  • semantic.pageParagraphs (cognitive 20) apps/web/src/compare/semantic.ts:137 — semantic.pageParagraphs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 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 · perspective.homography (cognitive 20) · ×1
  • perspective.homography (cognitive 20) apps/web/src/documents/perspective.ts:9 — perspective.homography has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 5 (9 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 · ProcessDialog.ProcessDialog (cognitive 20) · ×1
  • ProcessDialog.ProcessDialog (cognitive 20) apps/web/src/components/ProcessDialog.tsx:27 — ProcessDialog.ProcessDialog has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 10, ternaries 5 (8 pts), if/else 2 (nesting depth added 3). Of this number, 16 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · forms.parseCsv (cognitive 20) · ×1
  • forms.parseCsv (cognitive 20) REDACTED:774 — forms.parseCsv has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, 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 · CompareResultsPanel.CompareResultsPanel (cognitive 20) · ×1
  • CompareResultsPanel.CompareResultsPanel (cognitive 20) apps/web/src/components/CompareResultsPanel.tsx:37 — CompareResultsPanel.CompareResultsPanel has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 6, if/else 4, loops 1 (nesting depth added 3). Of this number, 10 points are the body's own statements and 10 belong to 6 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 · CalibrateDialog.CalibrateDialog (cognitive 20) · ×1
  • CalibrateDialog.CalibrateDialog (cognitive 20) apps/web/src/components/CalibrateDialog.tsx:23 — CalibrateDialog.CalibrateDialog has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 8, if/else 2 (nesting depth added 2). Of this number, 17 points are the body's own statements and 3 belong to 2 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 · store.openProject (cognitive 20) · ×1
  • store.openProject (cognitive 20) apps/web/src/studio/projects/store.ts:144 — store.openProject has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 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 · table.tableLines (cognitive 20) · ×1
  • table.tableLines (cognitive 20) packages/markup/src/table.ts:284 — table.tableLines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, 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 · bluebeam.scaleFromMeasure (cognitive 20) · ×1
  • bluebeam.scaleFromMeasure (cognitive 20) packages/markup/src/bluebeam.ts:296 — bluebeam.scaleFromMeasure has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, ternaries 9, if/else 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · bax.baxTypeInternal (cognitive 20) · ×1
  • bax.baxTypeInternal (cognitive 20) packages/markup/src/bax.ts:50 — bax.baxTypeInternal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 3 (7 pts), boolean chains 2, match/switch 1 (nesting depth added 9). None of this is in the body itself: all 20 points belong to one function literal inside it that branches (line 54). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · cad.stretchMarkup (cognitive 20) · ×1
  • cad.stretchMarkup (cognitive 20) packages/markup/src/cad.ts:757 — cad.stretchMarkup has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, ternaries 3 (4 pts) (nesting depth added 4). Of this number, 19 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 · geo.projectionOfEpsg (cognitive 20) · ×1
  • geo.projectionOfEpsg (cognitive 20) packages/markup/src/geo.ts:17 — geo.projectionOfEpsg has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 8. 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 · xfdf.markupsToXfdf (cognitive 20) · ×1
  • xfdf.markupsToXfdf (cognitive 20) packages/markup/src/xfdf.ts:140 — xfdf.markupsToXfdf has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). Of this number, 19 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 · FolderStore.createFile (cognitive 19) · ×1
  • FolderStore.createFile (cognitive 19) apps/desktop/src/folderDrive.ts:171 — FolderStore.createFile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 2 (5 pts), ternaries 3 (5 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · groupBox.groupAffine (cognitive 19) · ×1
  • groupBox.groupAffine (cognitive 19) apps/web/src/markup/groupBox.ts:114 — groupBox.groupAffine has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 6, if/else 3 (4 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.
D2 · Cognitive Complexity · cadTools.transformSelection (cognitive 19) · ×1
  • cadTools.transformSelection (cognitive 19) apps/web/src/markup/cadTools.ts:276 — cadTools.transformSelection has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 3 (7 pts), loops 2 (3 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 · stitching.mergeStitch (cognitive 19) · ×1
  • stitching.mergeStitch (cognitive 19) apps/web/src/documents/stitching.ts:10 — stitching.mergeStitch has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 3 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). Of this number, 14 points are the body's own statements and 5 belong to 4 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 · OneDrive.listPermissions (cognitive 19) · ×1
  • OneDrive.listPermissions (cognitive 19) apps/web/src/studio/drive/onedrive.ts:919 — OneDrive.listPermissions has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (13 pts), boolean chains 5, if/else 1 (nesting depth added 5). None of this is in the body itself: all 19 points belong to one function literal inside it that branches (line 924). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AskText.AskTextHost (cognitive 19) · ×1
  • AskText.AskTextHost (cognitive 19) apps/web/src/components/AskText.tsx:28 — AskText.AskTextHost has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 3 (4 pts), boolean chains 2 (nesting depth added 5). Of this number, 11 points are the body's own statements and 8 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 · pki.certFacts (cognitive 19) · ×1
  • pki.certFacts (cognitive 19) apps/web/src/documents/pki.ts:168 — pki.certFacts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pki.readTimestamp (cognitive 19) · ×1
  • pki.readTimestamp (cognitive 19) apps/web/src/documents/pki.ts:541 — pki.readTimestamp has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, ternaries 3, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DigitalSignatures.CardPicker (cognitive 19) · ×1
  • DigitalSignatures.CardPicker (cognitive 19) REDACTED:350 — DigitalSignatures.CardPicker has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (11 pts), boolean chains 8 (nesting depth added 5). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 379, 363, 410, …). 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 · MenuBar.MenuBar (cognitive 19) · ×1
  • MenuBar.MenuBar (cognitive 19) apps/web/src/components/MenuBar.tsx:221 — MenuBar.MenuBar has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (8 pts), if/else 6, boolean chains 4, match/switch 1 (nesting depth added 1). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 9 function items inside it that branch (menu, a function literal at line 672, a function literal at line 696, …). 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 · semantic.compareParagraphs.changes (cognitive 19) · ×1
  • semantic.compareParagraphs.changes (cognitive 19) apps/web/src/compare/semantic.ts:464 — semantic.compareParagraphs.changes has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 7, boolean chains 4 (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 · SpacesPanel.SpacesPanel (cognitive 19) · ×1
  • SpacesPanel.SpacesPanel (cognitive 19) apps/web/src/components/SpacesPanel.tsx:27 — SpacesPanel.SpacesPanel has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 2 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 32, 67, 80, …). 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 · Ribbon.SlopePicker (cognitive 19) · ×1
  • Ribbon.SlopePicker (cognitive 19) apps/web/src/components/Ribbon.tsx:532 — Ribbon.SlopePicker has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), loops 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (apply, a function literal at line 568, a function literal at line 542, …). 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 · StatusBar.StatusBar (cognitive 19) · ×1
  • StatusBar.StatusBar (cognitive 19) apps/web/src/components/StatusBar.tsx:83 — StatusBar.StatusBar has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, ternaries 7 (9 pts), if/else 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 2 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 · objects.entityMode (cognitive 19) · ×1
  • objects.entityMode (cognitive 19) apps/web/src/cad/dwg/objects.ts:243 — objects.entityMode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · index.readDwg (cognitive 19) · ×1
  • index.readDwg (cognitive 19) apps/web/src/cad/dwg/index.ts:93 — index.readDwg has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, error handling 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 · ScaleRegionsPanel.ScaleRegionsPanel (cognitive 19) · ×1
  • ScaleRegionsPanel.ScaleRegionsPanel (cognitive 19) apps/web/src/components/ScaleRegionsPanel.tsx:27 — ScaleRegionsPanel.ScaleRegionsPanel has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 6 (nesting depth added 2). Of this number, 17 points are the body's own statements and 2 belong to one function literal 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 · DeletePagesDialog.DeletePagesDialog (cognitive 19) · ×1
  • DeletePagesDialog.DeletePagesDialog (cognitive 19) apps/web/src/components/DeletePagesDialog.tsx:25 — DeletePagesDialog.DeletePagesDialog has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 5, if/else 2 (nesting depth added 4). Of this number, 16 points are the body's own statements and 3 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 · InviteDialog.InviteDialog (cognitive 19) · ×1
  • InviteDialog.InviteDialog (cognitive 19) apps/web/src/components/sessions/InviteDialog.tsx:12 — InviteDialog.InviteDialog has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (8 pts), boolean chains 7, if/else 3 (4 pts) (nesting depth added 3). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 85, 49, 53, …). 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 · table.formatTableCells (cognitive 19) · ×1
  • table.formatTableCells (cognitive 19) packages/markup/src/table.ts:224 — table.formatTableCells has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 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 · columns.columnsFromXml (cognitive 19) · ×1
  • columns.columnsFromXml (cognitive 19) packages/markup/src/columns.ts:164 — columns.columnsFromXml has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 6, if/else 3 (4 pts), loops 1 (nesting depth added 5). Of this number, 17 points are the body's own statements and 2 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 · pdfValue.toPdfValue (cognitive 19) · ×1
  • pdfValue.toPdfValue (cognitive 19) packages/markup/src/pdfValue.ts:8 — pdfValue.toPdfValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · hatchSet.parseBhx (cognitive 19) · ×1
  • hatchSet.parseBhx (cognitive 19) packages/markup/src/hatchSet.ts:38 — hatchSet.parseBhx has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 7). Of this number, 13 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker.extractSegments · ×1
  • worker.extractSegments::walkPath (cognitive 19) packages/pdf-core/src/worker.ts:769 — worker.extractSegments::walkPath has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (5 pts), boolean chains 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 · token.signOn (cognitive 18) · ×1
  • token.signOn (cognitive 18) apps/desktop/src/token.ts:383 — token.signOn has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), error handling 4 (6 pts), ternaries 3, boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · MarkupTools.drawStitchGuides (cognitive 18) · ×1
  • MarkupTools.drawStitchGuides (cognitive 18) apps/web/src/markup/MarkupTools.ts:2894 — MarkupTools.drawStitchGuides has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 3 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 7). Of this number, 14 points are the body's own statements and 4 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 · MarkupTools.drawLinks (cognitive 18) · ×1
  • MarkupTools.drawLinks (cognitive 18) apps/web/src/markup/MarkupTools.ts:3986 — MarkupTools.drawLinks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (4 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkupTools.scaleClick (cognitive 18) · ×1
  • MarkupTools.scaleClick (cognitive 18) apps/web/src/markup/MarkupTools.ts:4129 — MarkupTools.scaleClick has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkupTools.pickTargetsAt (cognitive 18) · ×1
  • MarkupTools.pickTargetsAt (cognitive 18) apps/web/src/markup/MarkupTools.ts:4581 — MarkupTools.pickTargetsAt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7, ternaries 3 (6 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · model.readModel (cognitive 18) · ×1
  • model.readModel (cognitive 18) apps/web/src/geospatial/model.ts:38 — model.readModel has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, if/else 6, ternaries 3 (6 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 · marks.joinedSheet (cognitive 18) · ×1
  • marks.joinedSheet (cognitive 18) apps/web/src/sheets/marks.ts:283 — marks.joinedSheet has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 7). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · script.applySet (cognitive 18) · ×1
  • script.applySet (cognitive 18) apps/web/src/scripts/script.ts:406 — script.applySet has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 3 (5 pts), boolean chains 4, 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 · viewScales.viewLabels (cognitive 18) · ×1
  • viewScales.viewLabels (cognitive 18) apps/web/src/measure/viewScales.ts:35 — viewScales.viewLabels has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 3 (7 pts), boolean chains 1, 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 · exportSummary.buildRows (cognitive 18) · ×1
  • exportSummary.buildRows (cognitive 18) apps/web/src/summary/exportSummary.ts:114 — exportSummary.buildRows has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 2 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). Of this number, 11 points are the body's own statements and 7 belong to one function literal inside it that branches. 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 · printPdf.parsePageRange (cognitive 18) · ×1
  • printPdf.parsePageRange (cognitive 18) apps/web/src/documents/printPdf.ts:12 — printPdf.parsePageRange has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 3 (5 pts), boolean chains 3, 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 · ltv.firstNewObjectNumber (cognitive 18) · ×1
  • ltv.firstNewObjectNumber (cognitive 18) REDACTED:388 — ltv.firstNewObjectNumber has cognitive complexity 18 (threshold 15). Drivers by points: loops 7 (12 pts), if/else 4 (5 pts), error handling 1 (nesting depth added 6). 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 · pki.buildChain (cognitive 18) · ×1
  • pki.buildChain (cognitive 18) apps/web/src/documents/pki.ts:265 — pki.buildChain has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 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 · revuFolder.classifyRevuPath (cognitive 18) · ×1
  • revuFolder.classifyRevuPath (cognitive 18) apps/web/src/migrate/revuFolder.ts:35 — revuFolder.classifyRevuPath has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, ternaries 3 (6 pts), boolean chains 3 (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 · ProjectsPanel.ManageProject (cognitive 18) · ×1
  • ProjectsPanel.ManageProject (cognitive 18) apps/web/src/components/ProjectsPanel.tsx:634 — ProjectsPanel.ManageProject has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 3 (4 pts), ternaries 3 (4 pts) (nesting depth added 2). Of this number, 12 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · assistantScales.proposePageScale (cognitive 18) · ×1
  • assistantScales.proposePageScale (cognitive 18) apps/web/src/desktop/assistantScales.ts:109 — assistantScales.proposePageScale has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 7, ternaries 3 (4 pts) (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 · assistant.styleOf (cognitive 18) · ×1
  • assistant.styleOf (cognitive 18) apps/web/src/desktop/assistant.ts:607 — assistant.styleOf has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · pdfa.invisibleTextFonts (cognitive 18) · ×1
  • pdfa.invisibleTextFonts (cognitive 18) apps/web/src/documents/pdfa.ts:164 — pdfa.invisibleTextFonts has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 3 (5 pts), loops 4, boolean chains 1 (nesting depth added 7). Of this number, 11 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tiff.encodeG4 (cognitive 18) · ×1
  • tiff.encodeG4 (cognitive 18) apps/web/src/documents/tiff.ts:287 — tiff.encodeG4 has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (5 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 8). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. 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 · arrange.touchesPolygon (cognitive 18) · ×1
  • arrange.touchesPolygon (cognitive 18) packages/markup/src/arrange.ts:236 — arrange.touchesPolygon has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (6 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 · flowchart.routeCost (cognitive 18) · ×1
  • flowchart.routeCost (cognitive 18) packages/markup/src/flowchart.ts:298 — flowchart.routeCost has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 2 (3 pts), ternaries 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 · cad.lengthenPath (cognitive 18) · ×1
  • cad.lengthenPath (cognitive 18) packages/markup/src/cad.ts:285 — cad.lengthenPath has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 4 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · store.editKind (cognitive 18) · ×1
  • store.editKind (cognitive 18) packages/markup/src/store.ts:1421 — store.editKind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, ternaries 3 (6 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · export.writeViewports (cognitive 18) · ×1
  • export.writeViewports (cognitive 18) packages/markup/src/export.ts:1878 — export.writeViewports has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 5 (6 pts), boolean chains 4 (nesting depth added 4). Of this number, 16 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 · pdfExtras.imageDataUrl (cognitive 18) · ×1
  • pdfExtras.imageDataUrl (cognitive 18) packages/markup/src/pdfExtras.ts:117 — pdfExtras.imageDataUrl has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (5 pts), boolean chains 4, error handling 1 (nesting depth added 2). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · xfdf.parseXml (cognitive 18) · ×1
  • xfdf.parseXml (cognitive 18) packages/markup/src/xfdf.ts:194 — xfdf.parseXml has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · measure.labelAnchor (cognitive 18) · ×1
  • measure.labelAnchor (cognitive 18) packages/measure/src/measure.ts:718 — measure.labelAnchor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, ternaries 2 (5 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 · search (cognitive 18) · ×1
  • search (cognitive 18) apps/web/public/help/help.js:321 — search has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). Of this number, 17 points are the body's own statements and 1 belongs 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 · TileViewer.drawLoupe (cognitive 17) · ×1
  • TileViewer.drawLoupe (cognitive 17) apps/web/src/viewer/TileViewer.ts:1341 — TileViewer.drawLoupe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3 (nesting depth added 5). Of this number, 10 points are the body's own statements and 7 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 · MarkupTools.drawCad (cognitive 17) · ×1
  • MarkupTools.drawCad (cognitive 17) apps/web/src/markup/MarkupTools.ts:4902 — MarkupTools.drawCad has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 3 (4 pts), ternaries 1 (4 pts), boolean chains 1 (nesting depth added 8). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkupTools.drawPopup (cognitive 17) · ×1
  • MarkupTools.drawPopup (cognitive 17) apps/web/src/markup/MarkupTools.ts:5050 — MarkupTools.drawPopup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), loops 3 (4 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 · LineStylesDialog.SymbolCanvas (cognitive 17) · ×1
  • LineStylesDialog.SymbolCanvas (cognitive 17) apps/web/src/components/LineStylesDialog.tsx:145 — LineStylesDialog.SymbolCanvas has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (8 pts), boolean chains 4, if/else 3, loops 2 (nesting depth added 2). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 151, 189, 179). 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 · StampsDialog.StampMenu · ×1
  • StampsDialog.StampMenu::onMenuKey (cognitive 17) apps/web/src/components/StampsDialog.tsx:574 — StampsDialog.StampMenu::onMenuKey has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (14 pts), if/else 2, boolean chains 1 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · toolSets.fromRevu (cognitive 17) · ×1
  • toolSets.fromRevu (cognitive 17) apps/web/src/toolchest/toolSets.ts:9 — toolSets.fromRevu has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11 (14 pts), boolean chains 3 (nesting depth added 3). None of this is in the body itself: all 17 points belong to 2 function literals inside it that branch (lines 17, 29). 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 · QuantitiesDialog.QuantitiesDialog (cognitive 17) · ×1
  • QuantitiesDialog.QuantitiesDialog (cognitive 17) apps/web/src/components/QuantitiesDialog.tsx:26 — QuantitiesDialog.QuantitiesDialog has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 7, loops 1 (nesting depth added 2). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 93, a function literal at line 29, a function literal at line 38, …). 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 · viewScales.drawingArea (cognitive 17) · ×1
  • viewScales.drawingArea (cognitive 17) apps/web/src/measure/viewScales.ts:62 — viewScales.drawingArea has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, loops 1, ternaries 1 (nesting depth added 3). Of this number, 13 points are the body's own statements and 4 belong to 4 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 · MeasurementsPanel.Viewports (cognitive 17) · ×1
  • MeasurementsPanel.Viewports (cognitive 17) apps/web/src/components/MeasurementsPanel.tsx:893 — MeasurementsPanel.Viewports has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, ternaries 5, if/else 3. Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 924, a function literal at line 910, removeMany, …). 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 · bcf.parsePageSpec (cognitive 17) · ×1
  • bcf.parsePageSpec (cognitive 17) apps/web/src/summary/bcf.ts:597 — bcf.parsePageSpec has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). Of this number, 12 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · taggedContent.removeTagged (cognitive 17) · ×1
  • taggedContent.removeTagged (cognitive 17) apps/web/src/documents/taggedContent.ts:28 — taggedContent.removeTagged has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 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 · pki.revocationEvidence (cognitive 17) · ×1
  • pki.revocationEvidence (cognitive 17) apps/web/src/documents/pki.ts:760 — pki.revocationEvidence has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (7 pts), error handling 2 (4 pts), if/else 2 (4 pts), 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 · pdfSign.parseCms (cognitive 17) · ×1
  • pdfSign.parseCms (cognitive 17) apps/web/src/documents/pdfSign.ts:327 — pdfSign.parseCms has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 2, if/else 2, error handling 1, loops 1 (nesting depth added 2). Of this number, 16 points are the body's own statements and 1 belongs to one function literal 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 · DigitalSignatures.DigitalIdsDialog (cognitive 17) · ×1
  • DigitalSignatures.DigitalIdsDialog (cognitive 17) REDACTED:183 — DigitalSignatures.DigitalIdsDialog has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 13, ternaries 3, if/else 1. Of this number, 14 points are the body's own statements and 3 belong to 8 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · compare.comparePages (cognitive 17) · ×1
  • compare.comparePages (cognitive 17) apps/web/src/compare/compare.ts:114 — compare.comparePages has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 5 (6 pts), boolean chains 4 (nesting depth added 4). Of this number, 15 points are the body's own statements and 2 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 · security.encryptStrings (cognitive 17) · ×1
  • security.encryptStrings (cognitive 17) REDACTED:132 — security.encryptStrings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (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 · SecurityDialog.SecurityDialog (cognitive 17) · ×1
  • SecurityDialog.SecurityDialog (cognitive 17) apps/web/src/components/SecurityDialog.tsx:23 — SecurityDialog.SecurityDialog has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8, boolean chains 7, if/else 2. Of this number, 10 points are the body's own statements and 7 belong to 3 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 · revuKeys.revuOverrides (cognitive 17) · ×1
  • revuKeys.revuOverrides (cognitive 17) apps/web/src/commands/revuKeys.ts:448 — revuKeys.revuOverrides has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts), 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 · startTips.inlineParts (cognitive 17) · ×1
  • startTips.inlineParts (cognitive 17) apps/web/src/help/startTips.ts:126 — startTips.inlineParts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (6 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 · objects.text (cognitive 17) · ×1
  • objects.text (cognitive 17) apps/web/src/cad/dwg/objects.ts:669 — objects.text has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 6, boolean chains 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 · SessionDialogs.EndSessionDialog (cognitive 17) · ×1
  • SessionDialogs.EndSessionDialog (cognitive 17) apps/web/src/components/sessions/SessionDialogs.tsx:657 — SessionDialogs.EndSessionDialog has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 12, ternaries 4, if/else 1. Of this number, 15 points are the body's own statements and 2 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ProjectsPanel.Members (cognitive 17) · ×1
  • ProjectsPanel.Members (cognitive 17) apps/web/src/components/ProjectsPanel.tsx:995 — ProjectsPanel.Members has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, ternaries 3 (5 pts), if/else 3, error handling 1 (nesting depth added 2). Of this number, 9 points are the body's own statements and 8 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · assistantSymbols.proposeCounts (cognitive 17) · ×1
  • assistantSymbols.proposeCounts (cognitive 17) apps/web/src/desktop/assistantSymbols.ts:130 — assistantSymbols.proposeCounts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (5 pts), boolean chains 2, error handling 1 (nesting depth added 2). Of this number, 9 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · flowchart.routeConnector (cognitive 17) · ×1
  • flowchart.routeConnector (cognitive 17) packages/markup/src/flowchart.ts:94 — flowchart.routeConnector has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8, boolean chains 5, if/else 4. Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, 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 · MarkupStore.refresh (cognitive 17) · ×1
  • MarkupStore.refresh (cognitive 17) packages/markup/src/store.ts:305 — MarkupStore.refresh has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2 (nesting depth added 4). Of this number, 16 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 · export.columnData (cognitive 17) · ×1
  • export.columnData (cognitive 17) packages/markup/src/export.ts:1712 — export.columnData has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 4, boolean chains 2 (nesting depth added 6). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 1713). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · lineStyleEdit.readComponent (cognitive 17) · ×1
  • lineStyleEdit.readComponent (cognitive 17) packages/markup/src/lineStyleEdit.ts:70 — lineStyleEdit.readComponent has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (12 pts), if/else 4, 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 · scale.scaleParts (cognitive 17) · ×1
  • scale.scaleParts (cognitive 17) packages/measure/src/scale.ts:443 — scale.scaleParts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, ternaries 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 · regionGeometry.insideIntervals (cognitive 17) · ×1
  • regionGeometry.insideIntervals (cognitive 17) packages/pdf-core/src/regionGeometry.ts:131 — regionGeometry.insideIntervals has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker.getPage (cognitive 17) · ×1
  • worker.getPage (cognitive 17) packages/pdf-core/src/worker.ts:131 — worker.getPage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker.shxWords (cognitive 17) · ×1
  • worker.shxWords (cognitive 17) packages/pdf-core/src/worker.ts:1763 — worker.shxWords has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), ternaries 2 (5 pts), boolean chains 3, 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 · worker.onmessage (cognitive 17) · ×1
  • worker.onmessage (cognitive 17) packages/pdf-core/src/worker.ts:1955 — worker.onmessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), boolean chains 2, match/switch 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 · standard.customFields (cognitive 17) · ×1
  • standard.customFields (cognitive 17) packages/sheets/src/standard.ts:262 — standard.customFields has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · matchLines.findLine (cognitive 17) · ×1
  • matchLines.findLine (cognitive 17) packages/stitch/src/matchLines.ts:82 — matchLines.findLine has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.listenForAssistant (cognitive 16) · ×1
  • server.listenForAssistant (cognitive 16) apps/desktop/src/assistant/server.ts:12 — server.listenForAssistant has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 5, ternaries 3, error handling 1. None of this is in the body itself: all 16 points belong to 5 function literals inside it that branch (lines 28, 15, 57, …). 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 · DesktopAuth.microsoft (cognitive 16) · ×1
  • DesktopAuth.microsoft (cognitive 16) apps/desktop/src/auth.ts:99 — DesktopAuth.microsoft has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 4, ternaries 3, error handling 1 (2 pts) (nesting depth added 3). Of this number, 13 points are the body's own statements and 3 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 · EngineSupervisor.restart (cognitive 16) · ×1
  • EngineSupervisor.restart (cognitive 16) apps/web/src/viewer/engineSupervisor.ts:104 — EngineSupervisor.restart has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 1 (3 pts), error handling 1 (2 pts), boolean chains 1, 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 · clip.asRect (cognitive 16) · ×1
  • clip.asRect (cognitive 16) apps/web/src/documents/renderCopy/clip.ts:37 — clip.asRect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, loops 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 · images.rescalable (cognitive 16) · ×1
  • images.rescalable (cognitive 16) apps/web/src/documents/renderCopy/images.ts:39 — images.rescalable has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, ternaries 4 (6 pts), boolean chains 3 (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 · MarkupTools.numbered (cognitive 16) · ×1
  • MarkupTools.numbered (cognitive 16) apps/web/src/markup/MarkupTools.ts:1964 — MarkupTools.numbered has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (4 pts), boolean chains 2, ternaries 2 (nesting depth added 5). Of this number, 14 points are the body's own statements and 2 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 · MarkupTools.drawGeoOverlay (cognitive 16) · ×1
  • MarkupTools.drawGeoOverlay (cognitive 16) apps/web/src/markup/MarkupTools.ts:2799 — MarkupTools.drawGeoOverlay has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 4, ternaries 2 (3 pts), loops 2 (nesting depth added 2). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 2836, 2807, 2827). 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 · listColumns.commentListMarkups (cognitive 16) · ×1
  • listColumns.commentListMarkups (cognitive 16) apps/web/src/columns/listColumns.ts:438 — listColumns.commentListMarkups has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 5). Of this number, 14 points are the body's own statements and 2 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 · ToolBar.HatchMenu (cognitive 16) · ×1
  • ToolBar.HatchMenu (cognitive 16) apps/web/src/components/ToolBar.tsx:730 — ToolBar.HatchMenu has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5, ternaries 3 (4 pts) (nesting depth added 1). Of this number, 9 points are the body's own statements and 7 belong to 6 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 · SheetSyncDialog.SheetSyncDialog (cognitive 16) · ×1
  • SheetSyncDialog.SheetSyncDialog (cognitive 16) apps/web/src/components/SheetSyncDialog.tsx:34 — SheetSyncDialog.SheetSyncDialog has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 4 (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 · CommandPalette.CommandPalette (cognitive 16) · ×1
  • CommandPalette.CommandPalette (cognitive 16) apps/web/src/components/CommandPalette.tsx:24 — CommandPalette.CommandPalette has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, ternaries 5, boolean chains 3. Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 64, a function literal at line 77, a function literal at line 32, …). 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 · ocr.recognise (cognitive 16) · ×1
  • ocr.recognise (cognitive 16) apps/web/src/documents/ocr.ts:116 — ocr.recognise has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 1 (5 pts), boolean chains 1 (nesting depth added 10). 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 · forms.writeAppearances (cognitive 16) · ×1
  • forms.writeAppearances (cognitive 16) REDACTED:383 — forms.writeAppearances has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VisualSearchPanel.VisualSearchPanel (cognitive 16) · ×1
  • VisualSearchPanel.VisualSearchPanel (cognitive 16) apps/web/src/components/VisualSearchPanel.tsx:38 — VisualSearchPanel.VisualSearchPanel has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 4, if/else 1 (nesting depth added 6). 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 · ctb.parseCtb (cognitive 16) · ×1
  • ctb.parseCtb (cognitive 16) apps/web/src/cad/ctb.ts:81 — ctb.parseCtb has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 3 (5 pts), boolean chains 3, error handling 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 · indexer.repairSquareImages (cognitive 16) · ×1
  • indexer.repairSquareImages (cognitive 16) apps/web/src/sheets/indexer.ts:229 — indexer.repairSquareImages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 7). None of this is in the body itself: all 16 points belong to 2 function literals inside it that branch (lines 231, 237). 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 · StandardSettings.StandardSettings (cognitive 16) · ×1
  • StandardSettings.StandardSettings (cognitive 16) apps/web/src/components/standardsWizard/StandardSettings.tsx:84 — StandardSettings.StandardSettings has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (7 pts), if/else 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 159, 94, 107, …). 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 · teachLinks.titleWords (cognitive 16) · ×1
  • teachLinks.titleWords (cognitive 16) apps/web/src/sheets/teachLinks.ts:201 — teachLinks.titleWords has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (7 pts), if/else 3 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · assistantStandards.proposeStandardHints (cognitive 16) · ×1
  • assistantStandards.proposeStandardHints (cognitive 16) apps/web/src/desktop/assistantStandards.ts:178 — assistantStandards.proposeStandardHints has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, 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 · stitchPages.stitchToPage (cognitive 16) · ×1
  • stitchPages.stitchToPage (cognitive 16) apps/web/src/documents/stitchPages.ts:32 — stitchPages.stitchToPage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (5 pts), ternaries 1 (2 pts) (nesting depth added 6). Of this number, 14 points are the body's own statements and 2 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 · table.cleanFormats (cognitive 16) · ×1
  • table.cleanFormats (cognitive 16) packages/markup/src/table.ts:95 — table.cleanFormats has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, loops 2 (3 pts), 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 · lineStyle.lineStyleReach (cognitive 16) · ×1
  • lineStyle.lineStyleReach (cognitive 16) packages/markup/src/lineStyle.ts:268 — lineStyle.lineStyleReach has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (5 pts), loops 2 (3 pts) (nesting depth added 7). Of this number, 12 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 · flowchart.elbowRoute (cognitive 16) · ×1
  • flowchart.elbowRoute (cognitive 16) packages/markup/src/flowchart.ts:255 — flowchart.elbowRoute has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (11 pts), boolean chains 2, if/else 2, ternaries 1 (nesting depth added 5). Of this number, 13 points are the body's own statements and 3 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 · bpx.parseBpx (cognitive 16) · ×1
  • bpx.parseBpx (cognitive 16) packages/markup/src/bpx.ts:39 — bpx.parseBpx has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 3, loops 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cad.divisionPoints (cognitive 16) · ×1
  • cad.divisionPoints (cognitive 16) packages/markup/src/cad.ts:114 — cad.divisionPoints has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (6 pts), if/else 4 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarkupStore.setDetectedLinks (cognitive 16) · ×1
  • MarkupStore.setDetectedLinks (cognitive 16) packages/markup/src/store.ts:573 — MarkupStore.setDetectedLinks has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, ternaries 2 (5 pts), if/else 2 (3 pts), loops 2 (nesting depth added 4). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 583, overlaps). 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 · MarkupStore.update (cognitive 16) · ×1
  • MarkupStore.update (cognitive 16) packages/markup/src/store.ts:1213 — MarkupStore.update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, loops 1 (nesting depth added 2). Of this number, 14 points are the body's own statements and 2 belong to one function literal 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 · export.writeColumns (cognitive 16) · ×1
  • export.writeColumns (cognitive 16) packages/markup/src/export.ts:1653 — export.writeColumns has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). Of this number, 9 points are the body's own statements and 7 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 · toolchest.blitImage (cognitive 16) · ×1
  • toolchest.blitImage (cognitive 16) REDACTED:867 — toolchest.blitImage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (3 pts), ternaries 1 (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 · stampPdf.richText (cognitive 16) · ×1
  • stampPdf.richText (cognitive 16) packages/markup/src/stampPdf.ts:72 — stampPdf.richText 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 · summary.appendSummary (cognitive 16) · ×1
  • summary.appendSummary (cognitive 16) packages/markup/src/summary.ts:75 — summary.appendSummary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 3, loops 2, ternaries 2 (nesting depth added 2). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (newPage, a function literal at line 119, a function literal at line 125, …). 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 · scale.parseScaleText (cognitive 16) · ×1
  • scale.parseScaleText (cognitive 16) packages/measure/src/scale.ts:330 — scale.parseScaleText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 5). Of this number, 14 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 · SegmentHash.has (cognitive 16) · ×1
  • SegmentHash.has (cognitive 16) packages/measure/src/visualSearch.ts:66 — SegmentHash.has has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (7 pts), loops 3 (6 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 · geo.solve3 (cognitive 16) · ×1
  • geo.solve3 (cognitive 16) packages/measure/src/geo.ts:192 — geo.solve3 has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 4 (8 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 · worker.linkTarget (cognitive 16) · ×1
  • worker.linkTarget (cognitive 16) packages/pdf-core/src/worker.ts:969 — worker.linkTarget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (3 pts), boolean chains 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 · worker.destTarget (cognitive 16) · ×1
  • worker.destTarget (cognitive 16) packages/pdf-core/src/worker.ts:1540 — worker.destTarget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (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 · confidence.stepMeter (cognitive 16) · ×1
  • confidence.stepMeter (cognitive 16) packages/sheets/src/confidence.ts:161 — confidence.stepMeter has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 4, boolean chains 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 · manual.manualEdges (cognitive 16) · ×1
  • manual.manualEdges (cognitive 16) packages/stitch/src/manual.ts:157 — manual.manualEdges has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 2 (4 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.
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: App.tsx → message.ts, main.ts, preload.ts, toc.js apps/web/src/App.tsx — `apps/web/src/App.tsx` changes together with 4 other files — `apps/desktop/src/assistant/message.ts`, `apps/desktop/src/main.ts`, `apps/desktop/src/preload.ts`, `apps/web/public/help/toc.js` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
D4 · Code Duplication · Edited copy of a member (26 corresponding lines) · ×1
  • Edited copy of a member (26 corresponding lines) scripts/make_stitch_test_pdf.py:99 — scripts/make_stitch_test_pdf.py:99-124 | scripts/make_test_pdf.py:84-121 — 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 copy of a member (28 corresponding lines) · ×1
  • Edited copy of a member (28 corresponding lines) scripts/roadset/sheets_cross.py:134 — scripts/roadset/sheets_cross.py:134-164 | scripts/roadset/sheets_long.py:42-69 — These two members are one piece of code written twice and then edited apart: 28 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) · ×1
  • Edited copy of a member (9 corresponding lines) scripts/roadset/titleblock.py:183 — scripts/roadset/titleblock.py:183-191 | scripts/roadset/titleblock.py:216-226 — 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 · Edited copy of a member (6 corresponding lines) · ×1
  • Edited copy of a member (6 corresponding lines) scripts/roadset/geom.py:197 — scripts/roadset/geom.py:197-202 | scripts/roadset/site.py:36-44 — 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 · Duplicated block (11 lines × 2) · ×1
  • Duplicated block (11 lines × 2) scripts/roadset/sheets_general.py:482 — scripts/roadset/sheets_general.py:482-492 | scripts/roadset/sheets_general.py:564-574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) scripts/roadset/sheets_cross.py:139 — scripts/roadset/sheets_cross.py:139-145 | scripts/roadset/sheets_long.py:45-51 | scripts/roadset/sheets_plan.py:63-69 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `scripts/roadset/sheets_cross.py:146` calls `pl` and `scripts/roadset/sheets_plan.py:70` 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 × 2) · ×1
  • Duplicated block (5 lines × 2) scripts/help/make_sample.py:195 — scripts/help/make_sample.py:195-199 | scripts/help/make_sample.py:207-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
IC1 · Incompleteness & stubs · Guard cannot change the result · ×1
  • Guard cannot change the result — returns what the code already falls through to apps/web/src/commands/keys.ts:45 — The guard above `return e.key;` also returns `e.key`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
IC1 · Incompleteness & stubs · Markup wires an event to an empty handler · ×1
  • Markup wires an event to an empty handler apps/web/src/components/BatchDialog.tsx:216 — `onRemove` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it.
IC1 · Incompleteness & stubs · Empty method body · ×1
  • Empty method body — does nothing with its inputs apps/web/src/main.tsx:41 — `updateSW` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
P2 · Observability · No structured logging · ×1
  • No structured logging — No logging call was found in the 513 JavaScript/TypeScript production file(s) this check read across 8 module(s). Each was searched for its ecosystem's logging libraries (JavaScript/TypeScript: pino, winston, bunyan, log4js, loglevel, consola, the NestJS Logger) and for a call on a receiver named `log`/`logger` (or ending in `Logger`/`_logger`) with a level verb. It cannot see logging through a repo-local wrapper named otherwise, or in source it did not read — this is 'no logging found by this walk', not a verdict that nothing here logs. If it is right, production issues will be hard to diagnose.
R10 · Code Duplication · Duplication concentrated across 3 sibling directories (38 clone groups) · ×1
  • Duplication concentrated across 3 sibling directories (38 clone groups) apps/web/src/sheetsync/xlsx.ts:12 — 38 duplicated blocks under the repository root have copies in at least two of the sibling directories apps, packages, scripts — 31 of them are reported below, and 7 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 38 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 38 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 38 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 24 sibling directories (38 clone groups) · ×1
  • Duplication concentrated across 24 sibling directories (38 clone groups) apps/web/src/library/pack.ts:28 — 38 duplicated blocks under apps/web/src/ have copies in at least two of the sibling directories assemblies, cad, columns, compare, components, desktop (+18 more sibling(s) not listed) — 29 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 38 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 38 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 38 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 (8 clone groups) · ×1
  • Duplication concentrated across 4 sibling directories (8 clone groups) packages/markup/src/import.ts:36 — 8 duplicated blocks under packages/ have copies in at least two of the sibling directories markup, measure, pdf-core, stitch — 5 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 8 and which does not depend on how exactly each block's copies still match. 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 3 sibling directories (5 clone groups) · ×1
  • Duplication concentrated across 3 sibling directories (5 clone groups) apps/web/src/studio/crypto/sealedDrive.ts:56 — 5 duplicated blocks under apps/web/src/studio/ have copies in at least two of the sibling directories crypto, drive, projects — 1 of them are reported below, and 4 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 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 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 5 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 (173 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (173 matched lines × 2 locations) apps/web/src/components/standardsWizard/ChainageStep.tsx:13 — apps/web/src/components/standardsWizard/ChainageStep.tsx:13 · apps/web/src/components/standardsWizard/MatchLineStep.tsx:13 — the two spans are one implementation copied and then locally edited — 1282 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 (135 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (135 matched lines × 2 locations) apps/web/src/components/MeasurementsPanel.tsx:407 — apps/web/src/components/MeasurementsPanel.tsx:407 · apps/web/src/components/SetScaleDialog.tsx:116 — the two spans are one implementation copied and then locally edited — 1004 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 (113 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (113 matched lines × 2 locations) apps/web/src/components/standardsWizard/CalloutStep.tsx:90 — apps/web/src/components/standardsWizard/CalloutStep.tsx:90 · apps/web/src/components/standardsWizard/MatchLineStep.tsx:54 — the two spans are one implementation copied and then locally edited — 1117 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 (81 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (81 matched lines × 2 locations) apps/web/src/components/BulkInsertDialog.tsx:19 — apps/web/src/components/BulkInsertDialog.tsx:19 · apps/web/src/components/CombineDialog.tsx:17 — the two spans are one implementation copied and then locally edited — 698 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 (77 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (77 matched lines × 2 locations) apps/web/src/components/ProjectsPanel.tsx:177 — apps/web/src/components/ProjectsPanel.tsx:177 · apps/web/src/components/SessionsPanel.tsx:219 — the two spans are one implementation copied and then locally edited — 422 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 (69 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (69 matched lines × 2 locations) apps/web/src/components/ItemsDialog.tsx:14 — apps/web/src/components/ItemsDialog.tsx:14 · apps/web/src/components/ProductListsDialog.tsx:11 — the two spans are one implementation copied and then locally edited — 637 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) apps/web/src/components/CommandPalette.tsx:11 — apps/web/src/components/CommandPalette.tsx:11 · apps/web/src/components/MenuSearch.tsx:17 — the two spans are one implementation copied and then locally edited — 534 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 (51 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (51 matched lines × 2 locations) apps/web/src/library/pack.ts:28 — apps/web/src/library/pack.ts:28 · apps/web/src/sheets/standards.ts:203 — the two spans are one implementation copied and then locally edited — 437 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) packages/markup/src/assemblies.ts:77 — packages/markup/src/assemblies.ts:77 · packages/markup/src/estimating.ts:153 — the two spans are one implementation copied and then locally edited — 450 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) apps/web/src/components/AssembliesDialog.tsx:244 — apps/web/src/components/AssembliesDialog.tsx:244 · apps/web/src/components/ProductListsDialog.tsx:82 — the two spans are one implementation copied and then locally edited — 439 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 (42 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (42 matched lines × 2 locations) apps/web/src/documents/zip.ts:14 — apps/web/src/documents/zip.ts:14 · apps/web/src/sheetsync/xlsx.ts:22 — the two spans are one implementation copied and then locally edited — 464 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 (35 lines × 2 locations) · ×1
  • Duplicated block (35 lines × 2 locations) apps/web/src/components/ProjectsPanel.tsx:653 — apps/web/src/components/ProjectsPanel.tsx:653 · apps/web/src/components/sessions/SessionDialogs.tsx:481 — 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 (31 lines × 2 locations) · ×1
  • Duplicated block (31 lines × 2 locations) apps/web/src/assemblies/countProposals.ts:36 — apps/web/src/assemblies/countProposals.ts:36 · apps/web/src/assemblies/proposals.ts:29 — 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 (29 lines × 2 locations) · ×1
  • Duplicated block (29 lines × 2 locations) apps/web/src/components/standardsWizard/CalloutStep.tsx:244 — apps/web/src/components/standardsWizard/CalloutStep.tsx:244 · apps/web/src/components/standardsWizard/ChainageStep.tsx:279 — 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 (27 lines × 2 locations) · ×1
  • Duplicated block (27 lines × 2 locations) apps/web/src/App.tsx:9881 — apps/web/src/App.tsx:9881 · apps/web/src/App.tsx:10005 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block with local edits (27 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (27 matched lines × 2 locations) apps/web/src/components/LabelRegionsPanel.tsx:151 — apps/web/src/components/LabelRegionsPanel.tsx:151 · apps/web/src/components/ScaleRegionsPanel.tsx:54 — the two spans are one implementation copied and then locally edited — 257 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 (25 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (25 matched lines × 2 locations) apps/web/src/studio/drive/folder.ts:31 — apps/web/src/studio/drive/folder.ts:31 · apps/web/src/studio/drive/folder.ts:124 — the two spans are one implementation copied and then locally edited — 244 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 with local edits (24 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (24 matched lines × 2 locations) apps/web/src/components/StepUpDialog.tsx:21 — apps/web/src/components/StepUpDialog.tsx:21 · apps/web/src/components/StepUpDialog.tsx:53 — the two spans are one implementation copied and then locally edited — 278 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 (23 lines × 2 locations) · ×1
  • Duplicated block (23 lines × 2 locations) apps/web/src/components/PageToolsDialog.tsx:239 — apps/web/src/components/PageToolsDialog.tsx:239 · apps/web/src/components/ProcessDialog.tsx:37 — 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 (23 lines × 3 locations) · ×1
  • Duplicated block (23 lines × 3 locations) apps/web/src/components/standardsWizard/CalloutStep.tsx:278 — apps/web/src/components/standardsWizard/CalloutStep.tsx:278 · apps/web/src/components/standardsWizard/ChainageStep.tsx:312 · apps/web/src/components/standardsWizard/MatchLineStep.tsx:227 — 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 (21 lines × 2 locations) · ×1
  • Duplicated block (21 lines × 2 locations) apps/web/src/assemblies/csv.ts:4 — apps/web/src/assemblies/csv.ts:4 · REDACTED:774 — 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 (19 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (19 matched lines × 2 locations) scripts/readme/measure-redact-shots.cjs:10 — scripts/readme/measure-redact-shots.cjs:10 · scripts/readme/takeoff-shots.cjs:13 — the two spans are one implementation copied and then locally edited — 210 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 (18 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (18 matched lines × 2 locations) apps/web/src/components/MenuBar.tsx:221 — apps/web/src/components/MenuBar.tsx:221 · apps/web/src/components/ToolBar.tsx:730 — the two spans are one implementation copied and then locally edited — 106 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 (17 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (17 matched lines × 2 locations) apps/web/src/components/CountReview.tsx:59 — apps/web/src/components/CountReview.tsx:59 · apps/web/src/components/TakeoffReview.tsx:243 — the two spans are one implementation copied and then locally edited — 140 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.
R2 · Cyclomatic Complexity · Complex function App (cyclomatic 384, cognitive 306) · ×1
  • Complex function App (cyclomatic 384, cognitive 306) apps/web/src/App.tsx:909 — App has cyclomatic complexity 384 and cognitive complexity 306; 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 pointerDown (cyclomatic 253, cognitive 346) · ×1
  • Complex function pointerDown (cyclomatic 253, cognitive 346) apps/web/src/markup/MarkupTools.ts:2961 — pointerDown has cyclomatic complexity 253 and cognitive complexity 346; 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 fromRaw (cyclomatic 138, cognitive 206) · ×1
  • Complex function fromRaw (cyclomatic 138, cognitive 206) packages/markup/src/import.ts:635 — fromRaw has cyclomatic complexity 138 and cognitive complexity 206; 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 annotationDict (cyclomatic 138, cognitive 118) · ×1
  • Complex function annotationDict (cyclomatic 138, cognitive 118) packages/markup/src/export.ts:865 — annotationDict has cyclomatic complexity 138 and cognitive complexity 118; 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 buildCommands (cyclomatic 124, cognitive 104) · ×1
  • Complex function buildCommands (cyclomatic 124, cognitive 104) apps/web/src/commands/appCommands.ts:365 — buildCommands has cyclomatic complexity 124 and cognitive complexity 104; 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 122, cognitive 284) · ×1
  • Complex function (anonymous) (cyclomatic 122, cognitive 284) apps/web/src/App.tsx:3422 — (anonymous) has cyclomatic complexity 122 and cognitive complexity 284; 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 sidePanel (cyclomatic 120, cognitive 113) · ×1
  • Complex function sidePanel (cyclomatic 120, cognitive 113) apps/web/src/App.tsx:9022 — sidePanel has cyclomatic complexity 120 and cognitive complexity 113; 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 exportWithAnnotations (cyclomatic 116, cognitive 256) · ×1
  • Complex function exportWithAnnotations (cyclomatic 116, cognitive 256) packages/markup/src/export.ts:2064 — exportWithAnnotations has cyclomatic complexity 116 and cognitive complexity 256; 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 draw (cyclomatic 111, cognitive 155) · ×1
  • Complex function draw (cyclomatic 111, cognitive 155) apps/web/src/markup/MarkupTools.ts:2388 — draw has cyclomatic complexity 111 and cognitive complexity 155; 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 importAnnotations (cyclomatic 104, cognitive 191) · ×1
  • Complex function importAnnotations (cyclomatic 104, cognitive 191) packages/markup/src/import.ts:136 — importAnnotations has cyclomatic complexity 104 and cognitive complexity 191; 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 appearance (cyclomatic 102, cognitive 212) · ×1
  • Complex function appearance (cyclomatic 102, cognitive 212) packages/markup/src/export.ts:399 — appearance has cyclomatic complexity 102 and cognitive complexity 212; 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 entityData (cyclomatic 97, cognitive 109) · ×1
  • Complex function entityData (cyclomatic 97, cognitive 109) apps/web/src/cad/dwg/objects.ts:316 — entityData has cyclomatic complexity 97 and cognitive complexity 109; 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 pointerMove (cyclomatic 93, cognitive 153) · ×1
  • Complex function pointerMove (cyclomatic 93, cognitive 153) apps/web/src/markup/MarkupTools.ts:3386 — pointerMove has cyclomatic complexity 93 and cognitive complexity 153; 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 oneValidationUpdate (cyclomatic 91, cognitive 126) · ×1
  • Complex function oneValidationUpdate (cyclomatic 91, cognitive 126) REDACTED:482 — oneValidationUpdate has cyclomatic complexity 91 and cognitive complexity 126; 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 baseShape (cyclomatic 89, cognitive 63) · ×1
  • Complex function baseShape (cyclomatic 89, cognitive 63) packages/markup/src/geometry.ts:65 — baseShape has cyclomatic complexity 89 and cognitive complexity 63; 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 hover (cyclomatic 87, cognitive 120) · ×1
  • Complex function hover (cyclomatic 87, cognitive 120) apps/web/src/markup/MarkupTools.ts:3843 — hover has cyclomatic complexity 87 and cognitive complexity 120; 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 86, cognitive 73) · ×1
  • Complex function (anonymous) (cyclomatic 86, cognitive 73) apps/web/src/App.tsx:6885 — (anonymous) has cyclomatic complexity 86 and cognitive complexity 73; 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 pointerUp (cyclomatic 85, cognitive 120) · ×1
  • Complex function pointerUp (cyclomatic 85, cognitive 120) apps/web/src/markup/MarkupTools.ts:3568 — pointerUp has cyclomatic complexity 85 and cognitive complexity 120; 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 StyleControls (cyclomatic 83, cognitive 62) · ×1
  • Complex function StyleControls (cyclomatic 83, cognitive 62) apps/web/src/components/ToolBar.tsx:327 — StyleControls has cyclomatic complexity 83 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 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 parseBtx (cyclomatic 82, cognitive 101) · ×1
  • Complex function parseBtx (cyclomatic 82, cognitive 101) REDACTED:268 — parseBtx has cyclomatic complexity 82 and cognitive complexity 101; 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 cadClick (cyclomatic 79, cognitive 113) · ×1
  • Complex function cadClick (cyclomatic 79, cognitive 113) apps/web/src/markup/cadTools.ts:314 — cadClick has cyclomatic complexity 79 and cognitive complexity 113; 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 multileader (cyclomatic 74, cognitive 75) · ×1
  • Complex function multileader (cyclomatic 74, cognitive 75) apps/web/src/cad/render.ts:659 — multileader has cyclomatic complexity 74 and cognitive complexity 75; 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 GeospatialPanel (cyclomatic 69, cognitive 56) · ×1
  • Complex function GeospatialPanel (cyclomatic 69, cognitive 56) apps/web/src/components/GeospatialPanel.tsx:72 — GeospatialPanel has cyclomatic complexity 69 and cognitive complexity 56; 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 drawMarkup (cyclomatic 66, cognitive 124) · ×1
  • Complex function drawMarkup (cyclomatic 66, cognitive 124) packages/markup/src/render.ts:358 — drawMarkup has cyclomatic complexity 66 and cognitive complexity 124; 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 assemble (cyclomatic 66, cognitive 77) · ×1
  • Complex function assemble (cyclomatic 66, cognitive 77) apps/web/src/cad/dwg/index.ts:126 — assemble has cyclomatic complexity 66 and cognitive complexity 77; 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 PageNav (cyclomatic 64, cognitive 53) · ×1
  • Complex function PageNav (cyclomatic 64, cognitive 53) apps/web/src/components/PageNav.tsx:68 — PageNav has cyclomatic complexity 64 and cognitive complexity 53; 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 toolStyle (cyclomatic 63, cognitive 65) · ×1
  • Complex function toolStyle (cyclomatic 63, cognitive 65) REDACTED:577 — toolStyle has cyclomatic complexity 63 and cognitive complexity 65; 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 updateField (cyclomatic 61, cognitive 112) · ×1
  • Complex function updateField (cyclomatic 61, cognitive 112) REDACTED:536 — updateField has cyclomatic complexity 61 and cognitive complexity 112; 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 commitDraft (cyclomatic 61, cognitive 77) · ×1
  • Complex function commitDraft (cyclomatic 61, cognitive 77) apps/web/src/markup/MarkupTools.ts:4370 — commitDraft has cyclomatic complexity 61 and cognitive complexity 77; 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 toolType (cyclomatic 61, cognitive 63) · ×1
  • Complex function toolType (cyclomatic 61, cognitive 63) REDACTED:488 — toolType has cyclomatic complexity 61 and cognitive complexity 63; 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 StandardsWizard (cyclomatic 60, cognitive 49) · ×1
  • Complex function StandardsWizard (cyclomatic 60, cognitive 49) apps/web/src/components/standardsWizard/StandardsWizard.tsx:80 — StandardsWizard has cyclomatic complexity 60 and cognitive complexity 49; 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 InSession (cyclomatic 60, cognitive 48) · ×1
  • Complex function InSession (cyclomatic 60, cognitive 48) apps/web/src/components/SessionsPanel.tsx:352 — InSession has cyclomatic complexity 60 and cognitive complexity 48; 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 redact (cyclomatic 57, cognitive 149) · ×1
  • Complex function redact (cyclomatic 57, cognitive 149) packages/pdf-core/src/worker.ts:1041 — redact has cyclomatic complexity 57 and cognitive complexity 149; 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 element (cyclomatic 57, cognitive 30) · ×1
  • Complex function element (cyclomatic 57, cognitive 30) packages/markup/src/xfdf.ts:53 — element has cyclomatic complexity 57 and cognitive complexity 30; 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 archiveAsPdfA (cyclomatic 56, cognitive 84) · ×1
  • Complex function archiveAsPdfA (cyclomatic 56, cognitive 84) apps/web/src/documents/pdfa.ts:19 — archiveAsPdfA has cyclomatic complexity 56 and cognitive complexity 84; 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 parseIfc (cyclomatic 56, cognitive 78) · ×1
  • Complex function parseIfc (cyclomatic 56, cognitive 78) apps/web/src/geospatial/ifc.ts:186 — parseIfc has cyclomatic complexity 56 and cognitive complexity 78; 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 readDxf (cyclomatic 55, cognitive 92) · ×1
  • Complex function readDxf (cyclomatic 55, cognitive 92) apps/web/src/cad/dxf.ts:114 — readDxf has cyclomatic complexity 55 and cognitive complexity 92; 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 55, cognitive 63) · ×1
  • Complex function (anonymous) (cyclomatic 55, cognitive 63) packages/markup/src/import.ts:380 — (anonymous) has cyclomatic complexity 55 and cognitive complexity 63; 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 MarkupList (cyclomatic 55, cognitive 51) · ×1
  • Complex function MarkupList (cyclomatic 55, cognitive 51) apps/web/src/components/MarkupList.tsx:169 — MarkupList has cyclomatic complexity 55 and cognitive complexity 51; 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 checkSignatures (cyclomatic 53, cognitive 99) · ×1
  • Complex function checkSignatures (cyclomatic 53, cognitive 99) apps/web/src/documents/pdfSign.ts:394 — checkSignatures has cyclomatic complexity 53 and cognitive complexity 99; 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.
R3 · Large Files · apps/web/src/App.tsx · ×1
  • apps/web/src/App.tsx: 11419 lines of code apps/web/src/App.tsx:1 — apps/web/src/App.tsx has 11419 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 · apps/web/src/markup/MarkupTools.ts · ×1
  • apps/web/src/markup/MarkupTools.ts: 5400 lines of code apps/web/src/markup/MarkupTools.ts:1 — apps/web/src/markup/MarkupTools.ts has 5400 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 · packages/markup/src/export.ts · ×1
  • packages/markup/src/export.ts: 2242 lines of code packages/markup/src/export.ts:1 — packages/markup/src/export.ts has 2242 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 · packages/pdf-core/src/worker.ts · ×1
  • packages/pdf-core/src/worker.ts: 1988 lines of code packages/pdf-core/src/worker.ts:1 — packages/pdf-core/src/worker.ts has 1988 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 · apps/web/src/viewer/TileViewer.ts · ×1
  • apps/web/src/viewer/TileViewer.ts: 1867 lines of code apps/web/src/viewer/TileViewer.ts:1 — apps/web/src/viewer/TileViewer.ts has 1867 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 · apps/web/src/components/Ribbon.tsx · ×1
  • apps/web/src/components/Ribbon.tsx: 1377 lines of code apps/web/src/components/Ribbon.tsx:1 — apps/web/src/components/Ribbon.tsx has 1377 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 · apps/web/src/cad/dwg/objects.ts · ×1
  • apps/web/src/cad/dwg/objects.ts: 1320 lines of code apps/web/src/cad/dwg/objects.ts:1 — apps/web/src/cad/dwg/objects.ts has 1320 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 · packages/markup/src/store.ts · ×1
  • packages/markup/src/store.ts: 1317 lines of code packages/markup/src/store.ts:1 — packages/markup/src/store.ts has 1317 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 · apps/web/src/components/PreferencesDialog.tsx · ×1
  • apps/web/src/components/PreferencesDialog.tsx: 1220 lines of code apps/web/src/components/PreferencesDialog.tsx:1 — apps/web/src/components/PreferencesDialog.tsx has 1220 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 · apps/web/src/components/MarkupList.tsx · ×1
  • apps/web/src/components/MarkupList.tsx: 1192 lines of code apps/web/src/components/MarkupList.tsx:1 — apps/web/src/components/MarkupList.tsx has 1192 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 · apps/web/src/studio/drive/DriveSession.ts · ×1
  • apps/web/src/studio/drive/DriveSession.ts: 1115 lines of code apps/web/src/studio/drive/DriveSession.ts:1 — apps/web/src/studio/drive/DriveSession.ts has 1115 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 · apps/web/src/cad/render.ts · ×1
  • apps/web/src/cad/render.ts: 1106 lines of code apps/web/src/cad/render.ts:1 — apps/web/src/cad/render.ts has 1106 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 · apps/web/src/desktop/assistant.ts · ×1
  • apps/web/src/desktop/assistant.ts: 1101 lines of code apps/web/src/desktop/assistant.ts:1 — apps/web/src/desktop/assistant.ts has 1101 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 · apps/web/src/components/MeasurementsPanel.tsx · ×1
  • apps/web/src/components/MeasurementsPanel.tsx: 1070 lines of code apps/web/src/components/MeasurementsPanel.tsx:1 — apps/web/src/components/MeasurementsPanel.tsx has 1070 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: 1062 lines of code REDACTED:1 — REDACTED has 1062 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 · apps/web/src/components/ProjectsPanel.tsx · ×1
  • apps/web/src/components/ProjectsPanel.tsx: 1057 lines of code apps/web/src/components/ProjectsPanel.tsx:1 — apps/web/src/components/ProjectsPanel.tsx has 1057 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 · apps/web/src/components/PropertiesPanel.tsx · ×1
  • apps/web/src/components/PropertiesPanel.tsx: 1048 lines of code apps/web/src/components/PropertiesPanel.tsx:1 — apps/web/src/components/PropertiesPanel.tsx has 1048 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 · apps/desktop/src/assistant/message.ts · ×1
  • apps/desktop/src/assistant/message.ts: 1023 lines of code apps/desktop/src/assistant/message.ts:1 — apps/desktop/src/assistant/message.ts has 1023 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 · packages/markup/src/import.ts · ×1
  • packages/markup/src/import.ts: 947 lines of code packages/markup/src/import.ts:1 — packages/markup/src/import.ts has 947 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 · apps/web/src/studio/drive/onedrive.ts · ×1
  • apps/web/src/studio/drive/onedrive.ts: 933 lines of code apps/web/src/studio/drive/onedrive.ts:1 — apps/web/src/studio/drive/onedrive.ts has 933 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 · apps/web/src/components/ToolBar.tsx · ×1
  • apps/web/src/components/ToolBar.tsx: 835 lines of code apps/web/src/components/ToolBar.tsx:1 — apps/web/src/components/ToolBar.tsx has 835 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 · apps/web/src/components/LayersPanel.tsx · ×1
  • apps/web/src/components/LayersPanel.tsx: 829 lines of code apps/web/src/components/LayersPanel.tsx:1 — apps/web/src/components/LayersPanel.tsx has 829 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 · apps/web/src/components/sessions/SessionDialogs.tsx · ×1
  • apps/web/src/components/sessions/SessionDialogs.tsx: 801 lines of code apps/web/src/components/sessions/SessionDialogs.tsx:1 — apps/web/src/components/sessions/SessionDialogs.tsx has 801 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 · packages/markup/src/geometry.ts · ×1
  • packages/markup/src/geometry.ts: 791 lines of code packages/markup/src/geometry.ts:1 — packages/markup/src/geometry.ts has 791 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 · apps/web/src/components/ExportDialog.tsx · ×1
  • apps/web/src/components/ExportDialog.tsx: 770 lines of code apps/web/src/components/ExportDialog.tsx:1 — apps/web/src/components/ExportDialog.tsx has 770 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: 768 lines of code REDACTED:1 — REDACTED has 768 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 · apps/web/src/components/SessionsPanel.tsx · ×1
  • apps/web/src/components/SessionsPanel.tsx: 767 lines of code apps/web/src/components/SessionsPanel.tsx:1 — apps/web/src/components/SessionsPanel.tsx has 767 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 · packages/markup/src/cad.ts · ×1
  • packages/markup/src/cad.ts: 754 lines of code packages/markup/src/cad.ts:1 — packages/markup/src/cad.ts has 754 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 · apps/web/src/studio/projects/Project.ts · ×1
  • apps/web/src/studio/projects/Project.ts: 745 lines of code apps/web/src/studio/projects/Project.ts:1 — apps/web/src/studio/projects/Project.ts has 745 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 · packages/markup/src/render.ts · ×1
  • packages/markup/src/render.ts: 736 lines of code packages/markup/src/render.ts:1 — packages/markup/src/render.ts has 736 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 · apps/web/src/components/standardsWizard/StandardsWizard.tsx · ×1
  • apps/web/src/components/standardsWizard/StandardsWizard.tsx: 733 lines of code apps/web/src/components/standardsWizard/StandardsWizard.tsx:1 — apps/web/src/components/standardsWizard/StandardsWizard.tsx has 733 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 · apps/web/src/documents/pki.ts · ×1
  • apps/web/src/documents/pki.ts: 733 lines of code apps/web/src/documents/pki.ts:1 — apps/web/src/documents/pki.ts has 733 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 · apps/web/src/components/MenuBar.tsx · ×1
  • apps/web/src/components/MenuBar.tsx: 715 lines of code apps/web/src/components/MenuBar.tsx:1 — apps/web/src/components/MenuBar.tsx has 715 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 · packages/markup/src/model.ts · ×1
  • packages/markup/src/model.ts: 685 lines of code packages/markup/src/model.ts:1 — packages/markup/src/model.ts has 685 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 · apps/web/src/components/LineStylesDialog.tsx · ×1
  • apps/web/src/components/LineStylesDialog.tsx: 675 lines of code apps/web/src/components/LineStylesDialog.tsx:1 — apps/web/src/components/LineStylesDialog.tsx has 675 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 · packages/measure/src/measure.ts · ×1
  • packages/measure/src/measure.ts: 674 lines of code packages/measure/src/measure.ts:1 — packages/measure/src/measure.ts has 674 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: 672 lines of code REDACTED:1 — REDACTED has 672 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 · apps/web/src/documents/pdfSign.ts · ×1
  • apps/web/src/documents/pdfSign.ts: 671 lines of code apps/web/src/documents/pdfSign.ts:1 — apps/web/src/documents/pdfSign.ts has 671 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 · apps/web/src/commands/appCommands.ts · ×1
  • apps/web/src/commands/appCommands.ts: 638 lines of code apps/web/src/commands/appCommands.ts:1 — apps/web/src/commands/appCommands.ts has 638 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 · apps/web/src/documents/renderCopy/content.ts · ×1
  • apps/web/src/documents/renderCopy/content.ts: 634 lines of code apps/web/src/documents/renderCopy/content.ts:1 — apps/web/src/documents/renderCopy/content.ts has 634 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling · No lint script · ×1
  • No lint script — test ✓ · lint ✗ · typecheck ✓ — read from this repository's package.json scripts and corroborated against its CI workflows. A script counts when its name or command matches the step: `test` for the suite, `lint` or `prettier` for linting, `typecheck`/`type-check`/`tsc` for type checking. ✗ therefore means no script or CI step under those names was found, NOT that the step is absent from your pipeline — a task invoked by a runner this check does not read, or named something else entirely, is not seen and is worth confirming before acting on a cross. A ✓ means the wiring is DECLARED — a script or CI step under those names exists. It is not a statement that the step passes, or that it runs at all: nothing here installs a dependency or executes a suite.
R7 · Dead Code · Dead file (~129 LoC) · ×1
  • Dead file (~129 LoC) apps/desktop/src/preload.ts — no import path from any entry point (185 application, 7 tooling, 296 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 (~99 LoC) · ×1
  • Dead file (~99 LoC) apps/web/src/components/resizablePanel.tsx — no import path from any entry point (185 application, 7 tooling, 296 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 (~73 LoC) · ×1
  • Dead file (~73 LoC) scripts/check-cad-samples.mjs — no import path from any entry point (185 application, 7 tooling, 296 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 (~56 LoC) · ×1
  • Dead file (~56 LoC) scripts/help/hero.cjs — no import path from any entry point (185 application, 7 tooling, 296 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 (~53 LoC) · ×1
  • Dead file (~53 LoC) apps/desktop/src/assistant/stdio.ts — no import path from any entry point (185 application, 7 tooling, 296 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (apps/desktop/src/assistant/mcp-cli.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~45 LoC) · ×1
  • Dead file (~45 LoC) scripts/readme/sync-shot.cjs — no import path from any entry point (185 application, 7 tooling, 296 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 (~40 LoC) · ×1
  • Dead file (~40 LoC) scripts/help/clips.cjs — no import path from any entry point (185 application, 7 tooling, 296 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 (~33 LoC) · ×1
  • Dead file (~33 LoC) scripts/readme/bulk-ribbon-shot.cjs — no import path from any entry point (185 application, 7 tooling, 296 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 (~21 LoC) · ×1
  • Dead file (~21 LoC) apps/desktop/src/token-host.ts — no import path from any entry point (185 application, 7 tooling, 296 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 (~17 LoC) · ×1
  • Dead file (~17 LoC) apps/desktop/scripts/before-pack.cjs — no import path from any entry point (185 application, 7 tooling, 296 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 (~14 LoC) · ×1
  • Dead file (~14 LoC) apps/desktop/src/assistant/mcp-cli.ts — no import path from any entry point (185 application, 7 tooling, 296 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 '@tesseract.js-data/deu' · ×1
  • Unused dependency '@tesseract.js-data/deu' apps/web/package.json:23 — Declared in apps/web/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 '@tesseract.js-data/eng' · ×1
  • Unused dependency '@tesseract.js-data/eng' apps/web/package.json:24 — Declared in apps/web/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 '@tesseract.js-data/fra' · ×1
  • Unused dependency '@tesseract.js-data/fra' apps/web/package.json:25 — Declared in apps/web/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 '@tesseract.js-data/ita' · ×1
  • Unused dependency '@tesseract.js-data/ita' apps/web/package.json:26 — Declared in apps/web/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 '@tesseract.js-data/nld' · ×1
  • Unused dependency '@tesseract.js-data/nld' apps/web/package.json:27 — Declared in apps/web/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 '@tesseract.js-data/por' · ×1
  • Unused dependency '@tesseract.js-data/por' apps/web/package.json:28 — Declared in apps/web/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 '@tesseract.js-data/spa' · ×1
  • Unused dependency '@tesseract.js-data/spa' apps/web/package.json:29 — Declared in apps/web/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.
S1 · Web-Security Posture · Weak hash algorithm · ×1
  • Weak hash algorithm REDACTED:33 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
X13 · Undrained process stream · Redirected process stream is never drained (deadlock) · ×1
  • Redirected process stream is never drained (deadlock) apps/desktop/src/print.ts:131 — `spawn` pipes both `stdout` and `stderr` here — it is given no `stdio` option, or `'pipe'` — and the parent waits for the child's end while nothing consumes either: nothing in this scope ever reads `child.stdout` or `child.stderr`. Node holds an unread pipe's output only up to its buffer: once the child writes more than that to either stream (measured on Linux: about 128 KB — the 64 KB pipe plus Node's 64 KB read-ahead — and less elsewhere), the child blocks on the write, never exits, and the `close`/`exit` this code waits for never fires. Nothing fails loudly: the promise never settles and the stuck child holds its resources until something kills it. Consume both streams before the wait (`.on('data', …)`, or `.resume()` to discard one), or stop piping what you do not want — `stdio: 'ignore'`, `'inherit'`, or those values in its slots.
X16 · Unfloored truncation loop · Truncation loop has no floor · ×1
  • Truncation loop has no floor — the value can be consumed entirely apps/web/src/studio/drive/DriveSession.ts:147 — `v` loses its last character (its last element, if it holds an array) on every pass — `v = v.slice(0, -1)` on line 147 — and the loop's only exit is the test on line 147 — which measures `v` only through `enc.encode(…).length`, as a TERM of a larger expression, and never compares its length against a bound of its own. So nothing stops the loop at one character: it runs until the test's other terms come under the bound WITHOUT any help from `v`, which leaves `v` empty — and if they never do, the loop never ends, because JavaScript's `slice`/`substring`/`substr`/`replace` hand back `""` for an empty value instead of throwing, so every later pass shortens nothing and the test never changes. Neither outcome announces itself: an empty value surfaces later, as a path that names no file, a key that matches nothing, or a record written blank — and a hang surfaces as a frozen tab or a request that never returns. Give the loop a floor (`&& v.length > 1`), or compute the length once and clamp it (`v = v.slice(0, Math.max(1, budget))`) — and decide explicitly what should happen when the budget cannot be met, rather than letting an empty value be the answer.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×1
  • Swallowed exception (caught, then discarded) apps/web/src/App.tsx:3196 — `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.
Minor — 122 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate apps/web/src/library/catalog.ts:49 — `!!v && typeof v === 'object' && !Array.isArray(v)` appears character-identically in 5 files — apps/web/src/library/catalog.ts, apps/web/src/library/pack.ts, apps/web/src/sheets/standards.ts, apps/web/src/summary/bcf.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 apps/web/src/components/MarkupList.tsx:476 — `!isMeasureKind(m.type) || m.type === 'angle'` appears character-identically in 2 files — apps/web/src/components/MarkupList.tsx, apps/web/src/components/MeasurementsPanel.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 apps/web/src/desktop/assistant.ts:379 — `!item || typeof item !== 'object' || Array.isArray(item)` appears character-identically in 2 files — apps/web/src/desktop/assistant.ts, apps/web/src/desktop/assistantViewports.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 packages/markup/src/bsiLegend.ts:115 — `!listed(m, legend) || !onLegendPage(legend, m.pageIndex) || !inLegendKeys(legend, m, plus)` appears character-identically in 2 files — packages/markup/src/bsiLegend.ts, packages/markup/src/legend.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 apps/web/src/components/ColorMenu.tsx:55 — `!root.current?.contains(t) && !pop.current?.contains(t)` appears character-identically in 2 files — apps/web/src/components/ColorMenu.tsx, apps/web/src/components/OverflowMenu.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 packages/markup/src/export.ts:572 — `(isImageType(m.type) || m.type === 'attachment') && m.image` appears character-identically in 2 files — packages/markup/src/export.ts, packages/markup/src/render.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 apps/desktop/src/graph.ts:65 — `/\/(createLink|invite)$/.test(path) || /\/permissions(\/[^/]+)?$/.test(path)` appears character-identically in 2 files — apps/desktop/src/graph.ts, apps/web/src/studio/drive/onedrive.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 apps/web/src/markup/MarkupTools.ts:5205 — `Math.hypot(b[0] - a[0], b[1] - a[1]) || 1` appears character-identically in 5 files — apps/web/src/markup/MarkupTools.ts, packages/markup/src/export.ts, packages/markup/src/geometry.ts, packages/markup/src/import.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 apps/web/src/components/CommandPalette.tsx:34 — `Number(b.c.enabled) - Number(a.c.enabled) || a.s - b.s || a.i - b.i` appears character-identically in 2 files — apps/web/src/components/CommandPalette.tsx, apps/web/src/components/MenuSearch.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 apps/web/src/columns/listColumns.ts:468 — `a.markup.pageIndex - b.markup.pageIndex || a.markup.createdAt - b.markup.createdAt` appears character-identically in 2 files — apps/web/src/columns/listColumns.ts, apps/web/src/summary/exportSummary.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 apps/web/src/sheets/indexer.ts:337 — `a.objectNumber && page.objectNumbers[a.index] !== a.objectNumber` appears character-identically in 2 files — apps/web/src/sheets/indexer.ts, packages/markup/src/import.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 apps/web/src/components/SidePanels.tsx:25 — `a.pageIndex - b.pageIndex || a.createdAt - b.createdAt` appears character-identically in 7 files — apps/web/src/components/SidePanels.tsx, apps/web/src/components/SpellCheckDialog.tsx, apps/web/src/studio/comments.ts, apps/web/src/studio/report.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 apps/web/src/desktop/assistant.ts:862 — `args.region !== undefined && args.region !== null` appears character-identically in 2 files — apps/web/src/desktop/assistant.ts, apps/web/src/desktop/assistantStitch.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 apps/web/src/columns/listColumns.ts:85 — `c.type === 'number' || c.type === 'formula'` appears character-identically in 3 files — apps/web/src/columns/listColumns.ts, apps/web/src/summary/bcf.ts, packages/markup/src/export.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 apps/desktop/src/atomic.ts:24 — `code === 'EBUSY' || code === 'EPERM' || code === 'EACCES'` appears character-identically in 2 files — apps/desktop/src/atomic.ts, apps/desktop/src/paths.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 apps/web/src/components/MeasurementsPanel.tsx:410 — `current && !groups.includes(current.group)` appears character-identically in 2 files — apps/web/src/components/MeasurementsPanel.tsx, apps/web/src/components/SetScaleDialog.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 apps/web/src/sheets/marks.ts:270 — `cx >= r.x && cx <= r.x + r.w && cy >= r.y && cy <= r.y + r.h` appears character-identically in 2 files — apps/web/src/sheets/marks.ts, packages/sheets/src/standard.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 apps/web/src/components/LinkPreview.tsx:186 — `e.button !== 0 || (e.target as HTMLElement).closest('button')` appears character-identically in 2 files — apps/web/src/components/LinkPreview.tsx, apps/web/src/components/MarkupList.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 apps/web/src/components/TableCellEditor.tsx:81 — `e.key === 'Enter' && !e.shiftKey && !e.altKey` appears character-identically in 2 files — apps/web/src/components/TableCellEditor.tsx, apps/web/src/components/TextEditor.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 apps/web/src/components/CommentDialog.tsx:35 — `e.key === 'Enter' && (e.ctrlKey || e.metaKey)` appears character-identically in 3 files — apps/web/src/components/CommentDialog.tsx, apps/web/src/components/MarkupList.tsx, apps/web/src/components/ScriptsDialog.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 apps/web/src/components/MeasurementsPanel.tsx:453 — `e.key === 'Enter' && e.currentTarget.blur()` appears character-identically in 3 files — apps/web/src/components/MeasurementsPanel.tsx, apps/web/src/components/PropertiesPanel.tsx, apps/web/src/components/Ribbon.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 apps/web/src/cad/convert.worker.ts:32 — `e.origin && e.origin !== self.location.origin` appears character-identically in 3 files — apps/web/src/cad/convert.worker.ts, apps/web/src/documents/renderCopy/renderCopy.worker.ts, packages/pdf-core/src/worker.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 apps/web/src/sheets/marks.ts:95 — `end > start && TRAILING.has(s[end - 1]!)` appears character-identically in 2 files — apps/web/src/sheets/marks.ts, packages/sheets/src/standard.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 apps/web/src/studio/drive/DriveSession.ts:348 — `err instanceof TypeError || err instanceof DriveAuthError` appears character-identically in 4 files — apps/web/src/studio/drive/DriveSession.ts, apps/web/src/studio/drive/rooms.ts, apps/web/src/studio/projects/Project.ts, apps/web/src/studio/projects/queue.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 apps/web/src/components/LabelRegionsPanel.tsx:44 — `initialPages?.length === 1 && initialPages[0] === currentPage` appears character-identically in 2 files — apps/web/src/components/LabelRegionsPanel.tsx, apps/web/src/components/ScaleRegionsPanel.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.
  • + 15 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×21
  • Silent fallback default in catch apps/desktop/src/folderDrive.ts:225 — `props` 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 apps/web/src/storage/fileStore.ts:52 — `readIndex` 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 apps/web/src/studio/drive/notices.ts:22 — `seen` 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 apps/web/src/storage/fileGroups.ts:21 — `load` 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 apps/web/src/fonts/fontList.ts:23 — `loadRecentFonts` 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 apps/web/src/fonts/systemFonts.ts:102 — `listSystemFonts` 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 apps/web/src/sheetsync/useSheetSync.ts:22 — `load` 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 apps/web/src/signatures/signatures.ts:22 — `load` 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 apps/web/src/assemblies/library.ts:9 — `loadLibrary` 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 apps/web/src/assemblies/proposals.ts:43 — `load` 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 apps/web/src/assemblies/countProposals.ts:49 — `load` 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 apps/web/src/measure/scalePresets.ts:23 — `loadPresets` 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 apps/web/src/components/HeaderFooterDialog.tsx:33 — `saved` 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 apps/web/src/documents/pki.ts:302 — `certificatesIn` 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 apps/web/src/spelling/spell.ts:23 — `personalWords` 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 apps/web/src/components/CompareDialog.tsx:46 — `saved` 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 apps/web/src/studio/roundtrip.ts:14 — `all` 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 apps/web/src/App.tsx:399 — `loadAuthor` swallows every exception into `return 'Me'` — 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 packages/markup/src/export.ts:223 — `embedInstalled` swallows every exception into `return 'unavailable'` — 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 packages/markup/src/pdfExtras.ts:111 — `readAssemblies` 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 packages/markup/test/compat/a3/measure.ts:19 — `rcLabel` 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.
D24 · Comment Value · redundant comment · ×7
  • redundant comment apps/web/src/App.tsx:1225 — "Bookmarks › Action…: the bookmark whose action is being set." repeats the code it sits on: 4 of its 4 words (bookmarks, action, bookmark, set) are already in `const [bookmarkAction, setBookmarkAction] = useState<string | null>(null);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment scripts/help/sections/05-measure.cjs:152 — "Bulk apply page scale." repeats the code it sits on: 4 of its 4 words (bulk, apply, page, scale) are already in `await h.run('Document', 'Bulk Apply Page Scale…');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment scripts/help/sections/07-tool-library.cjs:38 — "Tool set options." repeats the code it sits on: 3 of its 3 words (tool, set, options) are already in `const opts = page.locator('.panel.left button[title="Tool set options"]').nth(1);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment scripts/help/sections/07-tool-library.cjs:45 — "New set and import buttons." repeats the code it sits on: 4 of its 4 words (new, set, import, buttons) are already in `await h.mark([page.locator('.panel.left button[title="Create a new tool set"]'), page.locator('.panel.left [title^="Impo …`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment scripts/help/sections/08-pages-documents.cjs:66 — "Page labels from a region." repeats the code it sits on: 3 of its 3 words (page, labels, region) are already in `await h.run('Document', 'Page Labels', 'From Page Region…');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment scripts/help/sections/08-pages-documents.cjs:98 — "PDF content editing." repeats the code it sits on: 3 of its 3 words (pdf, content, editing) are already in `await h.menu('Edit', 'PDF Content');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment scripts/help/sections/10-forms-signatures.cjs:12 — "Auto-create fields." repeats the code it sits on: 3 of its 3 words (auto, create, fields) are already in `await h.run('Tools', 'Form', 'Auto-Create Fields…');`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D12 · Dependency Hygiene · Deprecated · ×6
  • Deprecated: boolean REDACTED:1372 — boolean 3.2.0 is resolved in REDACTED and is marked deprecated by its publisher: "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: glob REDACTED:1804 — glob 11.1.0 is resolved in REDACTED and is marked deprecated by its publisher: "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: glob REDACTED:1810 — glob 7.2.3 is resolved in REDACTED and is marked deprecated by its publisher: "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: inflight REDACTED:1885 — inflight 1.0.6 is resolved in REDACTED and is marked deprecated by its publisher: "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: lodash.isequal REDACTED:2186 — lodash.isequal 4.5.0 is resolved in REDACTED and is marked deprecated by its publisher: "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
  • Deprecated: rimraf REDACTED:2539 — rimraf 2.6.3 is resolved in REDACTED and is marked deprecated by its publisher: "Rimraf versions prior to v4 are no longer supported". This repository does not declare it — a direct dependency pulls it in, so the move is to upgrade or replace that dependency.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×6
  • Hand-rolled JSON/XML parsing via regex REDACTED:272 — 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 JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:275 — 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 JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:287 — 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 JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:345 — 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 JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:346 — 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 JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:652 — 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 JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
IC1 · Incompleteness & stubs · Disabled test · ×5
  • Disabled test e2e/specs/detach.spec.ts:13 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test e2e/specs/document.spec.ts:412 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test e2e/specs/dont-save.spec.ts:8 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test e2e/specs/fonts.spec.ts:8 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test e2e/specs/session-review.spec.ts:13 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
AX6 · Interface segregation · Fat interface · ×2
  • Fat interface: RedcolumnDesktop (26 required operations) apps/web/src/desktop/host.ts:84 — `RedcolumnDesktop` declares 26 required operations: `tokenForFile`, `pickOpen`, `pickSave`, `readToken`, `writeToken`, `showInFolder`, `forgetToken`, `takeLaunchFiles`, `onLaunchFiles`, `printPdf`, `beginPrint`, `addPrintPage`, `finishPrint`, `cancelPrint`, `checkForUpdates`, `updateState`, `onUpdateState`, `installUpdate`, `microsoftToken`, `graphRequest`, `microsoftAccount`, `signOut`, `assistantInfo`, `setAssistantEnabled`, `onAssistantCall`, `replyAssistant`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
  • Fat interface: CommandActions (163 required operations) apps/web/src/commands/appCommands.ts:49 — `CommandActions` declares 163 required operations: `open`, `newPdf`, `newFromTemplate`, `fromCamera`, `combine`, `close`, `closeAll`, `saveAll`, `revert`, `publish`, `share`, `markupsXfdf`, `markupsFdf`, `importMarkupsFromPdf`, `exportBax`, `importBax`, `save`, `saveAs`, `exportCsv`, `exportSummary`, `print`, `preferences`, `manageProfiles`, `migrateRevu`, `shortcuts`, `about`, `undo`, `redo`, `cut`, `copy`, `paste`, `pasteInPlace`, `multiply`, `deleteSelection`, `hideSelection`, `undoHistory`, `checkSpelling`, `sound`, `video`, `showHidden`, and 123 more. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×2
  • Projects may be oversized for their cohesion apps/web/package.json:1 — `apps/web` (96629 LoC, 947 module-visible types across 47 directories) overshoots its size bounds. 2 of 8 build unit(s) (npm) overshoot their size bounds, lowering Project Cohesion to 5.0/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 packages/markup/package.json:1 — `packages/markup` (17785 LoC, 210 module-visible types across 1 directories) overshoots its size bounds. 2 of 8 build unit(s) (npm) overshoot their size bounds, lowering Project Cohesion to 5.0/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.
X7 · Silent fallback defaults · Pending state with no failure state · ×2
  • Pending state with no failure state apps/web/src/components/SlowDrawingPrompt.tsx:263 — The view draws `… Stop` under `state . kind === 'working'`, but `state` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state apps/web/src/components/standardsWizard/CalloutStep.tsx:228 — The view draws `Looking through the set…` under `( running || ! run )`, but `run` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
D21 · Naming Consistency · `toJSON` spells `JSON` where 13 names in the project spell it `Json` · ×1
  • `toJSON` spells `JSON` where 13 names in the project spell it `Json` apps/desktop/src/allowlist.ts:54 — 13 of 14 names in project redcolumn spell the token `Json` (13 of 14; unit: names in project redcolumn containing `Json`). Peers: Props.onExportJson (apps/web/src/components/AssembliesDialog.tsx:27); geojson.parseGeoJson (apps/web/src/geospatial/geojson.ts:9); pack.tradePackToJson (apps/web/src/library/pack.ts:164); keys.sealedJsonBytes (apps/web/src/studio/crypto/keys.ts:100); SessionCrypto.sealJson (apps/web/src/studio/crypto/sessionCrypto.ts:156). Rename to `toJson`. [rule N6]
D21 · Naming Consistency · `AppendToCurrentPDF` spells `PDF` where 49 names in the project spell it `Pdf` · ×1
  • `AppendToCurrentPDF` spells `PDF` where 49 names in the project spell it `Pdf` apps/web/src/summary/bcf.ts:121 — 49 of 50 names in project redcolumn spell the token `Pdf` (49 of 50; unit: names in project redcolumn containing `Pdf`). Peers: pdf.writePdf (apps/web/src/cad/pdf.ts:64); CommandActions.newPdf (apps/web/src/commands/appCommands.ts:51); CommandActions.importMarkupsFromPdf (apps/web/src/commands/appCommands.ts:64); CommandActions.archivePdfA (apps/web/src/commands/appCommands.ts:181); LayersPanelProps.hiddenPdf (apps/web/src/components/LayersPanel.tsx:140). Rename to `AppendToCurrentPdf`. [rule N6]
D21 · Naming Consistency · `IncludeIDColumn` spells `ID` where 381 names in the project spell it `Id` · ×1
  • `IncludeIDColumn` spells `ID` where 381 names in the project spell it `Id` apps/web/src/summary/bcf.ts:132 — 381 of 382 names in project redcolumn spell the token `Id` (381 of 382; unit: names in project redcolumn containing `Id`). Peers: SavedAuth.clientId (apps/desktop/src/auth.ts:17); auth.readSaved(clientId) (apps/desktop/src/auth.ts:52); DesktopAuth.microsoftAccount(clientId) (apps/desktop/src/auth.ts:93); DesktopAuth.microsoft(clientId) (apps/desktop/src/auth.ts:99); DesktopAuth.refreshMicrosoft(clientId) (apps/desktop/src/auth.ts:151). Rename to `IncludeIdColumn`. [rule N6]
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
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
IC1 · Incompleteness & stubs · Empty method body · ×1
  • Empty method body apps/web/src/studio/projects/store.ts:29 — `authorize` has an empty body — confirm it's an intentional no-op and not an unfinished method.
M2 · Architecture documentation · ADRs not easily discoverable · ×1
  • ADRs not easily discoverable — 1 ADR-shaped document(s) detected by content — `docs/dwg-import-plan.md`. They are not under a conventional ADR folder (docs/adr/) and are not named NNNN-title.md, and this check found them by their decision signature rather than by where they live — so a reader who does not already know these paths has no route to them. Detected by content signature only: records kept outside the repository, or written without a Status/Decision/Consequences shape, are not visible to this check and are not counted here.
P3 · Security & performance tooling · Dependabot does not watch npm · ×1
  • Dependabot does not watch npm REDACTED:4 — `REDACTED` schedules updates, but no `package-ecosystem` entry covers `npm`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list.
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 'APP_ORIGIN' · ×1
  • Unused export 'APP_ORIGIN' apps/desktop/src/navigation.ts:2 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'assemblyName' · ×1
  • Unused export 'assemblyName' apps/web/src/assemblies/quantities.ts:243 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'headerStr' · ×1
  • Unused export 'headerStr' apps/web/src/cad/drawing.ts:167 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'mapPath' · ×1
  • Unused export 'mapPath' apps/web/src/cad/geom.ts:64 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ExportDialog' · ×1
  • Unused export 'ExportDialog' apps/web/src/components/ExportDialog.tsx:713 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'PlaceholderPanel' · ×1
  • Unused export 'PlaceholderPanel' apps/web/src/components/SidePanels.tsx:6 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'ViewportMethod' · ×1
  • Unused export 'ViewportMethod' apps/web/src/desktop/assistantViewports.ts:13 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'MAX_SEGMENTS' · ×1
  • Unused export 'MAX_SEGMENTS' apps/web/src/geospatial/model.ts:35 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'canHandleFiles' · ×1
  • Unused export 'canHandleFiles' apps/web/src/offline/launch.ts:39 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'canPickFiles' · ×1
  • Unused export 'canPickFiles' apps/web/src/storage/diskHandles.ts:33 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'adoptProject' · ×1
  • Unused export 'adoptProject' apps/web/src/studio/projects/store.ts:122 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'sameColumn' · ×1
  • Unused export 'sameColumn' apps/web/src/summary/bcf.ts:570 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused module-local declaration 'when' · ×1
  • Unused module-local declaration 'when' apps/web/src/components/ProjectsPanel.tsx:60 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'toLocalInput' · ×1
  • Unused module-local declaration 'toLocalInput' apps/web/src/components/sessions/SessionDialogs.tsx:29 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code · Unused module-local declaration 'Markup' · ×1
  • Unused module-local declaration 'Markup' apps/web/src/studio/drive/DriveSession.test.ts:305 — This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
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 10/18 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.
X5 · Nullable reference types · Null assertions (`!`) override strict null checking · ×1
  • Null assertions (`!`) override strict null checking — ~23.5 `!` null assertions per 1k TypeScript source lines — 3191 assertion(s) across the 135537 source line(s) of the 507 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: apps/web/src/markup/MarkupTools.ts (170), apps/web/src/App.tsx (151), packages/pdf-core/src/worker.ts (137). 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 — 11 finding(s)
D12 · Dependency Hygiene · Outdated (npm) · ×6
  • Outdated (npm): @azure/msal-browser — @azure/msal-browser is pinned at 5.23.0; registry.npmjs.org publishes 5.29.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): electron-updater — electron-updater is pinned at 6.8.9; registry.npmjs.org publishes 6.8.11 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): node-forge — node-forge is pinned at 1.4.2; registry.npmjs.org publishes 1.4.3 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): react — react is pinned at 19.3.0; registry.npmjs.org publishes 19.3.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): react-dom — react-dom is pinned at 19.3.0; registry.npmjs.org publishes 19.3.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): yjs — yjs is pinned at 13.6.32; registry.npmjs.org publishes 13.6.33 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
D10 · Test Quality · Skipped (documented) · ×3
  • Skipped (documented): (unnamed test) e2e/support/driver.ts:192 — 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) e2e/support/globals.d.ts:23 — 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): a link out of the font folder is refused apps/desktop/src/fonts.test.ts:50 — Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
D24 · Comment Value · doc comments repeat the names · ×2
  • doc comments repeat the names packages/markup/src/estimating.ts:35 — 0 of 0 documented parameters and 1 of 1285 summaries in `@nb/markup` only repeat the member or parameter name (e.g. "What it costs per unit." for `unitCost`). Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names apps/web/src/cad/sheets.ts:21 — 0 of 0 documented parameters and 2 of 4235 summaries in `@nb/web` only repeat the member or parameter name (e.g. "The ratio N of 1:N." for `ratio`). 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-0e1ef29a4ebd495ab6691b0f264a6af9/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=576" --report-format json --report-path /tmp/watchdog-gitleaks-0e1ef29a4ebd495ab6691b0f264a6af9/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.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-0e1ef29a4ebd495ab6691b0f264a6af9/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/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 .12artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .11artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 11 file(s) — `apps/desktop/src/token-ipc.ts`, `apps/web/src/App.tsx`, `apps/web/src/compare/compare.worker.ts`, `apps/web/src/compare/semantic.ts`, `apps/web/src/compare/semanticStore.ts`, … (+6 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 01a1e616-1f60-7029-a3a5-ee3c62c3ceb0 · 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