Public report of mozilla/pdf.js, published 26 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 26 October 2026, 18:36 UTC · Survey ID cd_31b89b79720d43c8b2b14b4d57f00306
mozilla/pdf.js
Measured 26 October 2026, 18:27 UTC, at code version f99d131
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
Down 3 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 169,829 lines of product code in 8 projects, tests not counted · Estimated rebuild effort: about 1.5 person-years · Weakest lens: Accessibility, 28
Findings by how serious they are
57 critical1594 serious50 minor
12 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
26 October 2026, 18:27 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
74of 74 dimensions measured by tools.
1679of 1701 findings point to an exact file and line, so you can open each one in the code. The other 22 concern the repository as a whole, such as missing documentation.
74dimensions across 7 lenses, read from 169,829 lines of product code in 8 projects.
mozilla/pdf.js falls short of our standard for production, in part because it has pages that don't say their language. It scores 37 out of 100 and is rated Weak, and three of its 57 critical findings are leaked passwords or keys.
Accessibility, at 28, 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 4 points. Making the controls keyboard-usable would lift Accessibility itself, also worth about 4. Raising Accessibility to 70 would lift the score to about 44.
Two passwords or keys in the code's history and one in the code are open to anyone who can read the repository. Thirty-five buttons or links have no name a screen reader can say, and five form fields can't be read by a screen reader. Replacing each exposed password or key, naming the buttons and links, and labelling the form fields would close these risks. Correcting the ARIA markup, or using the native HTML element would take care of the five pieces of wrong accessibility markup.
The product code is 169,829 lines, about €210,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Accessibility rose from 28 to 70, the lowest score rated Strong, the score would rise from 37 to about 44.
Code composition: what the lines of code are
Product code 68%Tests 32%
New since the last survey: 189 findings
These 189 critical or serious findings weren't in the previous survey, on 12 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 538 findings
These 538 critical or serious findings were in the previous survey, on 12 October 2026, and are gone from this one. The first 100 are listed here.
€71,000 to €360,000, for 1,179 to 3,739 hours of work, about 1.5 person-years for 1 to 3 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 37. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 169,829 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 3 points · Medium effort · Large Files
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 €210,000 to build again, about 1.5 person-years of work. Its weakest lens is Accessibility, at 28 (Weak). Accessibility is about whether the interface is built so that everyone can use it, including people who can't see the screen or can't use a mouse. Because the weakest lens counts most in the score, work on Accessibility also moves the score most.
Based on: the rebuild estimate · the Accessibility grade · how much each lens counts
What to do: Start with the Accessibility actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 4 points for low effort, because it clears the 1 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
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.4 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 9% on every change. The history of the code shows how much it changes: about 58,743 lines over the last 90 days, which is about 238,236 lines a year. At that pace, the extra work comes to an estimated 24 to 144.1 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
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.
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.
275 modules, with 81 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; 235 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.
src.core.dataset_reader uses src.core.xml_parser, so a change to src.core.xml_parser can break src.core.dataset_reader, while a change to src.core.dataset_reader can't break src.core.xml_parser.
Position
Below the diagonal: src.core.dataset_reader uses a module listed above it, which is the healthy direction.
src.core.decode_stream uses src.core.base_stream, so a change to src.core.base_stream can break src.core.decode_stream, while a change to src.core.decode_stream can't break src.core.base_stream.
Position
Below the diagonal: src.core.decode_stream uses a module listed above it, which is the healthy direction.
src.core.stream uses src.core.base_stream, so a change to src.core.base_stream can break src.core.stream, while a change to src.core.stream can't break src.core.base_stream.
Position
Below the diagonal: src.core.stream uses a module listed above it, which is the healthy direction.
src.display.dom_canvas_factory uses src.display.canvas_factory, so a change to src.display.canvas_factory can break src.display.dom_canvas_factory, while a change to src.display.dom_canvas_factory can't break src.display.canvas_factory.
Position
Below the diagonal: src.display.dom_canvas_factory uses a module listed above it, which is the healthy direction.
src.display.editor.draw uses src.display.editor.editor, so a change to src.display.editor.editor can break src.display.editor.draw, while a change to src.display.editor.draw can't break src.display.editor.editor.
Position
Below the diagonal: src.display.editor.draw uses a module listed above it, which is the healthy direction.
src.display.editor.drawers.freedraw uses src.display.editor.drawers.outline, so a change to src.display.editor.drawers.outline can break src.display.editor.drawers.freedraw, while a change to src.display.editor.drawers.freedraw can't break src.display.editor.drawers.outline.
Position
Below the diagonal: src.display.editor.drawers.freedraw uses a module listed above it, which is the healthy direction.
src.display.editor.drawers.inkdraw uses src.display.editor.drawers.outline, so a change to src.display.editor.drawers.outline can break src.display.editor.drawers.inkdraw, while a change to src.display.editor.drawers.inkdraw can't break src.display.editor.drawers.outline.
Position
Below the diagonal: src.display.editor.drawers.inkdraw uses a module listed above it, which is the healthy direction.
src.display.node_utils uses src.display.canvas_factory, so a change to src.display.canvas_factory can break src.display.node_utils, while a change to src.display.node_utils can't break src.display.canvas_factory.
Position
Below the diagonal: src.display.node_utils uses a module listed above it, which is the healthy direction.
src.display.node_utils uses src.display.filter_factory, so a change to src.display.filter_factory can break src.display.node_utils, while a change to src.display.node_utils can't break src.display.filter_factory.
Position
Below the diagonal: src.display.node_utils uses a module listed above it, which is the healthy direction.
web.base_pdf_page_view uses web.renderable_view, so a change to web.renderable_view can break web.base_pdf_page_view, while a change to web.base_pdf_page_view can't break web.renderable_view.
Position
Below the diagonal: web.base_pdf_page_view uses a module listed above it, which is the healthy direction.
web.chromecom uses web.external_services, so a change to web.external_services can break web.chromecom, while a change to web.chromecom can't break web.external_services.
Position
Below the diagonal: web.chromecom uses a module listed above it, which is the healthy direction.
web.chromecom uses web.preferences, so a change to web.preferences can break web.chromecom, while a change to web.chromecom can't break web.preferences.
Position
Below the diagonal: web.chromecom uses a module listed above it, which is the healthy direction.
web.firefoxcom uses web.base_download_manager, so a change to web.base_download_manager can break web.firefoxcom, while a change to web.firefoxcom can't break web.base_download_manager.
Position
Below the diagonal: web.firefoxcom uses a module listed above it, which is the healthy direction.
web.firefoxcom uses web.external_services, so a change to web.external_services can break web.firefoxcom, while a change to web.firefoxcom can't break web.external_services.
Position
Below the diagonal: web.firefoxcom uses a module listed above it, which is the healthy direction.
web.firefoxcom uses web.preferences, so a change to web.preferences can break web.firefoxcom, while a change to web.firefoxcom can't break web.preferences.
Position
Below the diagonal: web.firefoxcom uses a module listed above it, which is the healthy direction.
web.genericcom uses web.external_services, so a change to web.external_services can break web.genericcom, while a change to web.genericcom can't break web.external_services.
Position
Below the diagonal: web.genericcom uses a module listed above it, which is the healthy direction.
web.genericcom uses web.preferences, so a change to web.preferences can break web.genericcom, while a change to web.genericcom can't break web.preferences.
Position
Below the diagonal: web.genericcom uses a module listed above it, which is the healthy direction.
src.core.ascii_85_stream uses src.core.decode_stream, so a change to src.core.decode_stream can break src.core.ascii_85_stream, while a change to src.core.ascii_85_stream can't break src.core.decode_stream.
Position
Below the diagonal: src.core.ascii_85_stream uses a module listed above it, which is the healthy direction.
src.core.ascii_hex_stream uses src.core.decode_stream, so a change to src.core.decode_stream can break src.core.ascii_hex_stream, while a change to src.core.ascii_hex_stream can't break src.core.decode_stream.
Position
Below the diagonal: src.core.ascii_hex_stream uses a module listed above it, which is the healthy direction.
src.core.binary_cmap uses src.core.stream, so a change to src.core.stream can break src.core.binary_cmap, while a change to src.core.binary_cmap can't break src.core.stream.
Position
Below the diagonal: src.core.binary_cmap uses a module listed above it, which is the healthy direction.
src.core.brotli_stream uses src.core.decode_stream, so a change to src.core.decode_stream can break src.core.brotli_stream, while a change to src.core.brotli_stream can't break src.core.decode_stream.
Position
Below the diagonal: src.core.brotli_stream uses a module listed above it, which is the healthy direction.
src.core.ccitt_stream uses src.core.decode_stream, so a change to src.core.decode_stream can break src.core.ccitt_stream, while a change to src.core.ccitt_stream can't break src.core.decode_stream.
Position
Below the diagonal: src.core.ccitt_stream uses a module listed above it, which is the healthy direction.
src.core.chunked_stream uses src.core.stream, so a change to src.core.stream can break src.core.chunked_stream, while a change to src.core.chunked_stream can't break src.core.stream.
Position
Below the diagonal: src.core.chunked_stream uses a module listed above it, which is the healthy direction.
src.core.decrypt_stream uses src.core.decode_stream, so a change to src.core.decode_stream can break src.core.decrypt_stream, while a change to src.core.decrypt_stream can't break src.core.decode_stream.
Position
Below the diagonal: src.core.decrypt_stream uses a module listed above it, which is the healthy direction.
src.display.editor.drawers.highlight uses src.display.editor.drawers.outline, so a change to src.display.editor.drawers.outline can break src.display.editor.drawers.highlight, while a change to src.display.editor.drawers.highlight can't break src.display.editor.drawers.outline.
Position
Below the diagonal: src.display.editor.drawers.highlight uses a module listed above it, which is the healthy direction.
src.display.editor.drawers.highlight uses src.display.editor.drawers.freedraw, so a change to src.display.editor.drawers.freedraw can break src.display.editor.drawers.highlight, while a change to src.display.editor.drawers.highlight can't break src.display.editor.drawers.freedraw.
Position
Below the diagonal: src.display.editor.drawers.highlight uses a module listed above it, which is the healthy direction.
src.display.editor.ink uses src.display.editor.draw, so a change to src.display.editor.draw can break src.display.editor.ink, while a change to src.display.editor.ink can't break src.display.editor.draw.
Position
Below the diagonal: src.display.editor.ink uses a module listed above it, which is the healthy direction.
src.display.editor.signature uses src.display.editor.draw, so a change to src.display.editor.draw can break src.display.editor.signature, while a change to src.display.editor.signature can't break src.display.editor.draw.
Position
Below the diagonal: src.display.editor.signature uses a module listed above it, which is the healthy direction.
src.display.editor.signature uses src.display.editor.ink, so a change to src.display.editor.ink can break src.display.editor.signature, while a change to src.display.editor.signature can't break src.display.editor.ink.
Position
Below the diagonal: src.display.editor.signature uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 31% · Weak · gated by D1, D2, R1, R3 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
48
Medium
A03:2025 — Software Supply Chain Failures
5
Medium
A07:2025 — Authentication Failures
4
High / Critical
Roadmap
Immediately resolve the leaked secret in REDACTED and ensure all custom controls are fully keyboard-operable with proper semantic attributes. Next, split the largest source files into smaller, focused modules to improve maintainability and migrate the remaining plain JavaScript files to TypeScript for stronger type safety. Finally, correct the page structure by adding essential landmarks and language declarations, and remove obsolete meta-refresh tags to ensure a robust and accessible user experience.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
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.
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 — 57
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 — 1594
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 — 50
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 12
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 74 of 74 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.8 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 74 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 1679 of 1701 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 2,466 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 1 test source file(s) (.py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability not scored — the JavaScript/TypeScript suite (vitest via `npm ci --ignore-scripts` in the repository root (0 tests)) ran but surfaced no test cases to the runner, so flakiness couldn't be exercised.
D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 1 production npm declaration(s) across 3 package.json (1 of them the product) were read for PINNING discipline (0 defect(s) reported), but the outdated/deprecated signal needs registry.npmjs.org, and no committed lockfile here resolves to the concrete versions that question is asked about, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — this repository's committed lockfile was read and it resolves no production dependency: everything it installs is declared under `devDependencies`, or is a workspace-internal package with no registry release behind it. Licences are resolved from registry.npmjs.org, because an npm checkout does not contain its dependencies' licences. NOT a finding that this repository's licences are compliant: this dimension asserts nothing about its licensing in either direction.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D20 ADR Quality — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The ADR expectation is gated on whether a repository ships a deployable product. Our repo-kind classifier reads .NET project files and the host and package markers of the other ecosystems it knows (a Go `package main`, a Cargo binary, a package.json `bin`, `start` script or application dev server such as Vite or Next, Python console scripts or a Django/WSGI entry point, a Spring Boot / WAR / Gradle application build, a Rack or Rails app, a Composer project, an OTP release or escript, a Dockerfile, a Procfile, a Platform.sh `.platform/routes.yaml`, and the corresponding published-package manifests, including an OTP `*.app.src`, a Drupal module's `*.info` and a Claude Code `.claude-plugin/plugin.json`), and found none here, so we could not tell what kind of repository this is and did not assess its ADR log. This is a gap in our analyzer, not a finding about this repository.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict. For npm the surface is what a published package.json's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `REDACTED`, `src/core/worker.js`, `src/display/api.js`, `src/display/renderer_worker.js`, `src/scripting_api/app.js`, … (+5 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D44 Platform End-of-Life — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a Dockerfile) is simply not read here yet.
AC2 Forms & labels — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 2 further occurrence(s) are not listed individually; the score already reflects all 42.
AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Subject: 8 markup document(s) — HTML, Razor, JSX, Vue, Svelte or server templates. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, a Dockerfile, an npm dev script, a web service's own toolchain entry point (cargo, go, dotnet, Python, Spring Boot), or an Android app's own Gradle wrapper (run on an emulator); an Apple or Flutter app needs a host it lacks. None applied, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
IC1 Incompleteness & stubs — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 37 further occurrence(s) are not listed individually; the score already reflects all 77.
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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 333 further occurrence(s) are not listed individually; the score already reflects all 373.
R3 Large Files — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 68 further occurrence(s) are not listed individually; the score already reflects all 108.
R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 54 further occurrence(s) are not listed individually; the score already reflects all 94.
S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 330 JavaScript/TypeScript file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled certificate validation and obsolete TLS versions, and none was found. The server controls this dimension also scores were not assessed, so no score is given.
X3 Exception handling — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 26 further occurrence(s) are not listed individually; the score already reflects all 66.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, PHP, Dart, Ruby, Scala and Rust source only, and no C# was loaded, and 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: 18 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
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.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
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.
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.
545 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was PartialEvaluator.getOperatorList at 140. A further 19 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 Lexer.next at 36 — they are counted neither in the figure above nor in this dimension's score. 6 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: src/core/xfa/formcalc_lexer.js (next at 36), src/core/xfa/formcalc_lexer.js (Lexer.next at 36), src/scripting_api/app.js (#getLanguage at 17), src/scripting_api/app.js (App.#getLanguage at 17), src/display/editor/draw.js (#rotateBox at 16), and 1 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 281 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with PartialEvaluator.getOperatorList (cyclomatic 140). — Refactoring it lifts Cyclomatic Complexity from 3.9 to about 4.2/10.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 454 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 99 bodies over 60 down to 60 or less in Cognitive Complexity — start with PartialEvaluator.getOperatorList (cognitive 242), checkAndRepair (cognitive 188), getOperatorList::promiseBody (cognitive 187). — 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 99 together lifts Cognitive Complexity from 2.0 to about 4.1/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes6.7 / 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.
Resolve the 74 MethodTooLong finding(s) in God Classes — start with evaluator.js (6), template.js (5), REDACTED (5). — One of this dimension's main actionable groups (74 warning-level).
Resolve the 57 FileTooLong finding(s) in God Classes — start with template.js, glyphlist.js, evaluator.js. — One of this dimension's main actionable groups (57 warning-level).
Resolve the 41 ClassTooLong finding(s) in God Classes — start with annotation.js (3), document.js (2), annotation_layer.js (2). — One of this dimension's main actionable groups (41 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
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.
8 production modules (source-import), 0 dependency cycle(s), 0 unstable depended-on module(s). No manifest declares this repository's modules, so the modules are its top-level source directories and the edges the imports between them, and main-sequence distance (abstractness) is not computed for these modules yet.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 10 Low cohesion finding(s) in Cohesion (LCOM4) — start with xfa_object.js, annotation.js, highlight.js. — One of this dimension's main actionable groups (10 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
2466 test methods: 1896 unit, 570 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 2466 `it`/`test` case(s) across 109 test file(s) declaring at least one; its tier split is read from package names and paths only.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality8.7 / 10Strong✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
1 skipped (1 with a documented reason), 207 zero-assertion, 7 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 2466 tests. Measured on the JavaScript/TypeScript suite only — at least 1 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: destroys the document before the renderer worker is ready · ×207test/unit/api_spec.js:1336
Fixed-sleep synchronisation: cancels and cleans up before the renderer worker is ready · ×7test/unit/api_spec.js:1264
Resolve the 207 No assertions finding(s) in Test Quality — start with highlight_editor_spec.mjs (37), freetext_editor_spec.mjs (19), reorganize_pages_spec.mjs (19). — One of this dimension's main actionable groups (207 warning-level).
Resolve the 7 Fixed-sleep synchronisation finding(s) in Test Quality — start with message_handler_spec.js (6), api_spec.js. — One of this dimension's main actionable groups (7 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: 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.
Top hotspots: src/core/fonts.js (30×345=10350); src/core/evaluator.js (20×187=3740); src/display/api.js (40×66=2640) Repeated repair below the complexity floor: test/integration/reorganize_pages_spec.mjs (5 of 8 changes were fixes); web/firefoxcom.js (4 of 6 changes were fixes)
Resolve the 38 Hotspot finding(s) in Churn × Complexity Hotspots — start with fonts.js, evaluator.js, api.js. — One of this dimension's main actionable groups (38 warning-level).
Resolve the 2 Repeated repair finding(s) in Churn × Complexity Hotspots — start with reorganize_pages_spec.mjs, firefoxcom.js. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.2 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
45 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/core/parser.js. Counted over 264 of the 326 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×2
What to do
Resolve the 2 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
0 deducted task-comment markers across 0 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.
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.
1 of 1 build units (npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
51 finding(s): 0 critical, 0 high, 51 medium, 0 low. semgrep hit a parse error in 13 file(s) — `external/brotli/decode.js`, `REDACTED`, `external/openjpeg/openjpeg_nowasm_fallback.js`, `src/core/metrics.js`, `src/core/worker.js` (lines 69–70, line 84, line 1128), … (+8 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 3 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
What to do
Resolve the 29 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (9), REDACTED (6), REDACTED (4). — One of this dimension's main actionable groups (29 warning-level).
Resolve the 8 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED, REDACTED. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
7 of 264 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/core/xfa/formcalc_parser.js. Counted over 264 of the 326 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with formcalc_parser.js. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 6 Orphaned file finding(s) in Knowledge Freshness — start with REDACTED, REDACTED, formcalc_lexer.js. — One of this dimension's main actionable groups (6 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 3 Change coupling finding(s) in Change Coupling — start with renderer_worker.js, obj_bin_transform_core.js, annotation_layer_builder.js. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether 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.
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.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
No dependency in any ecosystem this repository declares is published as malicious.
✓ On the Gold path — maintain.
Detailed fixes: d43_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC2 · Forms & labels3.3 / 10Weak✓ 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.
A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×33) — web/viewer-geckoview.html:107, web/viewer-geckoview.html:127, web/viewer-geckoview.html:130, …
This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×5) — web/viewer-snippet-chrome-overlays.html:17, web/viewer.html:376, web/viewer.html:401, …
A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. (×2) — web/viewer.html:1034, web/viewer.html:1104
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.
Do you agree with this assessment?
AC3 · Page structure3.2 / 10Weak✓ 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.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×3) — extensions/chromium/options/options.html:17, web/viewer-geckoview.html:23, web/viewer.html:23
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×4) — extensions/chromium/options/options.html:17, web/internal/debugger.html:17, web/viewer-geckoview.html:23, …
user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta. (×2) — web/viewer-geckoview.html:26, web/viewer.html:26
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.
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".
An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action. (×2) — web/viewer-snippet-chrome-overlays.html:9, web/viewer.html:1201
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. — web/viewer.html:141
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
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.
Abstract roles exist only to organise the ARIA taxonomy and must never be used in markup. Use a concrete role. (×5) — web/viewer.html:1016, web/viewer.html:1092, web/viewer.html:1141, …
aria-hidden="true" hides the element from assistive tech but leaves it keyboard-focusable — a confusing dead stop. Remove aria-hidden or make the element non-focusable. (×2) — web/viewer.html:1212, web/viewer.html:1259
What to do
Use valid, non-abstract roles, supply the ARIA state each role requires, and never put aria-hidden on a focusable element.
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.
`.annotationEditorLayer .freeTextEditor .internal: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. — web/annotation_editor_layer_builder.css:624
`.annotationEditorLayer .highlightEditor` 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. — web/annotation_editor_layer_builder.css:1242
`.commentPopup: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. — web/comment_manager.css:623
`#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer .toolbarAddSignatureButton` 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. — web/signature_manager.css:685
`#viewerContainer` 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. (×2) — web/viewer-geckoview.css:81, web/viewer.css:369
`#floatingToolbar .toolbarButton` 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. — web/viewer-geckoview.css:139
`.toolbarButton` 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. — web/viewer.css:945
`.dropdownToolbarButton > select` 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. — web/viewer.css:1618
`.dropdownToolbarButton > select: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. — web/viewer.css:1698
`.dropdownToolbarButton` 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. — web/viewer.css:1600
`#viewsManager #viewsManagerContent #thumbnailsView > .thumbnail > .thumbnailImageContainer.draggingThumbnail.multiple > .thumbnailImageContainer` 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. — web/views_manager.css:969
`#signaturePropertiesButton.state-loading .loadingDot` moves (`animation: signaturePropertiesDot 1.2s ease-in-out infinite both`) 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. — web/digital_signature_properties.css:193
`.sigCard .subSignatures > summary::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. — web/digital_signature_properties.css:461
`#toolbarContainer #loadingBar .progress` moves (`transition: transform 200ms`) 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. — web/viewer.css:1806
`#toolbarContainer #loadingBar.indeterminate .progress .glimmer` moves (`animation: progressIndeterminate 1s 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. — web/viewer.css:1829
`.pdfViewer .page .loadingIcon` moves (`animation: 1s steps(10, end) 0s normal none infinite moveDefault`) 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. — examples/mobile-viewer/viewer.css:169
`#loadingBar .progress` moves (`transition: transform 200ms`) 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. — examples/mobile-viewer/viewer.css:206
`#loadingBar.indeterminate .progress .glimmer` moves (`animation: progressIndeterminate 2s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — examples/mobile-viewer/viewer.css:241
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.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no a11y linter (an a11y linter that can read your UI — no component framework was detected, so the JSX/Vue ESLint plugins would have nothing to lint; use an HTML-template a11y linter (html-eslint, htmlhint) or run axe/pa11y over the rendered pages) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 8 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain: add an a11y linter that can read your UI — no component framework was detected, so the JSX/Vue ESLint plugins would have nothing to lint; use an HTML-template a11y linter (html-eslint, htmlhint) or run axe/pa11y over the rendered pages, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
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.
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.
`countUpdatesAfter` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — src/core/editor/pdf_editor.js:115
`scale` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — src/core/glyf.js:692
`#updateParentTag` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/core/struct_tree.js:588
`updateAcroform` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/core/writer.js:305
`markPoint` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — REDACTED:4323
`markPointProps` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — REDACTED:4327
`beginCompat` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — REDACTED:4360
`endCompat` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — REDACTED:4364
`getSimpleIndex` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — src/display/canvas_dependency_tracker.js:404
`#setState` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/display/editor/alt_text.js:247
`addButtonBefore` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — src/display/editor/toolbar.js:242
`isEnabledFor` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. (×2) — web/chromecom.js:451, web/genericcom.js:84
`guess` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — web/chromecom.js:455
`#save` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — web/comment_manager.js:805
`shouldSkip` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — web/debugger.mjs:654
`render` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — web/draw_layer_builder.js:54
`dispatchEventInSandbox` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — web/firefoxcom.js:299
`destroySandbox` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — web/firefoxcom.js:303
`#cancelAllRequests` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — web/firefoxcom.js:427
Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition. — web/firefoxcom.js:623
`initCom` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — web/genericcom.js:29
`MLManager` has 5 unfinished members out of 5 declared members (methods and accessors, whether or not each carries a body) — a scaffolded class that was never implemented. — web/genericcom.js:77
`deleteModel` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — web/genericcom.js:88
`isReady` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — web/genericcom.js:92
`guess` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — web/genericcom.js:96
`toggleService` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — web/genericcom.js:98
`deleteModel` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — web/genericcom.js:121
`loadModel` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — web/genericcom.js:126
`viewCertificate` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — web/genericcom.js:200
`#toggleGuessAltText` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — web/new_alt_text_manager.js:210
`register` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — web/overlay_manager.js:32
`close` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. (×3) — web/overlay_manager.js:73, web/password_prompt.js:92, web/pdf_document_properties.js:187
`#update` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — web/signature_manager.js:1072
`Toolbar` has 4 unfinished members out of 6 declared members (methods and accessors, whether or not each carries a body) — a scaffolded class that was never implemented. — web/toolbar-geckoview.js:23
`setPageNumber` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — web/toolbar-geckoview.js:67
`setPagesCount` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — web/toolbar-geckoview.js:69
`setPageScale` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — web/toolbar-geckoview.js:71
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.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
No logging call was found in the 332 JavaScript/TypeScript production file(s) this check read across 1 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.
Consider OpenTelemetry tracing/metrics (@opentelemetry/sdk-node) and a health-check endpoint (@godaddy/terminus or a /health route) for operability.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Dependabot is configured but does not watch `npm` — add that `package-ecosystem` entry to .github/dependabot.yml 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.
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.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
`fs.existsSync` in `downloadLanguageFiles` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — external/importL10n/locales.mjs:63
`fs.mkdirSync` in `downloadLanguageFiles` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — external/importL10n/locales.mjs:64
`fs.writeFileSync` in `downloadLanguageFiles` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — external/importL10n/locales.mjs:80
`fs.readdirSync` in `downloadL10n` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — external/importL10n/locales.mjs:95
`fs.lstatSync` in `downloadL10n` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — external/importL10n/locales.mjs:97
`fs.rmSync` in `downloadL10n` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — external/importL10n/locales.mjs:104
`fs.existsSync` in `callback to manifest.filter` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/downloadutils.mjs:51
`fs.readFileSync` in `callback to map` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/downloadutils.mjs:54
`fs.existsSync` in `verifyManifestFiles` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — test/downloadutils.mjs:84, test/downloadutils.mjs:92
`fs.writeFileSync` in `translateFont` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/font/ttxdriver.mjs:47
`fs.unlinkSync` in `translateFont` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — test/font/ttxdriver.mjs:58, test/font/ttxdriver.mjs:66
`fs.existsSync` in `translateFont` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/font/ttxdriver.mjs:62
`fs.readFileSync` in `translateFont` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/font/ttxdriver.mjs:65
`fs.writeFileSync` in `finalize` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — test/test.mjs:291, test/test.mjs:294
`fs.existsSync` in `setup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — test/test.mjs:333, test/test.mjs:338, test/test.mjs:341
`fs.unlinkSync` in `setup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/test.mjs:339
`fs.rmSync` in `setup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/test.mjs:342
`fs.existsSync` in `checkRefsTmp` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/test.mjs:425
`fs.rmSync` in `checkRefsTmp` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/test.mjs:427
`fs.rmSync` in `reader.question("SHOULD THIS SCRIPT REMOVE tmp/? THINK CAREFULLY [yn] ")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/test.mjs:439
`fs.existsSync` in `callback to roundResults.forEach` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/test.mjs:804
`fs.mkdtempSync` in `startBrowser` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/test.mjs:1094
`execSync` in `startBrowsers` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/test.mjs:1238
`fs.writeFileSync` in `writeCoverageData` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/test.mjs:1430
`fs.rmSync` in `closeSession` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/test.mjs:1481
`fs.statSync` in `#serveDirectoryIndex` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — test/webserver.mjs:264
What to do
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ 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.
2 typed · 456 plain JS — the untyped files are extensions/chromium/background.js, REDACTED, extensions/chromium/extension-router.js, extensions/chromium/options/migration.js, extensions/chromium/options/options.js, REDACTED (+450 more).
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): 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. Deterministic.
17 duplicated blocks under the repository root have copies in at least two of the sibling directories src, web — 7 of them are reported below, and 10 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 17 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 17 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 17 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. — src/pdf.js:103
12 duplicated blocks under src/ have copies in at least two of the sibling directories core, display, scripting_api, shared — 5 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 12 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 12 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 12 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. — src/core/document.js:95
src/core/metrics.js:29 · src/core/metrics.js:347 · src/core/metrics.js:665 — all 3 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. — src/core/metrics.js:29
src/core/metrics.js:1301 · src/core/metrics.js:1619 · src/core/metrics.js:1937 · src/core/metrics.js:2255 — all 4 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. — src/core/metrics.js:1301
src/core/metrics.js:477 · src/core/metrics.js:795 — 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. — src/core/metrics.js:477
src/core/metrics.js:364 · src/core/metrics.js:682 — 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. — src/core/metrics.js:364
REDACTED:39 · web/pdf_print_service.js:43 — the two spans are one implementation copied and then locally edited — 427 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. — REDACTED:39
src/display/canvas_dependency_tracker.js:518 · src/display/canvas_dependency_tracker.js:872 — the two spans are one implementation copied and then locally edited — 254 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. — src/display/canvas_dependency_tracker.js:518
src/pdf.js:103 · web/pdfjs.js:16 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents. — src/pdf.js:103
src/display/network.js:245 · src/display/transport_stream.js:165 — the two spans are one implementation copied and then locally edited — 359 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. — src/display/network.js:245
external/builder/test-fixtures.mjs:5 · external/builder/test-fixtures_babel.mjs:5 — the two spans are one implementation copied and then locally edited — 301 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. — external/builder/test-fixtures.mjs:5
src/display/editor/freetext.js:76 · src/display/editor/tools.js:926 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — src/display/editor/freetext.js:76
src/core/evaluator.js:2069 · src/core/evaluator.js:2108 — 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. — src/core/evaluator.js:2069
src/core/postscript/js_evaluator.js:87 · src/core/postscript/wasm_compiler.js:342 — the two spans are one implementation copied and then locally edited — 149 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. — src/core/postscript/js_evaluator.js:87
web/pdf_layer_viewer.js:133 · web/pdf_outline_viewer.js:224 — the two spans are one implementation copied and then locally edited — 223 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. — web/pdf_layer_viewer.js:133
src/display/fetch_stream.js:127 · src/display/node_stream.js:86 — the two spans are one implementation copied and then locally edited — 229 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. — src/display/fetch_stream.js:127
gulpfile.mjs:887 · gulpfile.mjs:1139 — 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. — gulpfile.mjs:887
src/core/xfa/locale_set.js:66 · src/core/xfa/locale_set.js:133 — all 2 copies are in the same file, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited. — src/core/xfa/locale_set.js:66
src/core/binary_cmap.js:221 · src/core/binary_cmap.js:266 — the two spans are one implementation copied and then locally edited — 199 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. — src/core/binary_cmap.js:221
src/core/xfa/template.js:1695 · src/core/xfa/template.js:3844 — 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. — src/core/xfa/template.js:1695
src/core/xfa/template.js:1842 · src/core/xfa/template.js:2675 — 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. — src/core/xfa/template.js:1842
src/core/operator_list.js:39 · src/core/operator_list.js:170 — 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. — src/core/operator_list.js:39
src/core/postscript/js_evaluator.js:139 · src/core/postscript/js_evaluator.js:211 — the two spans are one implementation copied and then locally edited — 140 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. — src/core/postscript/js_evaluator.js:139
src/display/annotation_layer.js:3215 · src/display/annotation_layer.js:3272 — 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. — src/display/annotation_layer.js:3215
src/core/evaluator.js:2861 · src/core/evaluator.js:2941 — 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. — src/core/evaluator.js:2861
src/core/cmap.js:441 · src/core/cmap.js:493 — 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. — src/core/cmap.js:441
src/core/postscript/ast.js:1092 · src/core/postscript/ast.js:1209 — 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. — src/core/postscript/ast.js:1092
src/core/xfa/template.js:2291 · src/core/xfa/template.js:2639 — all 2 copies are in the same file, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited. — src/core/xfa/template.js:2291
src/core/colorspace.js:832 · src/core/colorspace.js:1120 — 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. — src/core/colorspace.js:832
src/display/annotation_layer.js:1996 · src/display/annotation_layer.js:2103 — 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. — src/display/annotation_layer.js:1996
src/core/metrics.js:1817 · src/core/metrics.js:2135 — 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. — src/core/metrics.js:1817
src/core/annotation.js:5272 · src/core/annotation.js:5317 — 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. — src/core/annotation.js:5272
src/display/annotation_layer.js:3592 · src/display/annotation_layer.js:3623 · src/display/annotation_layer.js:3654 — all 3 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. — src/display/annotation_layer.js:3592
src/core/annotation.js:3409 · src/core/annotation.js:3468 — 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. — src/core/annotation.js:3409
src/core/annotation.js:5091 · src/core/annotation.js:5222 — 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. — src/core/annotation.js:5091
REDACTED:351 · REDACTED:508 — the two spans are one implementation copied and then locally edited — 144 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. — REDACTED:351
src/core/pattern.js:879 · src/core/pattern.js:1011 — 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. — src/core/pattern.js:879
src/core/type1_parser.js:692 · src/core/type1_parser.js:870 — 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. — src/core/type1_parser.js:692
src/core/xfa/template.js:2525 · src/core/xfa/template.js:5124 — 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. — src/core/xfa/template.js:2525
gulpfile.mjs:1497 · gulpfile.mjs:2215 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — gulpfile.mjs:1497
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.
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.
external/stylelint/no-unused-custom-properties.mjs:17 imports stylelint/lib/utils/validateTypes.mjs, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — external/stylelint/no-unused-custom-properties.mjs:17
gulpfile.mjs:3251 imports test/webserver.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — gulpfile.mjs:3251
What to do
Fix the listed violations: import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (1 row); move the shared test helper into a source directory production code may depend on (1 row).
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.
onKeyDown has cyclomatic complexity 120 and cognitive complexity 142; 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:3258
checkAndRepair has cyclomatic complexity 111 and cognitive complexity 188; 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. — src/core/fonts.js:1418
promiseBody has cyclomatic complexity 110 and cognitive complexity 187; 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. — src/core/evaluator.js:1755
bidi has cyclomatic complexity 94 and cognitive complexity 147; 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. — src/core/bidi.js:120
decompress has cyclomatic complexity 84 and cognitive complexity 250; 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. — external/brotli/decode.js:1214
_makeBinary has cyclomatic complexity 76 and cognitive complexity 116; 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. — src/core/postscript/ast.js:1043
(computed) has cyclomatic complexity 74 and cognitive complexity 117; 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. — src/core/xfa/template.js:2741
extractCidKeyedFontProgram has cyclomatic complexity 74 and cognitive complexity 68; 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. — src/core/type1_parser.js:778
parse has cyclomatic complexity 68 and cognitive complexity 98; 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. — src/core/jpg.js:890
parseDestDictionary has cyclomatic complexity 67 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. — src/core/catalog.js:1806
_initializeViewerComponents has cyclomatic complexity 66 and cognitive complexity 85; 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:418
parse has cyclomatic complexity 65 and cognitive complexity 119; 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. — src/core/font_renderer.js:382
#execOp has cyclomatic complexity 62 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — src/core/postscript/js_evaluator.js:537
createImageData has cyclomatic complexity 61 and cognitive complexity 105; 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. — src/core/image.js:776
translateFont has cyclomatic complexity 61 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 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. — src/core/evaluator.js:4496
sanitizeTTProgram has cyclomatic complexity 60 and cognitive complexity 133; 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. — src/core/fonts.js:2484
getDocument has cyclomatic complexity 59 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. — src/display/api.js:228
#cloneStructTreeNode has cyclomatic complexity 58 and cognitive complexity 121; 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. — src/core/editor/pdf_editor.js:562
readCmapTable has cyclomatic complexity 58 and cognitive complexity 107; 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. — src/core/fonts.js:1602
parse has cyclomatic complexity 57 and cognitive complexity 94; 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. — src/core/xfa/formcalc_parser.js:277
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files0.0 / 10Critical✓ 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.
src/core/xfa/template.js has 5900 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/xfa/template.js:1
src/core/annotation.js has 5283 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/annotation.js:1
src/core/evaluator.js has 5081 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/evaluator.js:1
src/core/glyphlist.js has 4552 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/glyphlist.js:1
REDACTED has 4098 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
src/display/annotation_layer.js has 3937 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/display/annotation_layer.js:1
src/core/fonts.js has 3554 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/fonts.js:1
REDACTED has 3285 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
src/display/api.js has 3227 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/display/api.js:1
src/core/metrics.js has 3053 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/metrics.js:1
src/core/editor/pdf_editor.js has 2984 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/editor/pdf_editor.js:1
src/display/editor/tools.js has 2716 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/display/editor/tools.js:1
web/pdf_viewer.js has 2513 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/pdf_viewer.js:1
external/brotli/decode.js has 2447 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — external/brotli/decode.js:1
src/core/document.js has 2194 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/document.js:1
src/display/editor/editor.js has 2153 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/display/editor/editor.js:1
REDACTED has 2003 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
src/core/catalog.js has 1860 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/catalog.js:1
web/pdf_thumbnail_viewer.js has 1814 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/pdf_thumbnail_viewer.js:1
src/core/xfa/config.js has 1620 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/xfa/config.js:1
src/core/parser.js has 1347 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/parser.js:1
src/core/image.js has 1343 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/image.js:1
src/core/postscript/ast.js has 1339 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/postscript/ast.js:1
src/core/jpg.js has 1331 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/jpg.js:1
REDACTED has 1283 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
web/pdf_page_view.js has 1195 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/pdf_page_view.js:1
src/core/pattern.js has 1171 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/pattern.js:1
src/core/xfa/formcalc_parser.js has 1171 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/xfa/formcalc_parser.js:1
src/core/colorspace.js has 1170 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/colorspace.js:1
REDACTED has 1144 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
REDACTED has 1144 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
src/display/editor/draw.js has 1129 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/display/editor/draw.js:1
src/core/struct_tree.js has 1122 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/struct_tree.js:1
src/scripting_api/doc.js has 1122 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/scripting_api/doc.js:1
web/app_options.js has 1108 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/app_options.js:1
src/display/canvas_dependency_tracker.js has 1103 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/display/canvas_dependency_tracker.js:1
web/comment_manager.js has 1089 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/comment_manager.js:1
src/core/standard_fonts.js has 1076 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/standard_fonts.js:1
src/core/type1_parser.js has 1042 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/type1_parser.js:1
src/core/postscript/wasm_compiler.js has 1008 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — src/core/postscript/wasm_compiler.js:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage7.1 / 10Strong✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — REDACTED:1, web/pdf_thumbnail_viewer.js:1, src/scripting_api/doc.js:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
What to do
Bump outdated dependencies to current versions to limit upgrade debt.
Do you agree with this assessment?
R6 · Tooling3.4 / 10Weak✓ 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 and `tsc --noEmit` as package.json scripts and run them in CI.
Do you agree with this assessment?
R7 · Dead Code9.9 / 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.
2 file(s) (~46 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — test/types
This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments. — src/core/pattern.js:80
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. — test/webserver.mjs:25
Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
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.
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.
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.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
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.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
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.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
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.
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.
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 0/6 async functions that make a cancellable request (fetch, axios, ky, ofetch) 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.
`fetchData` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:27
`fetchBinaryData` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:124
`downloadLanguageCodes` 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 })`. — external/importL10n/locales.mjs:30
`downloadLanguageFiles` 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 })`. — external/importL10n/locales.mjs:50
`refreshIndex` 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 })`. — external/ccov/coverage_search.mjs:91
`getStorageNames` 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 })`. — extensions/chromium/options/migration.js:44
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
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.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
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.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
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.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
`catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×4) — gulpfile.mjs:2949, web/grab_to_pan.js:97, web/pdf_thumbnail_viewer.js:382, …
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. (×19) — REDACTED:1241, REDACTED:1318, REDACTED:1339, …
`.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. (×15) — REDACTED:1695, REDACTED:1698, REDACTED:1701, …
`.then(…, () => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it. (×2) — web/pdf_viewer.js:965, src/display/api.js:2772
What to do
Swallowed exception (caught, then discarded)
Do you agree with this assessment?
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.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 12 of 55 WCAG 2.2 Level A/AA success criteria (22%; ≈24% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 43 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).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 4 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.
D12 Dependency Hygiene — 3 observation(s) recorded · Not scored — 1 production npm declaration(s) across 3 package.json (1 of them the product) were read for PINNING discipline (0 defect(s) reported), but the outdated/deprecated signal needs registry.npmjs.org, and no committed lockfile here resolves to the concrete versions that question is asked about, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 5 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 — 52 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No image/media element found in the parsed markup — AC1 not applicable here.
AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
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
AX6 Interface segregation — no exported interface declares behaviour
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
D11 Test Reliability — No tests discovered
D14 License Compliance — npm licences not graded — this repository's lockfile resolves no production dependency
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.
D20 ADR Quality — Repository kind not determined
D21 Naming Consistency — Naming consistency is measured on C# only; JavaScript, Python, TypeScript, html not measured.
D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No hand-written C# or Visual Basic source; comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.html,.js,.mjs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
D32 Data Compliance (PII/GDPR) — 10 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the repository root runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
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
M4 Documentation accuracy — Not applicable: the 7 current-state document(s) make no claim of a kind M4 checks. 9 claim(s) of kinds M4 does not check were not checked (path 7, environment variable 2); M4 checks only links and versions.
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 — no coverage report found on disk — produce a coverage report in a standard format (lcov — `vitest --coverage --coverage.reporter=lcovonly`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF2 Allocation hygiene — Not applicable: TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
S1 Web-Security Posture — Not assessed: 330 JavaScript/TypeScript file(s) were read for weak hashes and ciphers, key material fixed in the source, disabled TLS certificate validation and obsolete TLS versions, and none was found. That half of the dimension is clean, but it is not scored on its own: a C# repository with the same clean reading is scored on its server controls as well, or is N/A for having no web surface, and neither can be decided here. The server controls — HTTPS enforcement, HSTS, cookie flags, 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.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
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
X5 Nullable reference types — Not applicable: this check asks whether the null-typed discipline a language offers is switched on, and how much of that the assertion operator takes back, and in this repository's languages there is no such switch and no such operator. Plain JavaScript carries no type annotations and commits no tsconfig, so it states no null-typed discipline for this check to grade: there is nothing here that switches null checking on or off, and TypeScript (or `// @ts-check`) is how a repository acquires one — advice, not a defect this card measures. Not a gap in the analyzer and not a finding about your code.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Critical — 57 finding(s)
AC2 · Forms & labels· <button> with no accessible text · ×33
<button> with no accessible text web/viewer-geckoview.html:107— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer-geckoview.html:127— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer-geckoview.html:130— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:129— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:310— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:392— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:396— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:509— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:565— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:592— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:623— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:667— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:904— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:905— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:969— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:1006— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:1009— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:1046— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:1070— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:1079— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:1082— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:1099— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:1121— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:1130— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
<button> with no accessible text web/viewer.html:1144— A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
+ 8 more in this group — see findings.md.
AC5 · ARIA correctness· Abstract ARIA role "sectionhead" · ×5
Abstract ARIA role "sectionhead" web/viewer.html:1016— Abstract roles exist only to organise the ARIA taxonomy and must never be used in markup. Use a concrete role.
Abstract ARIA role "sectionhead" web/viewer.html:1092— Abstract roles exist only to organise the ARIA taxonomy and must never be used in markup. Use a concrete role.
Abstract ARIA role "sectionhead" web/viewer.html:1141— Abstract roles exist only to organise the ARIA taxonomy and must never be used in markup. Use a concrete role.
Abstract ARIA role "sectionhead" web/viewer.html:1252— Abstract roles exist only to organise the ARIA taxonomy and must never be used in markup. Use a concrete role.
Abstract ARIA role "sectionhead" web/viewer.html:1278— Abstract roles exist only to organise the ARIA taxonomy and must never be used in markup. Use a concrete role.
AC2 · Forms & labels· <input> without a programmatic label · ×3
<input> without a programmatic label web/viewer-snippet-chrome-overlays.html:17— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label web/viewer.html:376— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<input> without a programmatic label web/viewer.html:1174— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
<html> without a lang extensions/chromium/options/options.html:17— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang web/viewer-geckoview.html:23— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang web/viewer.html:23— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC2 · Forms & labels· Link with no accessible name · ×2
Link with no accessible name web/viewer.html:1034— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name web/viewer.html:1104— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Viewport restricts zoom web/viewer-geckoview.html:26— user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
Viewport restricts zoom web/viewer.html:26— user-scalable=no/0 or a maximum-scale below 2 stops low-vision users zooming to 200%. Remove the zoom restriction from the viewport meta.
AC5 · ARIA correctness· aria-hidden on a focusable element · ×2
aria-hidden on a focusable element web/viewer.html:1212— aria-hidden="true" hides the element from assistive tech but leaves it keyboard-focusable — a confusing dead stop. Remove aria-hidden or make the element non-focusable.
aria-hidden on a focusable element web/viewer.html:1259— aria-hidden="true" hides the element from assistive tech but leaves it keyboard-focusable — a confusing dead stop. Remove aria-hidden or make the element non-focusable.
AC2 · Forms & labels· <select> without a programmatic label · ×1
<select> without a programmatic label web/viewer.html:401— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels· <textarea> without a programmatic label · ×1
<textarea> without a programmatic label web/viewer.html:1280— This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
Orphaned knowledge src/core/xfa/formcalc_parser.js:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
No assertions: destroys the document before the renderer worker is ready test/unit/api_spec.js:1336— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: should reject a circular `Parent` chain test/unit/catalog_spec.js:55— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: handles an empty input array test/unit/image_utils_spec.js:223— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: should error with a non-object reason test/unit/message_handler_spec.js:376— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: should reject with a non-object reason test/unit/message_handler_spec.js:395— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must click on widget annotations test/integration/annotation_spec.mjs:95— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check the checkbox test/integration/annotation_spec.mjs:181— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must click on a link and check if it navigates to the correct page test/integration/annotation_spec.mjs:272— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the FreeText annotation has a popup test/integration/annotation_spec.mjs:611— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the Ink annotation has a popup test/integration/annotation_spec.mjs:640— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the highlight annotation has no popup and no aria-haspopup attribute test/integration/annotation_spec.mjs:760— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the clickable area has been rotated test/integration/annotation_spec.mjs:792— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the text under a highlight annotation exist in the DOM test/integration/annotation_spec.mjs:830— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the text under an underline annotation exist in the DOM test/integration/annotation_spec.mjs:842— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the text under a squiggly annotation exist in the DOM test/integration/annotation_spec.mjs:854— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the text under a strikeout annotation exist in the DOM test/integration/annotation_spec.mjs:867— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the popup is shown test/integration/annotation_spec.mjs:899— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must move the caret down and check the selection test/integration/caret_browsing_spec.mjs:35— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the comment button has a title test/integration/comment_spec.mjs:272— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the comment button is added in the annotation layer test/integration/comment_spec.mjs:300— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the button is removed in the annotation layer test/integration/comment_spec.mjs:344— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the focus is moved on the comment button test/integration/comment_spec.mjs:392— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the focus is moved on the comment button test/integration/comment_spec.mjs:452— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that comments can be selected/unselected test/integration/comment_spec.mjs:649— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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: must check that the popup is deleted when the editor is test/integration/comment_spec.mjs:690— 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* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, 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.
MethodTooLong: Font.checkAndRepair src/core/fonts.js:1418— MethodTooLong — checkAndRepair runs 1249 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1149 over it, 12.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PartialEvaluator.getTextContent src/core/evaluator.js:2421— MethodTooLong — getTextContent runs 804 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 704 over it, 8.04× 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: WorkerMessageHandler.createDocumentHandler src/core/worker.js:98— MethodTooLong — createDocumentHandler runs 666 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 566 over it, 6.66× 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: PartialEvaluator.getOperatorList src/core/evaluator.js:1692— MethodTooLong — getOperatorList runs 547 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 447 over it, 5.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.
MethodTooLong: TextWidgetAnnotationElement.render src/display/annotation_layer.js:1486— MethodTooLong — render runs 301 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 201 over it, 3.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.
MethodTooLong: PartialEvaluator.translateFont src/core/evaluator.js:4496— MethodTooLong — translateFont runs 240 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 140 over it, 2.40× 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: Field.[$toHTML] src/core/xfa/template.js:2741— MethodTooLong — [$toHTML] runs 221 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 121 over it, 2.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CanvasGraphics.showText REDACTED:2785— MethodTooLong — showText runs 211 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PDFViewer.setDocument web/pdf_viewer.js:914— MethodTooLong — setDocument runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× 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: Type1CharString.convert src/core/type1_parser.js:107— MethodTooLong — convert runs 199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 99 over it, 1.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: XRef.indexObjects src/core/xref.js:432— MethodTooLong — indexObjects runs 199 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 99 over it, 1.99× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Type1Parser.extractCidKeyedFontProgram src/core/type1_parser.js:778— MethodTooLong — extractCidKeyedFontProgram runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× 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: PDFEditor.#mergeStructTrees src/core/editor/pdf_editor.js:1363— MethodTooLong — #mergeStructTrees runs 193 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× 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: PartialEvaluator.buildPaintImageXObject src/core/evaluator.js:613— MethodTooLong — buildPaintImageXObject runs 189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× 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: PSStackBasedInterpreter.#execOp src/core/postscript/js_evaluator.js:537— MethodTooLong — #execOp runs 189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× 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: PDFImage.constructor src/core/image.js:143— MethodTooLong — constructor runs 187 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 87 over it, 1.87× 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: DrawLayer.#selectionChange src/display/draw_layer.js:377— MethodTooLong — #selectionChange runs 181 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 81 over it, 1.81× 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: WidgetAnnotation._getAppearance src/core/annotation.js:2387— MethodTooLong — _getAppearance runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× 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: PDFImage.createImageData src/core/image.js:776— MethodTooLong — createImageData runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× 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: ChoiceWidgetAnnotationElement.render src/display/annotation_layer.js:2162— MethodTooLong — render runs 176 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× 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: Subform.[$toHTML] src/core/xfa/template.js:4969— MethodTooLong — [$toHTML] runs 168 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× 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: Catalog.parseDestDictionary src/core/catalog.js:1806— MethodTooLong — parseDestDictionary runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Template.[$toPages] src/core/xfa/template.js:5410— MethodTooLong — [$toPages] runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PsJsCompiler.execute src/core/postscript/js_evaluator.js:324— MethodTooLong — execute runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× 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: SimpleExprParser.parse src/core/xfa/formcalc_parser.js:277— MethodTooLong — parse 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.
FileTooLong: xfa/template.js src/core/xfa/template.js— FileTooLong — 4611 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 4111 over it, 9.22× 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: core/glyphlist.js src/core/glyphlist.js— FileTooLong — 4535 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 95% of them inside a single declaration: getGlyphsUnicode (18-4349). The bar is 1500 significant lines; this is 3035 over it, 3.02× 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: core/evaluator.js src/core/evaluator.js— FileTooLong — 3709 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 84% of them inside a single declaration: PartialEvaluator (228-4883). The bar is 500 significant lines; this is 3209 over it, 7.42× 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: core/annotation.js src/core/annotation.js— FileTooLong — 3685 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 3185 over it, 7.37× 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: core/metrics.js src/core/metrics.js— FileTooLong — 3000 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 98% of them inside a single declaration: getMetrics (21-2968). The bar is 1500 significant lines; this is 1500 over it, 2.00× 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 — 2902 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 89% of them inside a single declaration: CanvasGraphics (555-4523). The bar is 500 significant lines; this is 2402 over it, 5.80× 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: display/annotation_layer.js src/display/annotation_layer.js— FileTooLong — 2779 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 2279 over it, 5.56× 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: core/fonts.js src/core/fonts.js— FileTooLong — 2535 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 71% of them inside a single declaration: Font (1046-3830). The bar is 500 significant lines; this is 2035 over it, 5.07× 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: ./gulpfile.mjs gulpfile.mjs— FileTooLong — 2429 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 1929 over it, 4.86× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 2290 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 74% of them inside a single declaration: PDFViewerApplication (113-2790). The bar is 500 significant lines; this is 1790 over it, 4.58× 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: editor/pdf_editor.js src/core/editor/pdf_editor.js— FileTooLong — 2024 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 95% of them inside a single declaration: PDFEditor (139-3195). The bar is 1500 significant lines; this is 524 over it, 1.35× 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: editor/tools.js src/display/editor/tools.js— FileTooLong — 1705 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 78% of them inside a single declaration: AnnotationEditorUIManager (723-3057). The bar is 500 significant lines; this is 1205 over it, 3.41× 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: display/api.js src/display/api.js— FileTooLong — 1704 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 1204 over it, 3.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: web/pdf_viewer.js web/pdf_viewer.js— FileTooLong — 1609 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 95% of them inside a single declaration: PDFViewer (231-2811). The bar is 1500 significant lines; this is 109 over it, 1.07× 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: core/document.js src/core/document.js— FileTooLong — 1606 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 1500 significant lines; this is 106 over it, 1.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 1497 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 997 over it, 2.99× 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: editor/editor.js src/display/editor/editor.js— FileTooLong — 1386 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: AnnotationEditor (45-2444). The bar is 500 significant lines; this is 886 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: web/pdf_thumbnail_viewer.js web/pdf_thumbnail_viewer.js— FileTooLong — 1321 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: PDFThumbnailViewer (91-1988). The bar is 500 significant lines; this is 821 over it, 2.64× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: core/catalog.js src/core/catalog.js— FileTooLong — 1272 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: Catalog (120-2061). The bar is 500 significant lines; this is 772 over it, 2.54× 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: xfa/config.js src/core/xfa/config.js— FileTooLong — 1129 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 629 over it, 2.26× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: core/image.js src/core/image.js— FileTooLong — 952 significant lines (blank, comment-only and punctuation-only lines excluded), about 94% of them inside a single declaration: PDFImage (142-1450). The bar is 500 significant lines; this is 452 over it, 1.90× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 947 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 447 over it, 1.89× 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: core/parser.js src/core/parser.js— FileTooLong — 928 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 428 over it, 1.86× 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: core/pattern.js src/core/pattern.js— FileTooLong — 927 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 427 over it, 1.85× 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: xfa/formcalc_parser.js src/core/xfa/formcalc_parser.js— FileTooLong — 867 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 367 over it, 1.73× 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.
ClassTooLong: PartialEvaluator src/core/evaluator.js:228— ClassTooLong — 3118 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 2718 over it, 7.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.
ClassTooLong: CanvasGraphics REDACTED:555— ClassTooLong — 2573 significant lines (blank, comment-only and punctuation-only lines excluded), 112 methods. The bar is 400 significant lines; this is 2173 over it, 6.43× 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: PDFEditor src/core/editor/pdf_editor.js:139— ClassTooLong — 1929 significant lines (blank, comment-only and punctuation-only lines excluded), 56 methods. The bar is 400 significant lines; this is 1529 over it, 4.82× 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: Font src/core/fonts.js:1046— ClassTooLong — 1811 significant lines (blank, comment-only and punctuation-only lines excluded), 11 methods. The bar is 400 significant lines; this is 1411 over it, 4.53× 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: PDFViewer web/pdf_viewer.js:231— ClassTooLong — 1522 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 1122 over it, 3.81× 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: AnnotationEditor src/display/editor/editor.js:45— ClassTooLong — 1365 significant lines (blank, comment-only and punctuation-only lines excluded), 127 methods. The bar is 400 significant lines; this is 965 over it, 3.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AnnotationEditorUIManager src/display/editor/tools.js:723— ClassTooLong — 1337 significant lines (blank, comment-only and punctuation-only lines excluded), 124 methods. The bar is 400 significant lines; this is 937 over it, 3.34× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PDFThumbnailViewer web/pdf_thumbnail_viewer.js:91— ClassTooLong — 1301 significant lines (blank, comment-only and punctuation-only lines excluded), 52 methods. The bar is 400 significant lines; this is 901 over it, 3.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Catalog src/core/catalog.js:120— ClassTooLong — 1212 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 812 over it, 3.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PDFDocument src/core/document.js:1017— ClassTooLong — 924 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 524 over it, 2.31× 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: PDFImage src/core/image.js:142— ClassTooLong — 891 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods. The bar is 400 significant lines; this is 491 over it, 2.23× 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: PDFPageView web/pdf_page_view.js:141— ClassTooLong — 754 significant lines (blank, comment-only and punctuation-only lines excluded), 32 methods. The bar is 400 significant lines; this is 354 over it, 1.89× 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: SignatureManager web/signature_manager.js:29— ClassTooLong — 696 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 296 over it, 1.74× 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: DrawingEditor src/display/editor/draw.js:71— ClassTooLong — 694 significant lines (blank, comment-only and punctuation-only lines excluded), 61 methods. The bar is 400 significant lines; this is 294 over it, 1.74× 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: WorkerMessageHandler src/core/worker.js:69— ClassTooLong — 687 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 287 over it, 1.72× 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: Doc src/scripting_api/doc.js:37— ClassTooLong — 680 significant lines (blank, comment-only and punctuation-only lines excluded), 108 methods. The bar is 400 significant lines; this is 280 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CFFParser REDACTED:278— ClassTooLong — 652 significant lines (blank, comment-only and punctuation-only lines excluded), 17 methods. The bar is 400 significant lines; this is 252 over it, 1.63× 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: XRef src/core/xref.js:35— ClassTooLong — 641 significant lines (blank, comment-only and punctuation-only lines excluded), 21 methods. The bar is 400 significant lines; this is 241 over it, 1.60× 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: TreeView web/internal/tree_view.js:31— ClassTooLong — 620 significant lines (blank, comment-only and punctuation-only lines excluded), 37 methods. The bar is 400 significant lines; this is 220 over it, 1.55× 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: StampEditor src/display/editor/stamp.js:25— ClassTooLong — 616 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 216 over it, 1.54× 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: WidgetAnnotation src/core/annotation.js:1956— ClassTooLong — 570 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods. The bar is 400 significant lines; this is 170 over it, 1.43× 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: AnnotationEditorLayer src/display/editor/annotation_editor_layer.js:65— ClassTooLong — 569 significant lines (blank, comment-only and punctuation-only lines excluded), 51 methods. The bar is 400 significant lines; this is 169 over it, 1.42× 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: Page src/core/document.js:86— ClassTooLong — 563 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 163 over it, 1.41× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PsWasmCompiler src/core/postscript/wasm_compiler.js:150— ClassTooLong — 556 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 156 over it, 1.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SignatureExtractor src/display/editor/drawers/signaturedraw.js:27— ClassTooLong — 550 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 150 over it, 1.38× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
+ 16 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file REDACTED: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 web/pdf_thumbnail_viewer.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 src/scripting_api/doc.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 web/comment_manager.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 web/signature_manager.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 web/internal/tree_view.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 web/internal/page_view.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 src/scripting_api/field.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 web/debugger.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 web/firefoxcom.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 web/internal/draw_ops_view.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 web/new_alt_text_manager.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 web/digital_signature_properties_manager.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 src/scripting_api/app.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 REDACTED: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 src/scripting_api/aform.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 src/display/renderer_worker.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 web/internal/multiline_view.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 web/pdf_thumbnail_view.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 web/views_manager.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 REDACTED: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 external/cmapscompress/compress.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 web/chromecom.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 web/toolbar.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 web/viewer.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.
Hotspot: src/core/fonts.js src/core/fonts.js:1418— src/core/fonts.js changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 345 in Font.checkAndRepair at line 1418. 4 of those changes were fix/bug commits, and the other 26 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/core/fonts.js`: 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: src/core/evaluator.js src/core/evaluator.js:2421— src/core/evaluator.js changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 187 in PartialEvaluator.getTextContent at line 2421. 2 of those changes were fix/bug commits, and the other 18 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/core/evaluator.js`: 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: src/display/api.js src/display/api.js:228— src/display/api.js changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in api.getDocument at line 228. 3 of those changes were fix/bug commits, and the other 37 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/display/api.js`: 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: src/core/worker.js src/core/worker.js:98— src/core/worker.js changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 109 in WorkerMessageHandler.createDocumentHandler at line 98. 1 of those changes was a fix/bug commit, and the other 14 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/core/worker.js`: 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:2785— REDACTED changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in CanvasGraphics.showText at line 2785. 3 of those changes were fix/bug commits, and the other 18 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01: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: src/display/annotation_layer.js src/display/annotation_layer.js:1486— src/display/annotation_layer.js changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in TextWidgetAnnotationElement.render at line 1486. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/display/annotation_layer.js`: 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: src/core/annotation.js src/core/annotation.js:2387— src/core/annotation.js changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in WidgetAnnotation._getAppearance at line 2387. 5 of those changes were fix/bug commits, and the other 10 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/core/annotation.js`: 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:613— REDACTED changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in CFFParser.#parseCharString at line 613. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01: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: src/core/postscript/ast.js src/core/postscript/ast.js:1043— src/core/postscript/ast.js changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in PSStackToTree._makeBinary at line 1043. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/core/postscript/ast.js`: 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: src/core/editor/pdf_editor.js src/core/editor/pdf_editor.js:2436— src/core/editor/pdf_editor.js changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in PDFEditor.#makePageCopy at line 2436. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/core/editor/pdf_editor.js`: 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: src/scripting_api/field.js src/scripting_api/field.js:111— src/scripting_api/field.js changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Field.constructor at line 111. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/scripting_api/field.js`: 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: src/core/document.js src/core/document.js:479— src/core/document.js changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in Page.getOperatorList at line 479. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/core/document.js`: 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: gulpfile.mjs gulpfile.mjs:846— gulpfile.mjs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in gulpfile.runTests at line 846. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- gulpfile.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/core/image.js src/core/image.js:776— src/core/image.js changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in PDFImage.createImageData at line 776. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/core/image.js`: 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:55— REDACTED changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in Util.printf at line 55. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01: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: web/pdf_viewer.js web/pdf_viewer.js:914— web/pdf_viewer.js changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in PDFViewer.setDocument at line 914. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- web/pdf_viewer.js`: 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: src/scripting_api/doc.js src/scripting_api/doc.js:120— src/scripting_api/doc.js changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in Doc.constructor at line 120. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/scripting_api/doc.js`: 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:1081— REDACTED changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in CipherTransformFactory.constructor at line 1081. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01: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: src/core/catalog.js src/core/catalog.js:1695— src/core/catalog.js changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in Catalog.#getDestFromStructElement at line 1695. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/core/catalog.js`: 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: src/core/flate_stream.js src/core/flate_stream.js:310— src/core/flate_stream.js changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in FlateStream.#readBlock at line 310. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/core/flate_stream.js`: 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: web/struct_tree_layer_builder.js web/struct_tree_layer_builder.js:556— web/struct_tree_layer_builder.js changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in StructTreeLayerBuilder.#walk at line 556. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- web/struct_tree_layer_builder.js`: 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: test/test.mjs test/test.mjs:78— test/test.mjs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in parseOptions at line 78. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- test/test.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/core/struct_tree.js src/core/struct_tree.js:1127— src/core/struct_tree.js changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in StructTreePage.serializable at line 1127. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/core/struct_tree.js`: 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: test/driver.js test/driver.js:1074— test/driver.js changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in (anonymous) at line 1074. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- test/driver.js`: 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: src/display/touch_manager.js src/display/touch_manager.js:305— src/display/touch_manager.js changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in TouchManager.#onTouchMove at line 305. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- src/display/touch_manager.js`: 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.
Swallowed exception (empty catch) REDACTED:1241— 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:1318— 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:1339— 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:1485— 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:1695— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) REDACTED:1698— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) REDACTED:1701— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) REDACTED:1740— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) REDACTED:2289— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) REDACTED:2932— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) REDACTED:2949— `.catch(() => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) REDACTED:2962— `.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) web/chromecom.js:162— 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) web/genericl10n.js:120— 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) web/l10n.js:75— 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) web/pdf_link_service.js:471— 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) web/pdf_print_service.js:218— `.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) web/pdf_print_service.js:282— `.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) web/pdf_scripting_manager.js:525— `.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) web/pdf_scripting_manager.js:534— 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) web/pdf_viewer.js:965— `.then(…, () => {})` handles the rejection by doing nothing — the failure is discarded with no log and no rethrow, and the chain carries on as if the work succeeded. Log it through whatever this codebase already uses to report problems, hand it to a caller that can (`next(error)`, a returned rejection), or don't catch it.
Swallowed exception (empty catch) web/struct_tree_layer_builder.js:274— 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) web/struct_tree_layer_builder.js:289— 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) web/internal/debugger.js:240— 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:474— 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.
Sync-over-async blocking external/importL10n/locales.mjs:63— `fs.existsSync` in `downloadLanguageFiles` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking external/importL10n/locales.mjs:64— `fs.mkdirSync` in `downloadLanguageFiles` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking external/importL10n/locales.mjs:80— `fs.writeFileSync` in `downloadLanguageFiles` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking external/importL10n/locales.mjs:95— `fs.readdirSync` in `downloadL10n` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking external/importL10n/locales.mjs:97— `fs.lstatSync` in `downloadL10n` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking external/importL10n/locales.mjs:104— `fs.rmSync` in `downloadL10n` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/downloadutils.mjs:51— `fs.existsSync` in `callback to manifest.filter` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/downloadutils.mjs:54— `fs.readFileSync` in `callback to map` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/downloadutils.mjs:84— `fs.existsSync` in `verifyManifestFiles` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/downloadutils.mjs:92— `fs.existsSync` in `verifyManifestFiles` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/font/ttxdriver.mjs:47— `fs.writeFileSync` in `translateFont` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/font/ttxdriver.mjs:58— `fs.unlinkSync` in `translateFont` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/font/ttxdriver.mjs:62— `fs.existsSync` in `translateFont` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/font/ttxdriver.mjs:65— `fs.readFileSync` in `translateFont` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/font/ttxdriver.mjs:66— `fs.unlinkSync` in `translateFont` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/test.mjs:291— `fs.writeFileSync` in `finalize` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/test.mjs:294— `fs.writeFileSync` in `finalize` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/test.mjs:333— `fs.existsSync` in `setup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/test.mjs:338— `fs.existsSync` in `setup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/test.mjs:339— `fs.unlinkSync` in `setup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/test.mjs:341— `fs.existsSync` in `setup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/test.mjs:342— `fs.rmSync` in `setup` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/test.mjs:425— `fs.existsSync` in `checkRefsTmp` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/test.mjs:427— `fs.rmSync` in `checkRefsTmp` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking test/test.mjs:439— `fs.rmSync` in `reader.question("SHOULD THIS SCRIPT REMOVE tmp/? THINK CAREFULLY [yn] ")` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
FunctionTooLong: glyphlist.getGlyphsUnicode src/core/glyphlist.js:18— FunctionTooLong — getGlyphsUnicode runs 4329 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4229 over it, 43.29× 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: metrics.getMetrics src/core/metrics.js:21— FunctionTooLong — getMetrics runs 2927 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2827 over it, 29.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: font_renderer.compileCharString src/core/font_renderer.js:360— FunctionTooLong — compileCharString runs 330 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 230 over it, 3.30× 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: viewer.getViewerConfiguration web/viewer.js:31— FunctionTooLong — getViewerConfiguration 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: app.onKeyDown REDACTED:3258— FunctionTooLong — onKeyDown runs 237 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 137 over it, 2.37× 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: api.getDocument src/display/api.js:228— FunctionTooLong — getDocument runs 207 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× 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: glyphlist.getDingbatsGlyphsUnicode src/core/glyphlist.js:4351— FunctionTooLong — getDingbatsGlyphsUnicode runs 204 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 104 over it, 2.04× 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: babel-plugin-pdfjs-preprocessor.babelPluginPDFJSPreprocessor external/builder/babel-plugin-pdfjs-preprocessor.mjs:49— FunctionTooLong — babelPluginPDFJSPreprocessor runs 177 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 77 over it, 1.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: compress.parseCMap external/cmapscompress/compress.mjs:159— FunctionTooLong — parseCMap runs 168 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× 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: font_renderer.compileGlyf src/core/font_renderer.js:163— FunctionTooLong — compileGlyf runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× 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: bidi.bidi src/core/bidi.js:120— FunctionTooLong — bidi 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.
FunctionTooLong: builder.preprocess REDACTED:35— FunctionTooLong — preprocess runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× 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: pdf_find_controller.normalize REDACTED:94— FunctionTooLong — normalize runs 140 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× 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: standard_fonts.getSerifFonts src/core/standard_fonts.js:181— FunctionTooLong — getSerifFonts runs 135 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: optimize.optimizeCMap external/cmapscompress/optimize.mjs:16— FunctionTooLong — optimizeCMap runs 133 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 33 over it, 1.33× 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: calculate_sha_other.calculateSHA512 src/core/calculate_sha_other.js:234— FunctionTooLong — calculateSHA512 runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: fonts.createCmapTable src/core/fonts.js:583— FunctionTooLong — createCmapTable runs 127 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: compress.compressCmap external/cmapscompress/compress.mjs:21— FunctionTooLong — compressCmap runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: xfa_fonts.getXFAFontMap src/core/xfa_fonts.js:70— FunctionTooLong — getXFAFontMap runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: initialization.initSandbox src/scripting_api/initialization.js:45— FunctionTooLong — initSandbox runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: content_disposition.getFilenameFromContentDispositionHeader REDACTED:30— FunctionTooLong — getFilenameFromContentDispositionHeader runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: gulpfile.buildMozcentral gulpfile.mjs:1731— FunctionTooLong — buildMozcentral runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× 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: fonts_utils.compileType3Glyph src/core/fonts_utils.js:230— FunctionTooLong — compileType3Glyph runs 106 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 6 over it, 1.06× 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: fonts.createOS2Table src/core/fonts.js:793— FunctionTooLong — createOS2Table runs 105 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 5 over it, 1.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: calculate_sha256.calculateSHA256 src/core/calculate_sha256.js:68— FunctionTooLong — calculateSHA256 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.
TooManyMethods: ConfigNamespace src/core/xfa/config.js:1353— TooManyMethods — 140 methods. The bar is 30 methods; this is 110 over it, 4.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AnnotationEditor src/display/editor/editor.js:45— TooManyMethods — 127 methods. The bar is 30 methods; this is 97 over it, 4.23× 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: AnnotationEditorUIManager src/display/editor/tools.js:723— TooManyMethods — 124 methods. The bar is 30 methods; this is 94 over it, 4.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.
TooManyMethods: TemplateNamespace src/core/xfa/template.js:6120— TooManyMethods — 114 methods. The bar is 30 methods; this is 84 over it, 3.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: CanvasGraphics REDACTED:555— TooManyMethods — 112 methods. The bar is 30 methods; this is 82 over it, 3.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: Doc src/scripting_api/doc.js:37— TooManyMethods — 108 methods. The bar is 30 methods; this is 78 over it, 3.60× 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: DrawingEditor src/display/editor/draw.js:71— TooManyMethods — 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PDFEditor src/core/editor/pdf_editor.js:139— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× 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: PDFThumbnailViewer web/pdf_thumbnail_viewer.js:91— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.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: AnnotationEditorLayer src/display/editor/annotation_editor_layer.js:65— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PDFViewer web/pdf_viewer.js:231— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: XFAObject src/core/xfa/xfa_object.js:104— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: App src/scripting_api/app.js:46— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× 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: FreeTextEditor src/display/editor/freetext.js:37— TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.33× 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: WorkerTransport src/display/api.js:2366— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× 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: PartialEvaluator src/core/evaluator.js:228— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× 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: Field src/scripting_api/field.js:38— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× 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: TreeView web/internal/tree_view.js:31— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× 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: Annotation src/core/annotation.js:729— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× 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: CanvasBBoxTracker src/display/canvas_dependency_tracker.js:118— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× 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: CanvasDependencyTracker src/display/canvas_dependency_tracker.js:435— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CanvasNestedDependencyTracker src/display/canvas_dependency_tracker.js:820— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PDFPageView web/pdf_page_view.js:141— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Fake-async — async method never awaits src/core/struct_tree.js:588— `#updateParentTag` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits src/core/writer.js:305— `updateAcroform` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits src/display/editor/alt_text.js:247— `#setState` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits src/display/editor/toolbar.js:242— `addButtonBefore` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits web/comment_manager.js:805— `#save` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits web/draw_layer_builder.js:54— `render` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits web/firefoxcom.js:299— `dispatchEventInSandbox` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits web/firefoxcom.js:303— `destroySandbox` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits web/firefoxcom.js:427— `#cancelAllRequests` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits web/genericcom.js:121— `deleteModel` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits web/new_alt_text_manager.js:210— `#toggleGuessAltText` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits web/overlay_manager.js:32— `register` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits web/overlay_manager.js:73— `close` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits web/password_prompt.js:92— `close` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits web/pdf_document_properties.js:187— `close` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
Fake-async — async method never awaits web/signature_manager.js:1072— `#update` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×12
Focus outline removed in CSS without a :focus replacement web/annotation_editor_layer_builder.css:624— `.annotationEditorLayer .freeTextEditor .internal: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 web/annotation_editor_layer_builder.css:1242— `.annotationEditorLayer .highlightEditor` 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 web/comment_manager.css:623— `.commentPopup: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.
Focus outline removed in CSS without a :focus replacement web/signature_manager.css:685— `#editorSignatureParamsToolbar #addSignatureDoorHanger .toolbarAddSignatureButtonContainer .toolbarAddSignatureButton` 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 web/viewer-geckoview.css:81— `#viewerContainer` 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 web/viewer-geckoview.css:139— `#floatingToolbar .toolbarButton` 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 web/viewer.css:369— `#viewerContainer` 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 web/viewer.css:945— `.toolbarButton` 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 web/viewer.css:1618— `.dropdownToolbarButton > select` 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 web/viewer.css:1698— `.dropdownToolbarButton > select: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.
Focus outline removed in CSS without a :focus replacement web/viewer.css:1600— `.dropdownToolbarButton` 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 web/views_manager.css:969— `#viewsManager #viewsManagerContent #thumbnailsView > .thumbnail > .thumbnailImageContainer.draggingThumbnail.multiple > .thumbnailImageContainer` 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.
IC1 · Incompleteness & stubs· Empty method body · ×12
Empty method body — does nothing with its inputs src/core/glyf.js:692— `scale` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs REDACTED:4323— `markPoint` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs REDACTED:4327— `markPointProps` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs REDACTED:4360— `beginCompat` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs REDACTED:4364— `endCompat` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs web/genericcom.js:29— `initCom` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs web/genericcom.js:96— `guess` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs web/genericcom.js:98— `toggleService` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs web/genericcom.js:126— `loadModel` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs web/toolbar-geckoview.js:67— `setPageNumber` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs web/toolbar-geckoview.js:69— `setPagesCount` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs web/toolbar-geckoview.js:71— `setPageScale` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Low cohesion: XFAObject (LCOM4 8) src/core/xfa/xfa_object.js:104— XFAObject's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Annotation (LCOM4 8) src/core/annotation.js:729— Annotation's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: HighlightEditor (LCOM4 8) src/display/editor/highlight.js:63— HighlightEditor's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Type1Font (LCOM4 5) src/core/type1_font.js:167— Type1Font's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: SignatureEditor (LCOM4 5) src/display/editor/signature.js:62— SignatureEditor's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Util (LCOM4 5) REDACTED:17— Util's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: CipherTransformFactory (LCOM4 4) REDACTED:886— CipherTransformFactory's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: StampEditor (LCOM4 4) src/display/editor/stamp.js:25— StampEditor's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AnnotationEditorUIManager (LCOM4 4) src/display/editor/tools.js:723— AnnotationEditorUIManager's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Field (LCOM4 4) src/scripting_api/field.js:38— Field's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Hollow method — returns a constant without doing the work src/core/editor/pdf_editor.js:115— `countUpdatesAfter` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work src/display/canvas_dependency_tracker.js:404— `getSimpleIndex` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work web/chromecom.js:451— `isEnabledFor` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work web/chromecom.js:455— `guess` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work web/debugger.mjs:654— `shouldSkip` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work web/genericcom.js:84— `isEnabledFor` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work web/genericcom.js:88— `deleteModel` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work web/genericcom.js:92— `isReady` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work web/genericcom.js:200— `viewCertificate` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×7
Animation without a prefers-reduced-motion guard web/digital_signature_properties.css:193— `#signaturePropertiesButton.state-loading .loadingDot` moves (`animation: signaturePropertiesDot 1.2s ease-in-out infinite both`) 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 web/digital_signature_properties.css:461— `.sigCard .subSignatures > summary::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 web/viewer.css:1806— `#toolbarContainer #loadingBar .progress` moves (`transition: transform 200ms`) 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 web/viewer.css:1829— `#toolbarContainer #loadingBar.indeterminate .progress .glimmer` moves (`animation: progressIndeterminate 1s 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 examples/mobile-viewer/viewer.css:169— `.pdfViewer .page .loadingIcon` moves (`animation: 1s steps(10, end) 0s normal none infinite moveDefault`) 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 examples/mobile-viewer/viewer.css:206— `#loadingBar .progress` moves (`transition: transform 200ms`) 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 examples/mobile-viewer/viewer.css:241— `#loadingBar.indeterminate .progress .glimmer` moves (`animation: progressIndeterminate 2s linear infinite`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
D10 · Test Quality· Fixed-sleep synchronisation · ×7
Fixed-sleep synchronisation: cancels and cleans up before the renderer worker is ready test/unit/api_spec.js:1264— This test starts work it did not wait for (`gate`, still running when the sleep starts) and then orders itself against it with `new Promise(resolve => {
setTimeout(resolve, 0);
})` — 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: should read using a reader test/unit/message_handler_spec.js:39— This test starts work it did not wait for (`reader`, still running when the sleep starts) and then orders itself against it with `sleep(10)` — 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: should not read any data when cancelled test/unit/message_handler_spec.js:85— This test starts work it did not wait for (`reader`, still running when the sleep starts) and then orders itself against it with `sleep(10)` — 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: should not read when errored test/unit/message_handler_spec.js:143— This test starts work it did not wait for (`reader`, still running when the sleep starts) and then orders itself against it with `sleep(10)` — 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: should read data with blocking promise test/unit/message_handler_spec.js:196— This test starts work it did not wait for (`reader`, still running when the sleep starts) and then orders itself against it with `sleep(10)` — 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: should read data with blocking promise and buffer whole data test/unit/message_handler_spec.js:259— This test starts work it did not wait for (`reader`, still running when the sleep starts) and then orders itself against it with `sleep(10)` — 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: should ignore any pull after close is called test/unit/message_handler_spec.js:325— This test starts work it did not wait for (`reader`, still running when the sleep starts) and then orders itself against it with `sleep(10)` — 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.
Font.checkAndRepair::sanitizeTTProgram (cognitive 133) src/core/fonts.js:2484— Font.checkAndRepair::sanitizeTTProgram has cognitive complexity 133 (threshold 15). Drivers by points: if/else 43 (95 pts), loops 7 (23 pts), boolean chains 15 (nesting depth added 68). 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: 5 other methods here (Font.checkAndRepair::readTrueTypeCollectionData, Font.checkAndRepair::sanitizeGlyph, Font.checkAndRepair::sanitizeGlyphLocations, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
Font.checkAndRepair::readTrueTypeCollectionData (cognitive 31) src/core/fonts.js:1539— Font.checkAndRepair::readTrueTypeCollectionData has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (Font.checkAndRepair::sanitizeGlyph, Font.checkAndRepair::sanitizeGlyphLocations, Font.checkAndRepair::readPostScriptTable, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
Font.checkAndRepair::sanitizeGlyphLocations (cognitive 30) src/core/fonts.js:2181— Font.checkAndRepair::sanitizeGlyphLocations has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 5 (6 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 5 other methods here (Font.checkAndRepair::readTrueTypeCollectionData, Font.checkAndRepair::sanitizeGlyph, Font.checkAndRepair::readPostScriptTable, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
Font.checkAndRepair::sanitizeGlyph (cognitive 29) src/core/fonts.js:2001— Font.checkAndRepair::sanitizeGlyph has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (25 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. This shape REPEATS in the file: 5 other methods here (Font.checkAndRepair::readTrueTypeCollectionData, Font.checkAndRepair::sanitizeGlyphLocations, Font.checkAndRepair::readPostScriptTable, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
Font.checkAndRepair::readPostScriptTable (cognitive 20) src/core/fonts.js:2347— Font.checkAndRepair::readPostScriptTable has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts), boolean chains 1, 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. This shape REPEATS in the file: 5 other methods here (Font.checkAndRepair::readTrueTypeCollectionData, Font.checkAndRepair::sanitizeGlyph, Font.checkAndRepair::sanitizeGlyphLocations, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
Font.checkAndRepair::readNameTable (cognitive 19) src/core/fonts.js:2413— Font.checkAndRepair::readNameTable has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (5 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. This shape REPEATS in the file: 5 other methods here (Font.checkAndRepair::readTrueTypeCollectionData, Font.checkAndRepair::sanitizeGlyph, Font.checkAndRepair::sanitizeGlyphLocations, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
X2 · Cancellation propagation· Async function without AbortSignal · ×6
Async function without AbortSignal: fetchData REDACTED:27— `fetchData` 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: fetchBinaryData REDACTED:124— `fetchBinaryData` 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: downloadLanguageCodes external/importL10n/locales.mjs:30— `downloadLanguageCodes` 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: downloadLanguageFiles external/importL10n/locales.mjs:50— `downloadLanguageFiles` 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: refreshIndex external/ccov/coverage_search.mjs:91— `refreshIndex` 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: getStorageNames extensions/chromium/options/migration.js:44— `getStorageNames` 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 })`.
AC3 · Page structure· Page without a main landmark · ×4
Page without a main landmark extensions/chromium/options/options.html:17— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark web/internal/debugger.html:17— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark web/viewer-geckoview.html:23— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark web/viewer.html:23— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Font.checkAndRepair::sanitizeTTProgram (cyclomatic 60) src/core/fonts.js:2484— Font.checkAndRepair::sanitizeTTProgram has cyclomatic complexity 60 (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: 3 other methods here (Font.checkAndRepair::readCmapTable, Font.checkAndRepair::sanitizeGlyph, Font.checkAndRepair::sanitizeGlyphLocations) 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.
Font.checkAndRepair::readCmapTable (cyclomatic 58) src/core/fonts.js:1602— Font.checkAndRepair::readCmapTable has cyclomatic complexity 58 (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: 3 other methods here (Font.checkAndRepair::sanitizeGlyph, Font.checkAndRepair::sanitizeGlyphLocations, Font.checkAndRepair::sanitizeTTProgram) 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.
Font.checkAndRepair::sanitizeGlyph (cyclomatic 24) src/core/fonts.js:2001— Font.checkAndRepair::sanitizeGlyph 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. This shape REPEATS in the file: 3 other methods here (Font.checkAndRepair::readCmapTable, Font.checkAndRepair::sanitizeGlyphLocations, Font.checkAndRepair::sanitizeTTProgram) 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.
Font.checkAndRepair::sanitizeGlyphLocations (cyclomatic 20) src/core/fonts.js:2181— Font.checkAndRepair::sanitizeGlyphLocations 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. This shape REPEATS in the file: 3 other methods here (Font.checkAndRepair::readCmapTable, Font.checkAndRepair::sanitizeGlyph, Font.checkAndRepair::sanitizeTTProgram) 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.
Duplicated block (24 lines × 2 locations) src/core/annotation.js:5091— src/core/annotation.js:5091 · src/core/annotation.js:5222 — 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 (24 lines × 2 locations) src/core/pattern.js:879— src/core/pattern.js:879 · src/core/pattern.js:1011 — 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 (24 lines × 2 locations) src/core/type1_parser.js:692— src/core/type1_parser.js:692 · src/core/type1_parser.js:870 — 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 (24 lines × 2 locations) src/core/xfa/template.js:2525— src/core/xfa/template.js:2525 · src/core/xfa/template.js:5124 — 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.
Swallowed exception (caught, then discarded) gulpfile.mjs:2949— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) web/grab_to_pan.js:97— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) web/pdf_thumbnail_viewer.js:382— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
Swallowed exception (caught, then discarded) src/display/annotation_layer.js:3841— `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
(computed) (cyclomatic 16) src/core/xfa/template.js:1195— (computed) has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
(computed) (cyclomatic 16) src/core/xfa/template.js:1894— (computed) 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.
(computed) (cyclomatic 16) src/core/xfa/xfa_object.js:468— (computed) 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.
getTextContent::promiseBody (cognitive 86) src/core/evaluator.js:3232— getTextContent::promiseBody has cognitive complexity 86 (threshold 15). Drivers by points: if/else 18 (50 pts), ternaries 5 (19 pts), error handling 2 (6 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
getTextContent::compareWithLastPosition (cognitive 59) src/core/evaluator.js:2754— getTextContent::compareWithLastPosition has cognitive complexity 59 (threshold 15). Drivers by points: if/else 30 (45 pts), boolean chains 8, ternaries 3 (5 pts), match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
getTextContent::buildTextContentItem (cognitive 55) src/core/evaluator.js:2981— getTextContent::buildTextContentItem has cognitive complexity 55 (threshold 15). Drivers by points: if/else 23 (43 pts), boolean chains 6, ternaries 3 (5 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(computed) (cognitive 16) src/core/xfa/template.js:1416— (computed) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(computed) (cognitive 16) src/core/xfa/template.js:1894— (computed) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
(computed) (cognitive 16) src/core/xfa/xfa_object.js:824— (computed) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Change coupling: renderer_worker.js ↔ renderer_worker_proxy.js src/display/renderer_worker.js:1— `src/display/renderer_worker.js` and `src/display/renderer_worker_proxy.js` change together 64% of the time (7 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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 7 shared commits counted here, the most recent 3 are `2ef8c64d` Release discarded canvases; `90821279` Use the renderer workers preloaded by Firefox (bug 2079251); `83bffae5` Handle invalid canvas sizes in worker rendering (PR 21860 follow-up) — run `git show` on any of them.
Change coupling: obj_bin_transform_core.js ↔ obj_bin_transform_display.js src/core/obj_bin_transform_core.js:1— `src/core/obj_bin_transform_core.js` and `src/display/obj_bin_transform_display.js` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `edd591f5` Remove handling of standalone number entries in the compiled font-info; `a02decd9` Stop exporting the Font `defaultVMetrics` by default; `57243d72` Remove the unused `SystemFontInfo.prototype.guessFallback` getter — run `git show` on any of them.
Change coupling: annotation_layer_builder.js ↔ xfa_layer_builder.js web/annotation_layer_builder.js:1— `web/annotation_layer_builder.js` and `web/xfa_layer_builder.js` change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `eda97fe8` Move the `PageViewport` class into its own file; `45c7805d` Fix types to make "gulp typestest" succeeding; `b517b5c5` Remove the `IPDFLinkService` interface — run `git show` on any of them.
Duplicated block (29 lines × 2 locations) src/core/cmap.js:441— src/core/cmap.js:441 · src/core/cmap.js:493 — 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 (29 lines × 2 locations) src/core/postscript/ast.js:1092— src/core/postscript/ast.js:1092 · src/core/postscript/ast.js:1209 — 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 (29 lines × 2 locations) src/core/xfa/template.js:2291— src/core/xfa/template.js:2291 · src/core/xfa/template.js:2639 — all 2 copies are in the same file, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited.
AC4 · Keyboard semantics· Anchor without href · ×2
Anchor without href web/viewer-snippet-chrome-overlays.html:9— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
Anchor without href web/viewer.html:1201— An <a> with no href, role or tabindex isn't focusable or keyboard-activatable. Give it a real href, or use a <button> for an action.
PartialEvaluator.getTextContent::compareWithLastPosition (cyclomatic 48) src/core/evaluator.js:2754— PartialEvaluator.getTextContent::compareWithLastPosition has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (PartialEvaluator.getTextContent::buildTextContentItem) 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.
PartialEvaluator.getTextContent::buildTextContentItem (cyclomatic 29) src/core/evaluator.js:2981— PartialEvaluator.getTextContent::buildTextContentItem 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. This shape REPEATS in the file: one other method here (PartialEvaluator.getTextContent::compareWithLastPosition) 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.
constructor (cyclomatic 24) web/pdf_thumbnail_viewer.js:189— constructor has cyclomatic complexity 24 (threshold 15). Of this number, 17 points are the body's own statements and 7 belong to 7 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.
constructor (cyclomatic 24) web/pdf_page_view.js:183— constructor has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Repeated repair: test/integration/reorganize_pages_spec.mjs test/integration/reorganize_pages_spec.mjs:176— test/integration/reorganize_pages_spec.mjs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is (anonymous) at line 176), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Report PDF modifications to Firefox (bug 2076546)”; “Update the thumbnail status label and controls together (bug 2080269)”; “Fix the adjacent-page reordering integration test”; “Fix intermittent reorganize pages integration tests”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- test/integration/reorganize_pages_spec.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: web/firefoxcom.js web/firefoxcom.js:732— web/firefoxcom.js changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is ExternalServices.initPassiveLoading at line 732), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Report PDF modifications to Firefox (bug 2076546)”; “Defer the Firefox features notification until after first-page rendering (bug 2072145)”; “[GeckoView] Add typed signatures (bug 2069485)”; “Use platform print-to-PDF for FreeText appearances (bug 1794809)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 18:21:47 +01:00' --until='2026-10-26 18:21:47 +01:00' --full-history --no-merges -- web/firefoxcom.js`: 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.
constructor (cognitive 28) src/core/annotation.js:4782— constructor has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3 (9 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 12). Of this number, 23 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.
constructor (cognitive 28) web/pdf_page_view.js:183— constructor has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 11, other 5 (nesting depth added 5). Of this number, 25 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.
(computed) (cognitive 19) src/core/xfa/template.js:3097— (computed) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (5 pts), boolean chains 2, 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.
(computed) (cognitive 19) src/core/xfa/template.js:3408— (computed) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 1 (2 pts), match/switch 1, 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.
(computed) (cognitive 17) src/core/xfa/template.js:3917— (computed) has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 3 (7 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.
(computed) (cognitive 17) src/core/xfa/template.js:4175— (computed) has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, ternaries 2, other 1 (nesting depth added 4). Of this number, 14 points are the body's own statements and 3 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.
Skeleton type — most members are unfinished web/genericcom.js:77— `MLManager` has 5 unfinished members out of 5 declared members (methods and accessors, whether or not each carries a body) — a scaffolded class that was never implemented.
Skeleton type — most members are unfinished web/toolbar-geckoview.js:23— `Toolbar` has 4 unfinished members out of 6 declared members (methods and accessors, whether or not each carries a body) — a scaffolded class that was never implemented.
Duplicated block (33 lines × 2 locations) gulpfile.mjs:887— gulpfile.mjs:887 · gulpfile.mjs:1139 — 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 (33 lines × 2 locations) src/core/xfa/locale_set.js:66— src/core/xfa/locale_set.js:66 · src/core/xfa/locale_set.js:133 — all 2 copies are in the same file, and each CITED SPAN is a SPECIALISATION DECLARATION — a type whose `extends` clause names a base and whose body hands that base its own values through `super(…)`. The shared module this dimension usually asks you to extract already exists: it is that base, every one of these sites already reaches it, and the `super(…)` call this row matched on is where each site passes its differences in. So do not read this as an extract-a-helper row — there is no missing helper, and what is left at each site is the declaration of one distinct specialisation, which cannot be deleted without deleting the thing it declares. Read what actually differs between the spans, because two different answers follow. Where the sites differ only in the values they hand the base — a type argument, a service, an alias, a cache — the repetition is a TEMPLATE, and the only moves that collapse it are to generate these declarations from the set they enumerate or to replace the repeated construction with one factory each site calls with its own values; where that set is the point, each site pinning one distinct thing, the repetition IS the enumeration and there is nothing to remove. Where instead a span carries logic OUTSIDE the delegation that is the same at every site, that logic is the part to move, and its home is the base type rather than a new module. Reported because the copies still drift apart the first time only one of them is edited.
Duplicated block (32 lines × 2 locations) src/core/xfa/template.js:1695— src/core/xfa/template.js:1695 · src/core/xfa/template.js:3844 — 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 (32 lines × 2 locations) src/core/xfa/template.js:1842— src/core/xfa/template.js:1842 · src/core/xfa/template.js:2675 — 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 (31 lines × 2 locations) src/core/operator_list.js:39— src/core/operator_list.js:39 · src/core/operator_list.js:170 — 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 (31 lines × 2 locations) src/display/annotation_layer.js:3215— src/display/annotation_layer.js:3215 · src/display/annotation_layer.js:3272 — 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 (28 lines × 2 locations) src/core/colorspace.js:832— src/core/colorspace.js:832 · src/core/colorspace.js:1120 — 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 (28 lines × 2 locations) src/display/annotation_layer.js:1996— src/display/annotation_layer.js:1996 · src/display/annotation_layer.js:2103 — 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.
Boundary violation [package:third-party-deep-import] external/stylelint/no-unused-custom-properties.mjs:17— external/stylelint/no-unused-custom-properties.mjs:17 imports stylelint/lib/utils/validateTypes.mjs, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:test-suite-dependency] gulpfile.mjs:3251— gulpfile.mjs:3251 imports test/webserver.mjs, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
AC4 · Keyboard semantics· Modal dialog does not manage focus · ×1
Modal dialog does not manage focus web/viewer.html:141— 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.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no a11y linter (an a11y linter that can read your UI — no component framework was detected, so the JSX/Vue ESLint plugins would have nothing to lint; use an HTML-template a11y linter (html-eslint, htmlhint) or run axe/pa11y over the rendered pages) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 8 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
PartialEvaluator.getOperatorList (cyclomatic 140) src/core/evaluator.js:1692— PartialEvaluator.getOperatorList has cyclomatic complexity 140 (threshold 15). Most of this is not in the body itself: 8 of the 140 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 1755, a function literal at line 1798, a function literal at line 2200, …). 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.
app.onKeyDown (cyclomatic 120) REDACTED:3258— app.onKeyDown has cyclomatic complexity 120 (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.
createDocumentHandler (cyclomatic 115) src/core/worker.js:98— createDocumentHandler has cyclomatic complexity 115 (threshold 15). Most of this is not in the body itself: 12 of the 115 points are its own statements and the rest belongs to 86 function items inside it that branch (a function literal at line 722, a function literal at line 579, getPdfManager::readData, …). 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.
checkAndRepair (cyclomatic 111) src/core/fonts.js:1418— checkAndRepair has cyclomatic complexity 111 (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.
getOperatorList::promiseBody (cyclomatic 110) src/core/evaluator.js:1755— getOperatorList::promiseBody has cyclomatic complexity 110 (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.
bidi.bidi (cyclomatic 94) src/core/bidi.js:120— bidi.bidi has cyclomatic complexity 94 (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.
_initializeViewerComponents (cyclomatic 78) REDACTED:418— _initializeViewerComponents has cyclomatic complexity 78 (threshold 15). Of this number, 66 points are the body's own statements and 12 belong to 12 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.
render (cyclomatic 77) src/display/annotation_layer.js:1486— render has cyclomatic complexity 77 (threshold 15). Of this number, 29 points are the body's own statements and 48 belong to 16 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.
Type1Parser.extractCidKeyedFontProgram (cyclomatic 76) src/core/type1_parser.js:778— Type1Parser.extractCidKeyedFontProgram has cyclomatic complexity 76 (threshold 15). Of this number, 74 points are the body's own statements and 2 belong to 2 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.
PSStackToTree._makeBinary (cyclomatic 76) src/core/postscript/ast.js:1043— PSStackToTree._makeBinary has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Field.[$toHTML] (cyclomatic 74) src/core/xfa/template.js:2741— Field.[$toHTML] 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.
(computed) (cyclomatic 74) src/core/xfa/template.js:2741— (computed) 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.
getDocument (cyclomatic 69) src/display/api.js:228— getDocument has cyclomatic complexity 69 (threshold 15). Of this number, 59 points are the body's own statements and 10 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.
#mergeStructTrees (cyclomatic 68) src/core/editor/pdf_editor.js:1363— #mergeStructTrees has cyclomatic complexity 68 (threshold 15). Of this number, 55 points are the body's own statements and 13 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.
Catalog.parseDestDictionary (cyclomatic 67) src/core/catalog.js:1806— Catalog.parseDestDictionary has cyclomatic complexity 67 (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.
font_renderer.compileCharString::parse (cyclomatic 65) src/core/font_renderer.js:382— font_renderer.compileCharString::parse has cyclomatic complexity 65 (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.
PSStackBasedInterpreter.#execOp (cyclomatic 62) src/core/postscript/js_evaluator.js:537— PSStackBasedInterpreter.#execOp has cyclomatic complexity 62 (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.
indexObjects (cyclomatic 62) src/core/xref.js:432— indexObjects has cyclomatic complexity 62 (threshold 15). Of this number, 54 points are the body's own statements and 8 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.
PartialEvaluator.translateFont (cyclomatic 61) src/core/evaluator.js:4496— PartialEvaluator.translateFont has cyclomatic complexity 61 (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.
createImageData (cyclomatic 61) src/core/image.js:776— createImageData has cyclomatic complexity 61 (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.
babelPluginPDFJSPreprocessor (cyclomatic 59) external/builder/babel-plugin-pdfjs-preprocessor.mjs:49— babelPluginPDFJSPreprocessor has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 1 of the 59 points is its own statement and the rest belongs to 12 function items inside it that branch (MemberExpression, CallExpression, exit, …). 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.
PDFEditor.#cloneStructTreeNode (cyclomatic 58) src/core/editor/pdf_editor.js:562— PDFEditor.#cloneStructTreeNode has cyclomatic complexity 58 (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.
PsJsCompiler.execute (cyclomatic 57) src/core/postscript/js_evaluator.js:324— PsJsCompiler.execute has cyclomatic complexity 57 (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.
SimpleExprParser.parse (cyclomatic 57) src/core/xfa/formcalc_parser.js:277— SimpleExprParser.parse has cyclomatic complexity 57 (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.
Type1CharString.convert (cyclomatic 55) src/core/type1_parser.js:107— Type1CharString.convert has cyclomatic complexity 55 (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.
getTextContent::promiseBody (cyclomatic 55) src/core/evaluator.js:3232— getTextContent::promiseBody has cyclomatic complexity 55 (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.
CFFParser.#parseCharString (cyclomatic 54) REDACTED:613— CFFParser.#parseCharString 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.
PDFImage.constructor (cyclomatic 53) src/core/image.js:143— PDFImage.constructor has cyclomatic complexity 53 (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.
DrawLayer.#selectionChange (cyclomatic 53) src/display/draw_layer.js:377— DrawLayer.#selectionChange has cyclomatic complexity 53 (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.
Catalog.viewerPreferences (cyclomatic 52) src/core/catalog.js:968— Catalog.viewerPreferences has cyclomatic complexity 52 (threshold 15). Of this number, 50 points are the body's own statements and 2 belong to one function literal 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.
Subform.[$toHTML] (cyclomatic 52) src/core/xfa/template.js:4969— Subform.[$toHTML] has cyclomatic complexity 52 (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.
(computed) (cyclomatic 52) src/core/xfa/template.js:4969— (computed) has cyclomatic complexity 52 (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.
PartialEvaluator.preEvaluateFont (cyclomatic 51) src/core/evaluator.js:4333— PartialEvaluator.preEvaluateFont has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
buildPaintImageXObject (cyclomatic 51) src/core/evaluator.js:613— buildPaintImageXObject has cyclomatic complexity 51 (threshold 15). Of this number, 47 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.
builder.preprocess (cyclomatic 50) REDACTED:35— builder.preprocess has cyclomatic complexity 50 (threshold 15). Of this number, 36 points are the body's own statements and 14 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
optimize.optimizeCMap (cyclomatic 49) external/cmapscompress/optimize.mjs:16— optimize.optimizeCMap has cyclomatic complexity 49 (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.
CanvasGraphics.beginGroup (cyclomatic 49) REDACTED:3353— CanvasGraphics.beginGroup has cyclomatic complexity 49 (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.
constructor (cyclomatic 49) web/pdf_viewer.js:310— constructor has cyclomatic complexity 49 (threshold 15). Of this number, 48 points are the body's own statements and 1 belongs 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.
showText (cyclomatic 47) REDACTED:2785— showText has cyclomatic complexity 47 (threshold 15). Of this number, 46 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.
Parser.findDCTDecodeInlineStreamEnd (cyclomatic 46) src/core/parser.js:343— Parser.findDCTDecodeInlineStreamEnd has cyclomatic complexity 46 (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.
Lexer.getObj (cyclomatic 45) src/core/parser.js:1236— Lexer.getObj has cyclomatic complexity 45 (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.
Type1Parser.extractFontProgram (cyclomatic 44) src/core/type1_parser.js:584— Type1Parser.extractFontProgram 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.
WidgetAnnotation._getAppearance (cyclomatic 44) src/core/annotation.js:2387— WidgetAnnotation._getAppearance has cyclomatic complexity 44 (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.
ColorSpaceUtils.#parse (cyclomatic 43) src/core/colorspace_utils.js:128— ColorSpaceUtils.#parse has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Font.fallbackToSystemFont (cyclomatic 43) src/core/fonts.js:1246— Font.fallbackToSystemFont has cyclomatic complexity 43 (threshold 15). Of this number, 40 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.
CipherTransformFactory.constructor (cyclomatic 42) REDACTED:1081— CipherTransformFactory.constructor has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PartialEvaluator.extractDataStructures (cyclomatic 42) src/core/evaluator.js:3657— PartialEvaluator.extractDataStructures has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PDFEditor.#cloneFields (cyclomatic 41) src/core/editor/pdf_editor.js:2196— PDFEditor.#cloneFields has cyclomatic complexity 41 (threshold 15). Of this number, 34 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.
compileType3Glyph (cyclomatic 41) src/core/fonts_utils.js:230— compileType3Glyph 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.
constructor (cyclomatic 40) src/core/annotation.js:2899— constructor 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.
#enableGlobalSelectionListener (cyclomatic 40) web/text_layer_builder.js:211— #enableGlobalSelectionListener has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 5 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 271, reset, a function literal at line 256, …). 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.
Template.[$toPages] (cyclomatic 39) src/core/xfa/template.js:5410— Template.[$toPages] has cyclomatic complexity 39 (threshold 15). Of this number, 38 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.
Util.printf (cyclomatic 39) REDACTED:55— Util.printf has cyclomatic complexity 39 (threshold 15). Most of this is not in the body itself: 3 of the 39 points are its own statements and the rest belongs to one function literal inside it that branches (line 73). 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.
(computed) (cyclomatic 39) src/core/xfa/template.js:5410— (computed) has cyclomatic complexity 39 (threshold 15). Of this number, 38 points are the body's own statements and 1 belongs 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.
StructTreeLayerBuilder.#walk (cyclomatic 38) web/struct_tree_layer_builder.js:556— StructTreeLayerBuilder.#walk 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.
setDocument (cyclomatic 38) web/pdf_viewer.js:914— setDocument has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 8 of the 38 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 998, a function literal at line 1152, onAfterDraw, …). 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.
layout.checkDimensions (cyclomatic 37) src/core/xfa/layout.js:262— layout.checkDimensions has cyclomatic complexity 37 (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.
Binder._bindElement (cyclomatic 37) src/core/xfa/bind.js:475— Binder._bindElement has cyclomatic complexity 37 (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.
PDFViewer.scrollPageIntoView (cyclomatic 37) web/pdf_viewer.js:1797— PDFViewer.scrollPageIntoView has cyclomatic complexity 37 (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.
#makePageCopy (cyclomatic 37) src/core/editor/pdf_editor.js:2436— #makePageCopy has cyclomatic complexity 37 (threshold 15). Of this number, 32 points are the body's own statements and 5 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.
PSStackToTree._evalOp (cyclomatic 36) src/core/postscript/ast.js:822— PSStackToTree._evalOp 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.
PartialEvaluator.setGState (cyclomatic 35) src/core/evaluator.js:1133— PartialEvaluator.setGState has cyclomatic complexity 35 (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.
AnnotationFactory._create (cyclomatic 35) src/core/annotation.js:169— AnnotationFactory._create has cyclomatic complexity 35 (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.
load (cyclomatic 35) REDACTED:1662— load has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 8 of the 35 points are its own statements and the rest belongs to 22 function items inside it that branch (a function literal at line 1755, a function literal at line 1668, a function literal at line 1864, …). 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.
parseCMap (cyclomatic 35) external/cmapscompress/compress.mjs:159— parseCMap has cyclomatic complexity 35 (threshold 15). Of this number, 22 points are the body's own statements and 13 belong to 7 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.
ExclGroup.[$toHTML] (cyclomatic 34) src/core/xfa/template.js:2443— ExclGroup.[$toHTML] has cyclomatic complexity 34 (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.
PDFEditor.#resolveInsertAfterIndices (cyclomatic 34) src/core/editor/pdf_editor.js:844— PDFEditor.#resolveInsertAfterIndices has cyclomatic complexity 34 (threshold 15). Of this number, 28 points are the body's own statements and 6 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.
PDFLinkService.setHash (cyclomatic 34) web/pdf_link_service.js:358— PDFLinkService.setHash 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.
(computed) (cyclomatic 34) src/core/xfa/template.js:2443— (computed) has cyclomatic complexity 34 (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.
setupMessageHandler (cyclomatic 34) src/display/api.js:2598— setupMessageHandler has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 5 of the 34 points are its own statements and the rest belongs to 28 function items inside it that branch (a function literal at line 2783, a function literal at line 2644, a function literal at line 2724, …). 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.
compileGlyf (cyclomatic 34) src/core/font_renderer.js:163— compileGlyf has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs 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.
Lexer.getString (cyclomatic 33) src/core/parser.js:1025— Lexer.getString has cyclomatic complexity 33 (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.
PartialEvaluator.extractWidths (cyclomatic 33) src/core/evaluator.js:4141— PartialEvaluator.extractWidths 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.
ast._evalBinaryConst (cyclomatic 32) src/core/postscript/ast.js:357— ast._evalBinaryConst 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.
PartialEvaluator.hasBlendModes (cyclomatic 32) src/core/evaluator.js:287— PartialEvaluator.hasBlendModes 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.
TranslatedFont.#removeType3ColorOperators (cyclomatic 32) src/core/evaluator.js:5018— TranslatedFont.#removeType3ColorOperators 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.
Catalog.getPageDict (cyclomatic 32) src/core/catalog.js:1297— Catalog.getPageDict 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.
PDFScriptingManager.#updateFromSandbox (cyclomatic 32) web/pdf_scripting_manager.js:328— PDFScriptingManager.#updateFromSandbox 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.
extractPages (cyclomatic 32) src/core/editor/pdf_editor.js:984— extractPages has cyclomatic complexity 32 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_evalBlockFrom (cyclomatic 32) src/core/postscript/ast.js:679— _evalBlockFrom 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.
Parser.findDefaultInlineStreamEnd (cyclomatic 31) src/core/parser.js:202— Parser.findDefaultInlineStreamEnd 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.
Font.constructor (cyclomatic 31) src/core/fonts.js:1055— Font.constructor 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.
SignatureExtractor.#findContours (cyclomatic 31) src/display/editor/drawers/signaturedraw.js:83— SignatureExtractor.#findContours 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.
normalize (cyclomatic 31) REDACTED:94— normalize has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 13 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 205, 150, 222). 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.
WidgetAnnotation.save (cyclomatic 30) src/core/annotation.js:2250— WidgetAnnotation.save 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.
LinkAnnotationElement._bindResetFormAction (cyclomatic 30) src/display/annotation_layer.js:1171— LinkAnnotationElement._bindResetFormAction 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 one function literal inside it that branches (line 1189). 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.
getOperatorList (cyclomatic 30) src/core/document.js:479— getOperatorList has cyclomatic complexity 30 (threshold 15). Of this number, 27 points are the body's own statements and 3 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.
printx (cyclomatic 30) REDACTED:260— printx has cyclomatic complexity 30 (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.
FlateStream.#readBlock (cyclomatic 29) src/core/flate_stream.js:310— FlateStream.#readBlock 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.
Parser.makeFilter (cyclomatic 29) src/core/parser.js:800— Parser.makeFilter has cyclomatic complexity 29 (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.
fonts.createOS2Table (cyclomatic 29) src/core/fonts.js:793— fonts.createOS2Table 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.
PartialEvaluator._simpleFontToUnicode (cyclomatic 29) src/core/evaluator.js:3862— PartialEvaluator._simpleFontToUnicode 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.
Catalog.#readOptionalContentConfig (cyclomatic 29) src/core/catalog.js:608— Catalog.#readOptionalContentConfig has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 4 of the 29 points are its own statements and the rest belongs to 4 function items inside it that branch (parseOrder, parseRBGroups, parseOnOff, …). 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.
PDFViewer.#getPageAdvance (cyclomatic 29) web/pdf_viewer.js:2442— PDFViewer.#getPageAdvance 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.
SignaturePropertiesManager.#renderCard (cyclomatic 29) web/digital_signature_properties_manager.js:428— SignaturePropertiesManager.#renderCard has cyclomatic complexity 29 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
reset (cyclomatic 29) web/pdf_page_view.js:648— reset has cyclomatic complexity 29 (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.
writeStream (cyclomatic 29) src/core/writer.js:54— writeStream 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.
glyf.pruneCompositeGlyphCycles (cyclomatic 28) src/core/glyf.js:695— glyf.pruneCompositeGlyphCycles 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.
internal_viewer_utils._binaryToExpr (cyclomatic 28) src/core/internal_viewer_utils.js:149— internal_viewer_utils._binaryToExpr has cyclomatic complexity 28 (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.
PDFThumbnailViewer.#addEventListeners (cyclomatic 28) web/pdf_thumbnail_viewer.js:1414— PDFThumbnailViewer.#addEventListeners has cyclomatic complexity 28 (threshold 15). 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 literals inside it that branch (lines 1424, 1417, 1494). 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.
createCmapTable (cyclomatic 28) src/core/fonts.js:583— createCmapTable 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.
convert (cyclomatic 28) src/core/fonts.js:3296— convert has cyclomatic complexity 28 (threshold 15). Of this number, 14 points are the body's own statements and 14 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Catalog.getAllPageDicts (cyclomatic 27) src/core/catalog.js:1432— Catalog.getAllPageDicts has cyclomatic complexity 27 (threshold 15). Of this number, 20 points are the body's own statements and 7 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.
AnnotationEditorUIManager.updateMode (cyclomatic 27) src/display/editor/tools.js:2111— AnnotationEditorUIManager.updateMode has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EventDispatcher.dispatch (cyclomatic 27) src/scripting_api/event.js:109— EventDispatcher.dispatch has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_bindResetFormAction::onclick (cyclomatic 27) src/display/annotation_layer.js:1189— _bindResetFormAction::onclick has cyclomatic complexity 27 (threshold 15). 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. This is NOT this file's highest cyclomatic complexity: create (cyclomatic 28) 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.
serializable::nodeToSerializable (cyclomatic 27) src/core/struct_tree.js:1128— serializable::nodeToSerializable has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Font._charToGlyph (cyclomatic 26) src/core/fonts.js:3573— Font._charToGlyph 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.
StructElementNode.tableAttributes (cyclomatic 26) src/core/struct_tree.js:756— StructElementNode.tableAttributes 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.
CanvasGraphics.setGState (cyclomatic 26) REDACTED:1225— CanvasGraphics.setGState 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.
ChoiceWidgetAnnotationElement.render (cyclomatic 26) src/display/annotation_layer.js:2162— ChoiceWidgetAnnotationElement.render has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 10 of the 26 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 2258, getValue, a function literal at line 2190, …). 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. This is NOT this file's highest cyclomatic complexity: AnnotationElementFactory.create (cyclomatic 28) 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.
content_disposition.getFilenameFromContentDispositionHeader (cyclomatic 26) REDACTED:30— content_disposition.getFilenameFromContentDispositionHeader has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 7 function items inside it that branch (rfc2231getparam, textdecode, fixupEncoding, …). 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.
AForm.#AFSpecial_KeystrokeEx_helper (cyclomatic 26) src/scripting_api/aform.js:445— AForm.#AFSpecial_KeystrokeEx_helper has cyclomatic complexity 26 (threshold 15). Of this number, 13 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.
PDFPageView.draw (cyclomatic 26) web/pdf_page_view.js:1075— PDFPageView.draw has cyclomatic complexity 26 (threshold 15). Of this number, 18 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.
TreeView.#setupKeyboardNav (cyclomatic 26) web/internal/tree_view.js:120— TreeView.#setupKeyboardNav has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to one function literal inside it that branches (line 121). 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.
loadFont (cyclomatic 26) src/core/evaluator.js:1268— loadFont has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 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.
#addExternalFileDropListeners (cyclomatic 26) web/pdf_thumbnail_viewer.js:1678— #addExternalFileDropListeners has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 2 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 1779, hasMergeableItem, a function literal at line 1713, …). 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.
fillGrayBuffer (cyclomatic 26) src/core/image.js:1058— fillGrayBuffer has cyclomatic complexity 26 (threshold 15). 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· show (cyclomatic 26) · ×1
show (cyclomatic 26) web/internal/draw_ops_view.js:220— show has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 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.
XMLParserBase.parseXml (cyclomatic 25) src/core/xml_parser.js:174— XMLParserBase.parseXml has cyclomatic complexity 25 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
PDFEditor.#collectDependencies (cyclomatic 25) src/core/editor/pdf_editor.js:266— PDFEditor.#collectDependencies 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.
Field.constructor (cyclomatic 25) src/scripting_api/field.js:111— Field.constructor has cyclomatic complexity 25 (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.
CFFParser.parsePrivateDict (cyclomatic 24) REDACTED:902— CFFParser.parsePrivateDict 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.
PSStackToTree._makeTernary (cyclomatic 24) src/core/postscript/ast.js:1340— PSStackToTree._makeTernary 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.
Catalog.getPageIndex (cyclomatic 24) src/core/catalog.js:1564— Catalog.getPageIndex has cyclomatic complexity 24 (threshold 15). Of this number, 20 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.
Catalog.#getDestFromStructElement (cyclomatic 24) src/core/catalog.js:1695— Catalog.#getDestFromStructElement 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.
html_utils.layoutNode (cyclomatic 24) src/core/xfa/html_utils.js:207— html_utils.layoutNode 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.
PDFDocument.#parseSignatureDict (cyclomatic 24) src/core/document.js:2088— PDFDocument.#parseSignatureDict 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.
CanvasGraphics.paintChar (cyclomatic 24) REDACTED:2628— CanvasGraphics.paintChar 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.
OptionalContentConfig.isVisible (cyclomatic 24) src/display/optional_content_config.js:186— OptionalContentConfig.isVisible 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.
XfaLayer.setAttributes (cyclomatic 24) src/display/xfa_layer.js:222— XfaLayer.setAttributes 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.
getNumber (cyclomatic 24) src/core/parser.js:949— getNumber 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.
compress.compressCmap (cyclomatic 23) external/cmapscompress/compress.mjs:21— compress.compressCmap has cyclomatic complexity 23 (threshold 15). 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.
BinaryCMapReader.process (cyclomatic 23) src/core/binary_cmap.js:142— BinaryCMapReader.process has cyclomatic complexity 23 (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.
PDFFunction.constructSampled (cyclomatic 23) src/core/function.js:193— PDFFunction.constructSampled 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 one function item inside it that branches (constructSampledFn). 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.
evaluator.normalizeBlendMode (cyclomatic 23) src/core/evaluator.js:136— evaluator.normalizeBlendMode has cyclomatic complexity 23 (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.
ChoiceWidgetAnnotation._getAppearance (cyclomatic 23) src/core/annotation.js:4023— ChoiceWidgetAnnotation._getAppearance 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.
CanvasGraphics._createMaskCanvas (cyclomatic 23) REDACTED:1016— CanvasGraphics._createMaskCanvas has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PDFDateString.toDateObject (cyclomatic 23) REDACTED:236— PDFDateString.toDateObject has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AnnotationElement._createContainer (cyclomatic 23) src/display/annotation_layer.js:393— AnnotationElement._createContainer has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: AnnotationElementFactory.create (cyclomatic 28) 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.
AnnotationLayer.#addElementsToDOM (cyclomatic 23) src/display/annotation_layer.js:4125— AnnotationLayer.#addElementsToDOM has cyclomatic complexity 23 (threshold 15). Of this number, 13 points are the body's own statements and 10 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. This is NOT this file's highest cyclomatic complexity: AnnotationElementFactory.create (cyclomatic 28) 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.
app.onWheel (cyclomatic 23) REDACTED:3105— app.onWheel has cyclomatic complexity 23 (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.
executeOperatorList (cyclomatic 23) REDACTED:730— executeOperatorList 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.
_parseHashParams (cyclomatic 23) REDACTED:288— _parseHashParams has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 32 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.
createWebpackConfig (cyclomatic 23) gulpfile.mjs:310— createWebpackConfig has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
#collectFieldObjects (cyclomatic 23) src/core/document.js:1856— #collectFieldObjects 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.
resolveCommonObject (cyclomatic 23) src/display/object_handler.js:43— resolveCommonObject has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 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.
gulpfile.runTests (cyclomatic 22) gulpfile.mjs:846— gulpfile.runTests 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 2 function literals inside it that branch (lines 847, 936). 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.
util._isValidExplicitDest (cyclomatic 22) REDACTED:1093— util._isValidExplicitDest has cyclomatic complexity 22 (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.
PredictorStream.readBlockPng (cyclomatic 22) src/core/predictor_stream.js:137— PredictorStream.readBlockPng has cyclomatic complexity 22 (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.
Parser.getObj (cyclomatic 22) src/core/parser.js:121— Parser.getObj 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.
font_substitutions.getFontSubstitution (cyclomatic 22) src/core/font_substitutions.js:723— font_substitutions.getFontSubstitution has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PDFImage._fillDownscaledRgba (cyclomatic 22) src/core/image.js:1225— PDFImage._fillDownscaledRgba 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.
EvaluatorPreprocessor.read (cyclomatic 22) src/core/evaluator.js:5437— EvaluatorPreprocessor.read 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.
AppearanceStreamEvaluator.parse (cyclomatic 22) src/core/default_appearance.js:110— AppearanceStreamEvaluator.parse 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.
StructTreePage.addNode (cyclomatic 22) src/core/struct_tree.js:1015— StructTreePage.addNode 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.
Doc.constructor (cyclomatic 22) src/scripting_api/doc.js:120— Doc.constructor has cyclomatic complexity 22 (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.
pdf_find_utils.getNormalizeWithNFKC (cyclomatic 22) web/pdf_find_utils.js:61— pdf_find_utils.getNormalizeWithNFKC 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.
PDFViewer.onPagesEdited (cyclomatic 22) web/pdf_viewer.js:1233— PDFViewer.onPagesEdited 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.
render (cyclomatic 22) src/display/api.js:1513— render 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 2 function items inside it that branch (complete, a function literal at line 1669). 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· run (cyclomatic 22) · ×1
run (cyclomatic 22) REDACTED:948— run has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
toJSObject (cyclomatic 22) src/core/document.js:2300— toJSObject 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.
parseIf (cyclomatic 22) src/core/xfa/formcalc_parser.js:1136— parseIf 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.
#buildLine (cyclomatic 22) web/internal/draw_ops_view.js:638— #buildLine has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 belong to 6 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.
getPdfFilenameFromUrl (cyclomatic 22) REDACTED:107— getPdfFilenameFromUrl has cyclomatic complexity 22 (threshold 15). Of this number, 14 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.
string_utils.stringToPDFString (cyclomatic 21) src/core/string_utils.js:67— string_utils.stringToPDFString 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.
Parser.makeInlineImage (cyclomatic 21) src/core/parser.js:501— Parser.makeInlineImage 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.
PartialEvaluator.buildFormXObject (cyclomatic 21) src/core/evaluator.js:477— PartialEvaluator.buildFormXObject 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.
som.searchNode (cyclomatic 21) src/core/xfa/som.js:158— som.searchNode 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.
XhtmlObject.[$pushGlyphs] (cyclomatic 21) src/core/xfa/xhtml.js:239— XhtmlObject.[$pushGlyphs] has cyclomatic complexity 21 (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.
PDFScriptingManager.setDocument (cyclomatic 21) web/pdf_scripting_manager.js:90— PDFScriptingManager.setDocument has cyclomatic complexity 21 (threshold 15). Of this number, 16 points are the body's own statements and 5 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.
documentInfo (cyclomatic 21) src/core/document.js:1577— documentInfo has cyclomatic complexity 21 (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.
(computed) (cyclomatic 21) src/core/xfa/xhtml.js:239— (computed) has cyclomatic complexity 21 (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.
render (cyclomatic 21) src/display/xfa_layer.js:317— render 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.
cmap.parseCMap (cyclomatic 20) src/core/cmap.js:566— cmap.parseCMap 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.
PsWasmCompiler._compileUnaryNode (cyclomatic 20) src/core/postscript/wasm_compiler.js:428— PsWasmCompiler._compileUnaryNode 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.
PsWasmCompiler._compileNodeAsBoolI32 (cyclomatic 20) src/core/postscript/wasm_compiler.js:783— PsWasmCompiler._compileNodeAsBoolI32 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.
XRef.readXRefTable (cyclomatic 20) src/core/xref.js:230— XRef.readXRefTable 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.
XRef.fetchCompressed (cyclomatic 20) src/core/xref.js:960— XRef.fetchCompressed 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.
Catalog.#readPageLabels (cyclomatic 20) src/core/catalog.js:838— Catalog.#readPageLabels 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.
pdf_images.createImage (cyclomatic 20) src/core/editor/pdf_images.js:155— pdf_images.createImage 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.
FontFinder.find (cyclomatic 20) src/core/xfa/fonts.js:82— FontFinder.find 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.
Image.[$toHTML] (cyclomatic 20) src/core/xfa/template.js:3408— Image.[$toHTML] 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.
template.handleBreak (cyclomatic 20) src/core/xfa/template.js:328— template.handleBreak 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.
MessageHandler.#processStreamMessage (cyclomatic 20) src/shared/message_handler.js:408— MessageHandler.#processStreamMessage 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.
AnnotationEditorLayer.disable (cyclomatic 20) src/display/editor/annotation_editor_layer.js:304— AnnotationEditorLayer.disable 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PDFRenderingQueue.getHighestPriority (cyclomatic 20) web/pdf_rendering_queue.js:112— PDFRenderingQueue.getHighestPriority 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.
(computed) (cyclomatic 20) src/core/xfa/template.js:3408— (computed) 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.
_initializeMetadata (cyclomatic 20) REDACTED:2008— _initializeMetadata 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.
#findClosestThumbnail (cyclomatic 20) web/pdf_thumbnail_viewer.js:1901— #findClosestThumbnail 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.
#onPagesEdited (cyclomatic 20) REDACTED:1108— #onPagesEdited 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.
prefs.buildPrefsSchema (cyclomatic 19) external/chromium/prefs.mjs:175— prefs.buildPrefsSchema 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.
fonts.createNameTable (cyclomatic 19) src/core/fonts.js:946— fonts.createNameTable 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.
ast._evalUnaryConst (cyclomatic 19) src/core/postscript/ast.js:416— ast._evalUnaryConst has cyclomatic complexity 19 (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.
StructTreeRoot.#collectParents (cyclomatic 19) src/core/struct_tree.js:523— StructTreeRoot.#collectParents 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 cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StructTreePage.parse (cyclomatic 19) src/core/struct_tree.js:964— StructTreePage.parse 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.
Catalog.#readDocumentOutline (cyclomatic 19) src/core/catalog.js:380— Catalog.#readDocumentOutline 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.
StructTreeLayerBuilder.#setAttributes (cyclomatic 19) web/struct_tree_layer_builder.js:373— StructTreeLayerBuilder.#setAttributes 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.
TouchManager.#onTouchMove (cyclomatic 19) src/display/touch_manager.js:305— TouchManager.#onTouchMove 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.
XfaLayer.setupStorage (cyclomatic 19) src/display/xfa_layer.js:151— XfaLayer.setupStorage 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.
Util.#createDateActions (cyclomatic 19) REDACTED:339— Util.#createDateActions 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 7 function literals inside it that branch (lines 344, 346, 354, …). 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.
TextHighlighter._renderMatches (cyclomatic 19) web/text_highlighter.js:155— TextHighlighter._renderMatches 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PDFPageView.cancelRendering (cyclomatic 19) web/pdf_page_view.js:932— PDFPageView.cancelRendering 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.
CaretBrowsingMode.moveCaret (cyclomatic 19) web/caret_browsing.js:261— CaretBrowsingMode.moveCaret 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.
SignatureManager.#initDrawTab (cyclomatic 19) web/signature_manager.js:387— SignatureManager.#initDrawTab 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 4 function items inside it that branch (a function literal at line 456, drawCallback, a function literal at line 484, …). 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.
ViewsManager.switchView (cyclomatic 19) web/views_manager.js:229— ViewsManager.switchView 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.
#setScaleUpdatePages (cyclomatic 19) web/pdf_viewer.js:1573— #setScaleUpdatePages 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.
#setupEventListeners (cyclomatic 19) web/internal/page_view.js:450— #setupEventListeners has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 571, a function literal at line 468, a function literal at line 536, …). 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.
contentscript.watchObjectOrEmbed (cyclomatic 18) REDACTED:40— contentscript.watchObjectOrEmbed has cyclomatic complexity 18 (threshold 15). 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, 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.
core_utils.escapePDFName (cyclomatic 18) REDACTED:353— core_utils.escapePDFName 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.
Linearization.create (cyclomatic 18) src/core/parser.js:1379— Linearization.create has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 belong to 2 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.
fonts.adjustMapping (cyclomatic 18) src/core/fonts.js:463— fonts.adjustMapping has cyclomatic complexity 18 (threshold 15). Of this number, 15 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.
RadialAxialShading.constructor (cyclomatic 18) src/core/pattern.js:169— RadialAxialShading.constructor 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.
Lexer.next (cyclomatic 18) src/core/postscript/lexer.js:175— Lexer.next has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PSStackToTree._makeUnary (cyclomatic 18) src/core/postscript/ast.js:1276— PSStackToTree._makeUnary 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.
XMLParserBase._parseContent (cyclomatic 18) src/core/xml_parser.js:80— XMLParserBase._parseContent has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
XRef.readXRefStream (cyclomatic 18) src/core/xref.js:347— XRef.readXRefStream 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.
xhtml.mapStyle (cyclomatic 18) src/core/xfa/xhtml.js:116— xhtml.mapStyle 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.
ButtonWidgetAnnotation._processCheckBox (cyclomatic 18) src/core/annotation.js:3688— ButtonWidgetAnnotation._processCheckBox 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.
PDFEditor.#postCollectPageData (cyclomatic 18) src/core/editor/pdf_editor.js:1223— PDFEditor.#postCollectPageData 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 one function literal inside it that branches (line 1247). 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.
FreeTextEditor.editorDivPaste (cyclomatic 18) src/display/editor/freetext.js:662— FreeTextEditor.editorDivPaste 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.
ui_utils.getVisibleElements (cyclomatic 18) web/ui_utils.js:435— ui_utils.getVisibleElements 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TextLayer.#appendText (cyclomatic 18) src/display/text_layer.js:309— TextLayer.#appendText 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.
Doc.resetForm (cyclomatic 18) src/scripting_api/doc.js:1293— Doc.resetForm 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.
draw_ops_view.formatArg (cyclomatic 18) web/internal/draw_ops_view.js:169— draw_ops_view.formatArg 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
_getContentType (cyclomatic 18) src/core/annotation.js:5591— _getContentType has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
core_utils.deepCompare (cyclomatic 17) REDACTED:208— core_utils.deepCompare 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.
ColorSpaceUtils.parse (cyclomatic 17) src/core/colorspace_utils.js:35— ColorSpaceUtils.parse 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.
SimpleGlyph.write (cyclomatic 17) src/core/glyf.js:404— SimpleGlyph.write 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.
PartialEvaluator.buildToUnicode (cyclomatic 17) src/core/evaluator.js:3973— PartialEvaluator.buildToUnicode has cyclomatic complexity 17 (threshold 15). Of this number, 14 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.
SimpleDOMNode.searchNode (cyclomatic 17) src/core/xml_parser.js:349— SimpleDOMNode.searchNode has cyclomatic complexity 17 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
StructTreeRoot.canUpdateStructTree (cyclomatic 17) src/core/struct_tree.js:267— StructTreeRoot.canUpdateStructTree 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.
XRef.readXRef (cyclomatic 17) src/core/xref.js:735— XRef.readXRef 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.
Annotation.setLineEndings (cyclomatic 17) src/core/annotation.js:1077— Annotation.setLineEndings has cyclomatic complexity 17 (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 is NOT this file's highest cyclomatic complexity: MediaAnnotation._getContentType (cyclomatic 18) 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.
FreeTextAnnotation.createNewAppearanceStream (cyclomatic 17) src/core/annotation.js:4468— FreeTextAnnotation.createNewAppearanceStream 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. This is NOT this file's highest cyclomatic complexity: MediaAnnotation._getContentType (cyclomatic 18) 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.
CanvasDependencyTracker.recordCharacterBBox (cyclomatic 17) src/display/canvas_dependency_tracker.js:640— CanvasDependencyTracker.recordCharacterBBox 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.
CommentPopup.toggle (cyclomatic 17) web/comment_manager.js:1093— CommentPopup.toggle 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.
AnnotationLayer.render (cyclomatic 17) src/display/annotation_layer.js:4031— AnnotationLayer.render 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 is NOT this file's highest cyclomatic complexity: AnnotationElementFactory.create (cyclomatic 28) 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.
AForm.AFNumber_Format (cyclomatic 17) src/scripting_api/aform.js:105— AForm.AFNumber_Format 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.
PDFFindController.#convertToRegExpString (cyclomatic 17) REDACTED:679— PDFFindController.#convertToRegExpString has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 693, addExtraWhitespaces). 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.
Menu.#setUpMenu (cyclomatic 17) web/menu.js:114— Menu.#setUpMenu 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 3 function literals inside it that branch (lines 174, 129, 115). 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.
PDFPageView.update (cyclomatic 17) web/pdf_page_view.js:784— PDFPageView.update 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.
PDFHistory.push (cyclomatic 17) web/pdf_history.js:193— PDFHistory.push 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.
pdf_history.isDestArraysEqual (cyclomatic 17) web/pdf_history.js:715— pdf_history.isDestArraysEqual has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (isEntryEqual). 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.
FontView.#render (cyclomatic 17) web/internal/font_view.js:167— FontView.#render has cyclomatic complexity 17 (threshold 15). Of this number, 14 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.
TreeView.#renderValue (cyclomatic 17) web/internal/tree_view.js:639— TreeView.#renderValue 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.
endGroup (cyclomatic 17) REDACTED:3616— endGroup 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.
initialize (cyclomatic 17) REDACTED:206— initialize 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.
bindWindowEvents (cyclomatic 17) REDACTED:2513— bindWindowEvents 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 10 function items inside it that branch (scroll, scrollend, addWindowResolutionChange, …). 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.
serialize (cyclomatic 17) src/display/editor/stamp.js:831— serialize 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.
setOperatorBBoxes (cyclomatic 17) web/debugger.mjs:441— setOperatorBBoxes has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 493, 468). 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.
#rebuildMultilineView (cyclomatic 17) web/internal/draw_ops_view.js:521— #rebuildMultilineView has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 547, a function literal at line 524, getText, …). 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.
#setup (cyclomatic 17) src/display/renderer_worker.js:317— #setup 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 8 function literals inside it that branch (lines 467, 367, 318, …). 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.
postScriptToJSCode (cyclomatic 17) src/core/internal_viewer_utils.js:436— postScriptToJSCode has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (ensureShared, a function literal at line 447, a function literal at line 492). 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. This is NOT this file's highest cyclomatic complexity: _unaryToExpr (cyclomatic 18) 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.
createEvent (cyclomatic 17) src/scripting_api/event.js:31— createEvent 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.
gulpfile.collectArgs (cyclomatic 16) gulpfile.mjs:946— gulpfile.collectArgs 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.
ColorSpace.fillRgb (cyclomatic 16) src/core/colorspace.js:237— ColorSpace.fillRgb 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.
PredictorStream.readBlockTiff (cyclomatic 16) src/core/predictor_stream.js:51— PredictorStream.readBlockTiff 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.
CFFParser.parse (cyclomatic 16) REDACTED:291— CFFParser.parse 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.
CFFParser.parseDict (cyclomatic 16) REDACTED:455— CFFParser.parseDict 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 2 function items inside it that branch (parseOperand, parseFloatOperand). 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.
CFFParser.parseCharsets (cyclomatic 16) REDACTED:1045— CFFParser.parseCharsets 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.
CFFCompiler.compileNameIndex (cyclomatic 16) REDACTED:1816— CFFCompiler.compileNameIndex 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.
font_substitutions.generateFont (cyclomatic 16) src/core/font_substitutions.js:643— font_substitutions.generateFont 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.
StructTreeRoot.getElementsForPage (cyclomatic 16) src/core/struct_tree.js:106— StructTreeRoot.getElementsForPage 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 one function item inside it that branches (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.
XFAObject.[_getPrototype] (cyclomatic 16) src/core/xfa/xfa_object.js:468— XFAObject.[_getPrototype] 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.
Caption.[$toHTML] (cyclomatic 16) src/core/xfa/template.js:1195— Caption.[$toHTML] has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Draw.[$toHTML] (cyclomatic 16) src/core/xfa/template.js:1894— Draw.[$toHTML] 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.
AnnotationFactory.printNewAnnotations (cyclomatic 16) src/core/annotation.js:484— AnnotationFactory.printNewAnnotations 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 is NOT this file's highest cyclomatic complexity: MediaAnnotation._getContentType (cyclomatic 18) 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.
InkAnnotation.constructor (cyclomatic 16) src/core/annotation.js:4875— InkAnnotation.constructor 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 branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: MediaAnnotation._getContentType (cyclomatic 18) 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.
ChunkedStreamManager.onReceiveData (cyclomatic 16) src/core/chunked_stream.js:437— ChunkedStreamManager.onReceiveData 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.
SingleIntersector.#intersects (cyclomatic 16) src/core/intersector.js:65— SingleIntersector.#intersects 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.
PDFEditor.#makeOutline::fillItems (cyclomatic 16) src/core/editor/pdf_editor.js:1925— PDFEditor.#makeOutline::fillItems 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.
AnnotationEditorUIManager.#selectionChange (cyclomatic 16) src/display/editor/tools.js:1519— AnnotationEditorUIManager.#selectionChange has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LinkAnnotationElement.render (cyclomatic 16) src/display/annotation_layer.js:967— LinkAnnotationElement.render 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 is NOT this file's highest cyclomatic complexity: AnnotationElementFactory.create (cyclomatic 28) 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.
AnnotationLayer.#setAnnotationCanvasMap (cyclomatic 16) src/display/annotation_layer.js:4292— AnnotationLayer.#setAnnotationCanvasMap 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 is NOT this file's highest cyclomatic complexity: AnnotationElementFactory.create (cyclomatic 28) 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.
PDFFindController.#onFind (cyclomatic 16) REDACTED:492— PDFFindController.#onFind 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 one function literal inside it that branches (line 507). 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.
PDFThumbnailViewer.#addDragListeners (cyclomatic 16) web/pdf_thumbnail_viewer.js:1525— PDFThumbnailViewer.#addDragListeners has cyclomatic complexity 16 (threshold 15). 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 literals inside it that branch (lines 1529, 1577, 1641, …). 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.
PDFPageView.cssTransform (cyclomatic 16) web/pdf_page_view.js:983— PDFPageView.cssTransform 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.
PDFPresentationMode.#touchSwipe (cyclomatic 16) web/pdf_presentation_mode.js:296— PDFPresentationMode.#touchSwipe 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.
_prepareSMaskCanvas (cyclomatic 16) REDACTED:1353— _prepareSMaskCanvas 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.
extractPages (cyclomatic 16) src/display/api.js:2891— extractPages 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.
renderDocs (cyclomatic 16) gulpfile.mjs:3387— renderDocs has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 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.
PartialEvaluator.getOperatorList (cognitive 242) src/core/evaluator.js:1692— PartialEvaluator.getOperatorList has cognitive complexity 242 (threshold 15). Drivers by points: if/else 78 (224 pts), boolean chains 6, loops 4 (6 pts), error handling 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 151). Most of this is not in the body itself: 9 of the 242 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 1755, a function literal at line 1798, a function literal at line 2200, …). 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.
checkAndRepair (cognitive 188) src/core/fonts.js:1418— checkAndRepair has cognitive complexity 188 (threshold 15). Drivers by points: if/else 206 (392 pts), loops 54 (117 pts), boolean chains 76, ternaries 10 (20 pts), error handling 2 (4 pts), match/switch 2, other 2 (nesting depth added 261). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
getOperatorList::promiseBody (cognitive 187) src/core/evaluator.js:1755— getOperatorList::promiseBody has cognitive complexity 187 (threshold 15). Drivers by points: if/else 53 (164 pts), error handling 4 (13 pts), loops 2 (4 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 125). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render (cognitive 183) src/display/annotation_layer.js:1486— render has cognitive complexity 183 (threshold 15). Drivers by points: if/else 48 (130 pts), boolean chains 18, loops 3 (14 pts), ternaries 3 (13 pts), match/switch 1 (4 pts), other 4 (nesting depth added 106). Of this number, 55 points are the body's own statements and 128 belong to 16 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.
createDocumentHandler (cognitive 183) src/core/worker.js:98— createDocumentHandler has cognitive complexity 183 (threshold 15). Drivers by points: if/else 70 (110 pts), loops 15 (24 pts), boolean chains 18, error handling 8 (18 pts), ternaries 6 (10 pts), other 3 (nesting depth added 63). Most of this is not in the body itself: 13 of the 183 points are its own statements and the rest belongs to 86 function items inside it that branch (a function literal at line 722, a function literal at line 579, getPdfManager::readData, …). 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.
#mergeStructTrees (cognitive 168) src/core/editor/pdf_editor.js:1363— #mergeStructTrees has cognitive complexity 168 (threshold 15). Drivers by points: if/else 41 (111 pts), loops 15 (39 pts), boolean chains 12, ternaries 2 (5 pts), other 1 (nesting depth added 97). Of this number, 142 points are the body's own statements and 26 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.
bidi (cognitive 147) src/core/bidi.js:120— bidi has cognitive complexity 147 (threshold 15). Drivers by points: if/else 42 (89 pts), loops 19 (28 pts), boolean chains 23, ternaries 3 (7 pts) (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
onKeyDown (cognitive 142) REDACTED:3258— onKeyDown has cognitive complexity 142 (threshold 15). Drivers by points: if/else 43 (100 pts), boolean chains 27, match/switch 5 (11 pts), ternaries 4 (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.
optimize.optimizeCMap (cognitive 138) external/cmapscompress/optimize.mjs:16— optimize.optimizeCMap has cognitive complexity 138 (threshold 15). Drivers by points: if/else 19 (62 pts), loops 18 (58 pts), boolean chains 12, ternaries 2 (6 pts) (nesting depth added 87). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PDFEditor.#cloneStructTreeNode (cognitive 121) src/core/editor/pdf_editor.js:562— PDFEditor.#cloneStructTreeNode has cognitive complexity 121 (threshold 15). Drivers by points: if/else 35 (87 pts), ternaries 5 (12 pts), boolean chains 11, loops 5 (11 pts) (nesting depth added 65). 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.
parseDestDictionary (cognitive 120) src/core/catalog.js:1806— parseDestDictionary has cognitive complexity 120 (threshold 15). Drivers by points: if/else 42 (94 pts), boolean chains 7, match/switch 2 (7 pts), loops 2 (6 pts), error handling 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 65). 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.
compileCharString::parse (cognitive 119) src/core/font_renderer.js:382— compileCharString::parse has cognitive complexity 119 (threshold 15). Drivers by points: if/else 23 (66 pts), loops 11 (31 pts), ternaries 4 (16 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 78). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
indexObjects (cognitive 118) src/core/xref.js:432— indexObjects has cognitive complexity 118 (threshold 15). Drivers by points: if/else 36 (80 pts), loops 10 (16 pts), boolean chains 13, error handling 3 (9 pts) (nesting depth added 56). Of this number, 108 points are the body's own statements and 10 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.
(computed) (cognitive 117) src/core/xfa/template.js:2741— (computed) has cognitive complexity 117 (threshold 15). Drivers by points: if/else 49 (81 pts), ternaries 7 (19 pts), boolean chains 11, match/switch 3 (6 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#selectionChange (cognitive 117) src/display/draw_layer.js:377— #selectionChange has cognitive complexity 117 (threshold 15). Drivers by points: if/else 37 (91 pts), loops 7 (13 pts), boolean chains 9, ternaries 1 (4 pts) (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.
_makeBinary (cognitive 116) src/core/postscript/ast.js:1043— _makeBinary has cognitive complexity 116 (threshold 15). Drivers by points: if/else 38 (100 pts), boolean chains 7, match/switch 3 (6 pts), ternaries 1 (3 pts) (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extractWidths (cognitive 114) src/core/evaluator.js:4141— extractWidths has cognitive complexity 114 (threshold 15). Drivers by points: if/else 26 (73 pts), loops 8 (33 pts), ternaries 3 (8 pts) (nesting depth added 77). 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.
preEvaluateFont (cognitive 112) src/core/evaluator.js:4333— preEvaluateFont has cognitive complexity 112 (threshold 15). Drivers by points: if/else 30 (65 pts), loops 6 (25 pts), ternaries 5 (13 pts), boolean chains 9 (nesting depth added 62). 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.
_initializeViewerComponents (cognitive 108) REDACTED:418— _initializeViewerComponents has cognitive complexity 108 (threshold 15). Drivers by points: if/else 40 (58 pts), boolean chains 25, ternaries 10 (17 pts), loops 2 (5 pts), error handling 1 (2 pts), other 1 (nesting depth added 29). Of this number, 85 points are the body's own statements and 23 belong to 12 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.
_evalBlockFrom (cognitive 108) src/core/postscript/ast.js:679— _evalBlockFrom has cognitive complexity 108 (threshold 15). Drivers by points: if/else 19 (71 pts), loops 8 (34 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 79). 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.
checkAndRepair::readCmapTable (cognitive 107) src/core/fonts.js:1602— checkAndRepair::readCmapTable has cognitive complexity 107 (threshold 15). Drivers by points: if/else 27 (54 pts), loops 17 (36 pts), boolean chains 10, ternaries 2 (7 pts) (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#parseCharString (cognitive 107) REDACTED:613— #parseCharString has cognitive complexity 107 (threshold 15). Drivers by points: if/else 35 (78 pts), ternaries 4 (15 pts), boolean chains 13, loops 1 (nesting depth added 54). 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.
createImageData (cognitive 105) src/core/image.js:776— createImageData has cognitive complexity 105 (threshold 15). Drivers by points: if/else 29 (63 pts), boolean chains 19, match/switch 2 (8 pts), ternaries 3 (8 pts), loops 1 (4 pts), other 3 (nesting depth added 48). 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.
_bindElement (cognitive 105) src/core/xfa/bind.js:475— _bindElement has cognitive complexity 105 (threshold 15). Drivers by points: if/else 29 (81 pts), ternaries 3 (13 pts), loops 2 (5 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 67). 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.
translateFont (cognitive 104) src/core/evaluator.js:4496— translateFont has cognitive complexity 104 (threshold 15). Drivers by points: if/else 44 (79 pts), ternaries 4 (10 pts), boolean chains 9, loops 2 (5 pts), error handling 1 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(computed) (cognitive 99) src/core/xfa/template.js:5410— (computed) has cognitive complexity 99 (threshold 15). Drivers by points: if/else 35 (82 pts), ternaries 2 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 56). Of this number, 97 points are the body's own statements and 2 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.
Field.[$toHTML] (cognitive 97) src/core/xfa/template.js:2741— Field.[$toHTML] has cognitive complexity 97 (threshold 15). Drivers by points: if/else 49 (81 pts), boolean chains 8, match/switch 3 (6 pts), ternaries 2 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimpleExprParser.parse (cognitive 94) src/core/xfa/formcalc_parser.js:277— SimpleExprParser.parse has cognitive complexity 94 (threshold 15). Drivers by points: if/else 32 (90 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
constructor (cognitive 91) src/core/image.js:143— constructor has cognitive complexity 91 (threshold 15). Drivers by points: if/else 30 (52 pts), ternaries 6 (19 pts), boolean chains 13, match/switch 2 (5 pts), loops 1 (2 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialEvaluator.hasBlendModes (cognitive 90) src/core/evaluator.js:287— PartialEvaluator.hasBlendModes has cognitive complexity 90 (threshold 15). Drivers by points: if/else 20 (65 pts), loops 5 (12 pts), error handling 2 (9 pts), boolean chains 4 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Type1CharString.convert (cognitive 89) src/core/type1_parser.js:107— Type1CharString.convert has cognitive complexity 89 (threshold 15). Drivers by points: if/else 27 (82 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Template.[$toPages] (cognitive 89) src/core/xfa/template.js:5410— Template.[$toPages] has cognitive complexity 89 (threshold 15). Drivers by points: if/else 35 (82 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 48). Of this number, 87 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.
findDefaultInlineStreamEnd (cognitive 85) src/core/parser.js:202— findDefaultInlineStreamEnd has cognitive complexity 85 (threshold 15). Drivers by points: if/else 19 (58 pts), ternaries 3 (13 pts), loops 3 (9 pts), boolean chains 5 (nesting depth added 55). 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.
buildPaintImageXObject (cognitive 80) src/core/evaluator.js:613— buildPaintImageXObject has cognitive complexity 80 (threshold 15). Drivers by points: if/else 31 (60 pts), boolean chains 14, error handling 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 31). Of this number, 75 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.
compileType3Glyph (cognitive 78) src/core/fonts_utils.js:230— compileType3Glyph has cognitive complexity 78 (threshold 15). Drivers by points: if/else 16 (28 pts), ternaries 9 (25 pts), loops 12 (21 pts), boolean chains 4 (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.
showText (cognitive 77) REDACTED:2785— showText has cognitive complexity 77 (threshold 15). Drivers by points: if/else 30 (50 pts), boolean chains 12, ternaries 5 (11 pts), loops 2 (3 pts), other 1 (nesting depth added 27). Of this number, 76 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.
#findContours (cognitive 76) src/display/editor/drawers/signaturedraw.js:83— #findContours has cognitive complexity 76 (threshold 15). Drivers by points: if/else 17 (47 pts), ternaries 4 (14 pts), loops 7 (12 pts), boolean chains 3 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parseXml (cognitive 76) src/core/xml_parser.js:174— parseXml has cognitive complexity 76 (threshold 15). Drivers by points: if/else 16 (53 pts), ternaries 3 (14 pts), loops 2 (4 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 52). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
getPageDict (cognitive 75) src/core/catalog.js:1297— getPageDict has cognitive complexity 75 (threshold 15). Drivers by points: if/else 21 (64 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 44). 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.
preprocess (cognitive 75) REDACTED:35— preprocess has cognitive complexity 75 (threshold 15). Drivers by points: if/else 23 (45 pts), ternaries 6 (13 pts), boolean chains 11, match/switch 1 (3 pts), error handling 2, loops 1 (nesting depth added 31). Of this number, 58 points are the body's own statements and 17 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.
#cloneFields (cognitive 73) src/core/editor/pdf_editor.js:2196— #cloneFields has cognitive complexity 73 (threshold 15). Drivers by points: if/else 24 (54 pts), loops 6 (10 pts), boolean chains 9 (nesting depth added 34). Of this number, 64 points are the body's own statements and 9 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.
fallbackToSystemFont (cognitive 72) src/core/fonts.js:1246— fallbackToSystemFont has cognitive complexity 72 (threshold 15). Drivers by points: if/else 23 (47 pts), boolean chains 14, loops 3 (9 pts), ternaries 1 (2 pts) (nesting depth added 31). Of this number, 66 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
compileGlyf (cognitive 71) src/core/font_renderer.js:163— compileGlyf has cognitive complexity 71 (threshold 15). Drivers by points: if/else 24 (45 pts), loops 9 (20 pts), match/switch 2 (6 pts) (nesting depth added 36). Of this number, 70 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.
extractCidKeyedFontProgram (cognitive 70) src/core/type1_parser.js:778— extractCidKeyedFontProgram has cognitive complexity 70 (threshold 15). Drivers by points: if/else 20 (37 pts), boolean chains 14, loops 7 (11 pts), ternaries 3 (6 pts), match/switch 1 (2 pts) (nesting depth added 25). Of this number, 68 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.
#walk (cognitive 69) web/struct_tree_layer_builder.js:556— #walk has cognitive complexity 69 (threshold 15). Drivers by points: if/else 24 (50 pts), boolean chains 10, loops 3 (9 pts) (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
extractDataStructures (cognitive 68) src/core/evaluator.js:3657— extractDataStructures has cognitive complexity 68 (threshold 15). Drivers by points: if/else 27 (50 pts), boolean chains 9, loops 1 (4 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PDFViewer.#getPageAdvance (cognitive 67) web/pdf_viewer.js:2442— PDFViewer.#getPageAdvance has cognitive complexity 67 (threshold 15). Drivers by points: if/else 16 (46 pts), loops 5 (14 pts), boolean chains 4, ternaries 1 (2 pts), match/switch 1 (nesting depth added 40). 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.
(computed) (cognitive 65) src/core/xfa/template.js:4969— (computed) has cognitive complexity 65 (threshold 15). Drivers by points: if/else 33 (47 pts), boolean chains 16, loops 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extractPages (cognitive 64) src/core/editor/pdf_editor.js:984— extractPages has cognitive complexity 64 (threshold 15). Drivers by points: if/else 22 (44 pts), loops 8 (16 pts), boolean chains 2, other 1, ternaries 1 (nesting depth added 30). Of this number, 61 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.
EvaluatorPreprocessor.read (cognitive 63) src/core/evaluator.js:5437— EvaluatorPreprocessor.read has cognitive complexity 63 (threshold 15). Drivers by points: if/else 14 (46 pts), loops 3 (11 pts), boolean chains 3, ternaries 1 (3 pts) (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.
Subform.[$toHTML] (cognitive 63) src/core/xfa/template.js:4969— Subform.[$toHTML] has cognitive complexity 63 (threshold 15). Drivers by points: if/else 33 (47 pts), boolean chains 14, loops 1, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
getDocument (cognitive 63) src/display/api.js:228— getDocument has cognitive complexity 63 (threshold 15). Drivers by points: boolean chains 24, ternaries 21, if/else 11 (14 pts), error handling 2 (3 pts), other 1 (nesting depth added 4). Of this number, 49 points are the body's own statements and 14 belong to 3 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.
constructor (cognitive 63) REDACTED:1081— constructor has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (43 pts), boolean chains 15, ternaries 1 (3 pts), loops 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.
#parse (cognitive 63) src/core/colorspace_utils.js:128— #parse has cognitive complexity 63 (threshold 15). Drivers by points: if/else 16 (51 pts), error handling 1 (4 pts), match/switch 2 (4 pts), ternaries 1 (3 pts), boolean chains 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.
PSStackToTree._evalOp (cognitive 60) src/core/postscript/ast.js:822— PSStackToTree._evalOp has cognitive complexity 60 (threshold 15). Drivers by points: if/else 29 (55 pts), boolean chains 4, match/switch 1 (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.
extractFontProgram (cognitive 60) src/core/type1_parser.js:584— extractFontProgram has cognitive complexity 60 (threshold 15). Drivers by points: if/else 13 (36 pts), ternaries 3 (10 pts), loops 4 (8 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
setHash (cognitive 60) web/pdf_link_service.js:358— setHash has cognitive complexity 60 (threshold 15). Drivers by points: if/else 20 (33 pts), ternaries 5 (19 pts), boolean chains 7, error handling 1 (nesting depth added 27). 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.
fillGrayBuffer (cognitive 59) src/core/image.js:1058— fillGrayBuffer has cognitive complexity 59 (threshold 15). Drivers by points: loops 10 (35 pts), if/else 13 (18 pts), boolean chains 2, other 2, ternaries 2 (nesting depth added 30). 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.
parseCMap (cognitive 59) external/cmapscompress/compress.mjs:159— parseCMap has cognitive complexity 59 (threshold 15). Drivers by points: loops 15 (28 pts), ternaries 7 (20 pts), if/else 3 (5 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 31). Of this number, 44 points are the body's own statements and 15 belong to 7 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.
babel-plugin-pdfjs-preprocessor.babelPluginPDFJSPreprocessor (cognitive 58) external/builder/babel-plugin-pdfjs-preprocessor.mjs:49— babel-plugin-pdfjs-preprocessor.babelPluginPDFJSPreprocessor has cognitive complexity 58 (threshold 15). Drivers by points: if/else 25 (34 pts), boolean chains 12, loops 3 (4 pts), match/switch 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 13). Of this number, 56 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.
layout.checkDimensions (cognitive 58) src/core/xfa/layout.js:262— layout.checkDimensions has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (49 pts), boolean chains 8, match/switch 1 (nesting depth added 30). 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.
OptionalContentConfig.isVisible (cognitive 58) src/display/optional_content_config.js:186— OptionalContentConfig.isVisible has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (45 pts), loops 4 (12 pts), boolean chains 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
printf (cognitive 58) REDACTED:55— printf has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23 (34 pts), ternaries 5 (11 pts), loops 3 (6 pts), boolean chains 4, match/switch 1 (3 pts) (nesting depth added 22). Most of this is not in the body itself: 2 of the 58 points are its own statements and the rest belongs to one function literal inside it that branches (line 73). 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.
#resolveInsertAfterIndices (cognitive 57) src/core/editor/pdf_editor.js:844— #resolveInsertAfterIndices has cognitive complexity 57 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 10 (20 pts), boolean chains 8, ternaries 1 (4 pts) (nesting depth added 25). Of this number, 48 points are the body's own statements and 9 belong to 6 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.
#makePageCopy (cognitive 56) src/core/editor/pdf_editor.js:2436— #makePageCopy has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 9 (15 pts), boolean chains 10, other 1, ternaries 1 (nesting depth added 20). Of this number, 50 points are the body's own statements and 6 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.
FlateStream.#readBlock (cognitive 55) src/core/flate_stream.js:310— FlateStream.#readBlock has cognitive complexity 55 (threshold 15). Drivers by points: if/else 24 (43 pts), loops 4 (8 pts), boolean chains 2, error handling 1, ternaries 1 (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.
Catalog.#getDestFromStructElement (cognitive 55) src/core/catalog.js:1695— Catalog.#getDestFromStructElement has cognitive complexity 55 (threshold 15). Drivers by points: if/else 19 (46 pts), loops 3 (7 pts), boolean chains 2 (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.
WidgetAnnotation._getAppearance (cognitive 55) src/core/annotation.js:2387— WidgetAnnotation._getAppearance has cognitive complexity 55 (threshold 15). Drivers by points: if/else 29 (34 pts), boolean chains 13, loops 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
viewerPreferences (cognitive 55) src/core/catalog.js:968— viewerPreferences has cognitive complexity 55 (threshold 15). Drivers by points: if/else 10 (27 pts), match/switch 6 (22 pts), boolean chains 5, loops 1 (nesting depth added 33). Of this number, 52 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.
pruneCompositeGlyphCycles (cognitive 54) src/core/glyf.js:695— pruneCompositeGlyphCycles has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 7 (11 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#enableGlobalSelectionListener (cognitive 54) web/text_layer_builder.js:211— #enableGlobalSelectionListener has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 12, loops 6 (11 pts), ternaries 4 (7 pts) (nesting depth added 14). Most of this is not in the body itself: 4 of the 54 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 271, reset, a function literal at line 256, …). 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.
executeOperatorList (cognitive 53) REDACTED:730— executeOperatorList has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (36 pts), ternaries 2 (6 pts), loops 2 (5 pts), boolean chains 4, other 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
writeStream (cognitive 52) src/core/writer.js:54— writeStream has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (24 pts), ternaries 6 (17 pts), boolean chains 7, error handling 2 (4 pts) (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.
Catalog.getAllPageDicts (cognitive 51) src/core/catalog.js:1432— Catalog.getAllPageDicts has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (29 pts), error handling 4 (13 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (nesting depth added 24). Of this number, 45 points are the body's own statements and 6 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.
constructor (cognitive 51) web/pdf_viewer.js:310— constructor has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 29, if/else 12 (14 pts), other 7, ternaries 1 (nesting depth added 2). Of this number, 50 points are the body's own statements and 1 belongs 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.
getOperatorList (cognitive 51) src/core/document.js:479— getOperatorList has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 10, loops 5 (9 pts), error handling 1 (3 pts), ternaries 1 (nesting depth added 22). Of this number, 47 points are the body's own statements and 4 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.
StructElementNode.tableAttributes (cognitive 50) src/core/struct_tree.js:756— StructElementNode.tableAttributes has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (39 pts), boolean chains 7, loops 2 (3 pts), ternaries 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.
BinaryCMapReader.process (cognitive 47) src/core/binary_cmap.js:142— BinaryCMapReader.process has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 7 (19 pts), match/switch 2 (5 pts), ternaries 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser.getObj (cognitive 47) src/core/parser.js:121— Parser.getObj has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 2 (6 pts), ternaries 2 (6 pts), boolean chains 3, match/switch 1 (2 pts) (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.
PartialEvaluator._simpleFontToUnicode (cognitive 47) src/core/evaluator.js:3862— PartialEvaluator._simpleFontToUnicode has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (35 pts), boolean chains 5, match/switch 2 (5 pts), loops 2 (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.
normalize (cognitive 47) REDACTED:94— normalize has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (27 pts), loops 8 (13 pts), ternaries 2 (4 pts), boolean chains 2, other 1 (nesting depth added 14). Of this number, 19 points are the body's own statements and 28 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.
constructor (cognitive 46) src/core/annotation.js:2899— constructor has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 13, ternaries 4 (10 pts), other 2, loops 1 (nesting depth added 12). Of this number, 44 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.
setDocument (cognitive 46) web/pdf_viewer.js:914— setDocument has cognitive complexity 46 (threshold 15). Drivers by points: if/else 29 (37 pts), boolean chains 3, error handling 2, loops 2, ternaries 2 (nesting depth added 8). Most of this is not in the body itself: 8 of the 46 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 998, a function literal at line 1152, onAfterDraw, …). 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.
layoutNode (cognitive 46) src/core/xfa/html_utils.js:207— layoutNode has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 5 (15 pts), boolean chains 7, loops 1 (3 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.
getPageIndex (cognitive 45) src/core/catalog.js:1564— getPageIndex has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (38 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 23). Of this number, 34 points are the body's own statements and 11 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.
SimpleDOMNode.searchNode (cognitive 44) src/core/xml_parser.js:349— SimpleDOMNode.searchNode has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 26). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
_bindResetFormAction::onclick (cognitive 44) src/display/annotation_layer.js:1189— _bindResetFormAction::onclick has cognitive complexity 44 (threshold 15). Drivers by points: loops 10 (23 pts), if/else 7 (14 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 21). 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.
execute (cognitive 44) src/core/postscript/js_evaluator.js:324— execute has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 11 (33 pts), if/else 4 (8 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compressCmap (cognitive 44) external/cmapscompress/compress.mjs:21— compressCmap has cognitive complexity 44 (threshold 15). Drivers by points: loops 7 (19 pts), ternaries 5 (18 pts), if/else 4 (5 pts), match/switch 1 (2 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
createCmapTable (cognitive 43) src/core/fonts.js:583— createCmapTable has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 6 (12 pts), ternaries 4, boolean chains 3, other 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.
Parser.#findStreamLength (cognitive 42) src/core/parser.js:616— Parser.#findStreamLength has cognitive complexity 42 (threshold 15). Drivers by points: if/else 6 (25 pts), loops 5 (15 pts), boolean chains 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotationEditorLayer.disable (cognitive 42) src/display/editor/annotation_editor_layer.js:304— AnnotationEditorLayer.disable has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 22). Of this number, 29 points are the body's own statements and 13 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.
ChoiceWidgetAnnotationElement.render (cognitive 42) src/display/annotation_layer.js:2162— ChoiceWidgetAnnotationElement.render has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 7 (12 pts), ternaries 3 (5 pts), boolean chains 3 (nesting depth added 14). Most of this is not in the body itself: 13 of the 42 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 2258, getValue, a function literal at line 2190, …). 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.
load (cognitive 42) REDACTED:1662— load has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 7, error handling 5, ternaries 2 (3 pts) (nesting depth added 9). Most of this is not in the body itself: 9 of the 42 points are its own statements and the rest belongs to 22 function items inside it that branch (a function literal at line 1755, a function literal at line 1864, a function literal at line 1668, …). 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· show (cognitive 42) · ×1
show (cognitive 42) web/internal/draw_ops_view.js:220— show has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (24 pts), ternaries 3 (9 pts), boolean chains 6, other 2, loops 1 (nesting depth added 17). Of this number, 28 points are the body's own statements and 14 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.
Catalog.#readPageLabels (cognitive 41) src/core/catalog.js:838— Catalog.#readPageLabels has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (36 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (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.
write (cognitive 41) src/core/glyf.js:404— write has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (25 pts), ternaries 2 (10 pts), loops 5 (6 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.
printx (cognitive 41) REDACTED:260— printx has cognitive complexity 41 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 5 (13 pts), boolean chains 9, match/switch 1 (2 pts), other 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
searchNode (cognitive 41) src/core/xfa/som.js:158— searchNode has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (24 pts), ternaries 3 (8 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 2 (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.
PDFEditor.#collectDependencies (cognitive 40) src/core/editor/pdf_editor.js:266— PDFEditor.#collectDependencies has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotationEditorUIManager.updateMode (cognitive 40) src/display/editor/tools.js:2111— AnnotationEditorUIManager.updateMode has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (29 pts), loops 6 (9 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventDispatcher.dispatch (cognitive 40) src/scripting_api/event.js:109— EventDispatcher.dispatch has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 4, loops 1 (3 pts), 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.
getScaleForStroking (cognitive 40) REDACTED:4410— getScaleForStroking has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 5 (21 pts), if/else 10 (18 pts), boolean chains 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.
setupMessageHandler (cognitive 40) src/display/api.js:2598— setupMessageHandler has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 5, error handling 5, other 1, ternaries 1 (nesting depth added 6). Most of this is not in the body itself: 4 of the 40 points are its own statements and the rest belongs to 28 function items inside it that branch (a function literal at line 2783, a function literal at line 2644, a function literal at line 2724, …). 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.
loadFont (cognitive 39) src/core/evaluator.js:1268— loadFont has cognitive complexity 39 (threshold 15). Drivers by points: if/else 19 (28 pts), error handling 4 (6 pts), boolean chains 5 (nesting depth added 11). Of this number, 36 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.
(computed) (cognitive 39) src/core/xfa/template.js:2443— (computed) has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 13, loops 1, ternaries 1 (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.
#execOp (cognitive 39) src/core/postscript/js_evaluator.js:537— #execOp has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 12 (24 pts), loops 2 (6 pts), if/else 2 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 19). 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.
fonts.adjustMapping (cognitive 38) src/core/fonts.js:463— fonts.adjustMapping has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (6 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 21). Of this number, 35 points are the body's own statements and 3 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.
content_disposition.getFilenameFromContentDispositionHeader (cognitive 38) REDACTED:30— content_disposition.getFilenameFromContentDispositionHeader has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (28 pts), loops 3 (4 pts), boolean chains 3, error handling 2 (3 pts) (nesting depth added 13). Most of this is not in the body itself: 3 of the 38 points are its own statements and the rest belongs to 7 function items inside it that branch (rfc2231getparam, rfc2616unquote, textdecode, …). 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.
PDFViewer.onPagesEdited (cognitive 38) web/pdf_viewer.js:1233— PDFViewer.onPagesEdited has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 5 (12 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
resolveCommonObject (cognitive 38) src/display/object_handler.js:43— resolveCommonObject has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (18 pts), boolean chains 7, error handling 2 (5 pts), loops 2 (5 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 19). Of this number, 32 points are the body's own statements and 6 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.
XRef.readXRefStream (cognitive 37) src/core/xref.js:347— XRef.readXRefStream has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 5 (12 pts), boolean chains 3, match/switch 1 (3 pts) (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.
Catalog.#readOptionalContentConfig (cognitive 37) src/core/catalog.js:608— Catalog.#readOptionalContentConfig has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 5 (7 pts), boolean chains 4, ternaries 4 (nesting depth added 10). Most of this is not in the body itself: 3 of the 37 points are its own statements and the rest belongs to 4 function items inside it that branch (parseOrder, parseRBGroups, parseOnOff, …). 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.
ObjectLoader.#walk (cognitive 37) src/core/object_loader.js:81— ObjectLoader.#walk has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 3 (7 pts), error handling 1 (3 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.
XfaLayer.setupStorage (cognitive 37) src/display/xfa_layer.js:151— XfaLayer.setupStorage has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (27 pts), ternaries 2 (5 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 20). Of this number, 32 points are the body's own statements and 5 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.
pdf_find_utils.getNormalizeWithNFKC (cognitive 37) web/pdf_find_utils.js:61— pdf_find_utils.getNormalizeWithNFKC has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 8, loops 2 (5 pts), ternaries 1 (2 pts) (nesting depth added 16). Of this number, 33 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.
beginGroup (cognitive 37) REDACTED:3353— beginGroup has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (21 pts), boolean chains 14, ternaries 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
#collectFieldObjects (cognitive 37) src/core/document.js:1856— #collectFieldObjects has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 3 (7 pts), boolean chains 4, loops 2 (4 pts), error handling 1, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fonts.createOS2Table (cognitive 36) src/core/fonts.js:793— fonts.createOS2Table has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 13, ternaries 3, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TreeView.#setupKeyboardNav (cognitive 36) web/internal/tree_view.js:120— TreeView.#setupKeyboardNav has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (27 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 12). None of this is in the body itself: all 36 points belong to one function literal inside it that branches (line 121). 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· save (cognitive 36) · ×1
save (cognitive 36) src/core/annotation.js:2250— save has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 9, ternaries 2 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
endGroup (cognitive 36) REDACTED:3616— endGroup has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (29 pts), ternaries 1 (4 pts), other 3 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
convert (cognitive 36) src/core/fonts.js:3296— convert has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 5 (8 pts), boolean chains 7, ternaries 3, other 2 (nesting depth added 10). Of this number, 19 points are the body's own statements and 17 belong to 6 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.
scrollPageIntoView (cognitive 36) web/pdf_viewer.js:1797— scrollPageIntoView has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 10, ternaries 4 (6 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.
#AFSpecial_KeystrokeEx_helper (cognitive 36) src/scripting_api/aform.js:445— #AFSpecial_KeystrokeEx_helper has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 9, loops 1 (nesting depth added 11). Of this number, 20 points are the body's own statements and 16 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.
PSStackToTree._makeTernary (cognitive 35) src/core/postscript/ast.js:1340— PSStackToTree._makeTernary has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 9, ternaries 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.
ExclGroup.[$toHTML] (cognitive 35) src/core/xfa/template.js:2443— ExclGroup.[$toHTML] has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 9, loops 1, ternaries 1 (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.
XfaLayer.setAttributes (cognitive 35) src/display/xfa_layer.js:222— XfaLayer.setAttributes has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 6, loops 2 (5 pts), match/switch 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.
_charToGlyph (cognitive 35) src/core/fonts.js:3573— _charToGlyph has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 8 (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.
PredictorStream.readBlockPng (cognitive 34) src/core/predictor_stream.js:137— PredictorStream.readBlockPng has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 8 (16 pts), boolean chains 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.
CFFParser.parsePrivateDict (cognitive 34) REDACTED:902— CFFParser.parsePrivateDict has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 2 (5 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StructTreeRoot.#collectParents (cognitive 34) src/core/struct_tree.js:523— StructTreeRoot.#collectParents has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 16). Of this number, 27 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.
toJSObject (cognitive 34) src/core/document.js:2300— toJSObject has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (2 pts), other 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#buildLine (cognitive 34) web/internal/draw_ops_view.js:638— #buildLine has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (20 pts), ternaries 3 (7 pts), boolean chains 4, loops 1 (2 pts), other 1 (nesting depth added 11). Of this number, 23 points are the body's own statements and 11 belong to 6 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.
prefs.buildPrefsSchema (cognitive 33) external/chromium/prefs.mjs:175— prefs.buildPrefsSchema has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 5 (8 pts), match/switch 2 (6 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.
string_utils.stringToPDFString (cognitive 33) src/core/string_utils.js:67— string_utils.stringToPDFString has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, ternaries 2 (5 pts), loops 2 (4 pts), error handling 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WidgetAnnotation._computeFontSize (cognitive 33) src/core/annotation.js:2712— WidgetAnnotation._computeFontSize has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (14 pts), boolean chains 2 (nesting depth added 20). Of this number, 26 points are the body's own statements and 7 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.
CanvasGraphics.paintChar (cognitive 33) REDACTED:2628— CanvasGraphics.paintChar has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 10 (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.
AnnotationLayer.render (cognitive 33) src/display/annotation_layer.js:4031— AnnotationLayer.render has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 2, loops 2 (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.
AnnotationLayer.#setAnnotationCanvasMap (cognitive 33) src/display/annotation_layer.js:4292— AnnotationLayer.#setAnnotationCanvasMap has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 5 (11 pts), ternaries 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SignaturePropertiesManager.#renderCard (cognitive 33) web/digital_signature_properties_manager.js:428— SignaturePropertiesManager.#renderCard has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (22 pts), boolean chains 7, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity· run (cognitive 33) · ×1
run (cognitive 33) REDACTED:948— run has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (22 pts), ternaries 1 (4 pts), boolean chains 3, loops 1 (2 pts), other 2 (nesting depth added 9). Of this number, 20 points are the body's own statements and 13 belong to 6 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.
_fillDownscaledRgba (cognitive 33) src/core/image.js:1225— _fillDownscaledRgba has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 7 (11 pts), boolean chains 3, ternaries 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.
gulpfile.collectArgs (cognitive 32) gulpfile.mjs:946— gulpfile.collectArgs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer.getObj (cognitive 32) src/core/parser.js:1236— Lexer.getObj has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 5, loops 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Font.constructor (cognitive 32) src/core/fonts.js:1055— Font.constructor has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, loops 2 (4 pts), ternaries 1 (2 pts), error handling 1, 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.
NameOrNumberTree.getAll (cognitive 32) src/core/name_number_tree.js:37— NameOrNumberTree.getAll has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (6 pts), ternaries 2 (6 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.
StructTreeRoot.#writeKids (cognitive 32) src/core/struct_tree.js:400— StructTreeRoot.#writeKids has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (28 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
extractPages (cognitive 32) src/display/api.js:2891— extractPages has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 2 (5 pts), boolean chains 2, ternaries 1 (2 pts), other 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
getNumber (cognitive 32) src/core/parser.js:949— getNumber has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
serializable::nodeToSerializable (cognitive 32) src/core/struct_tree.js:1128— serializable::nodeToSerializable has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 6, error handling 1 (2 pts), loops 2, ternaries 1 (2 pts), other 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.
createImage (cognitive 32) src/core/editor/pdf_images.js:155— createImage has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 4 (9 pts), ternaries 2 (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.
getHighestPriority (cognitive 32) web/pdf_rendering_queue.js:112— getHighestPriority has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), ternaries 3 (6 pts), loops 3 (5 pts), boolean chains 3 (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.
PredictorStream.readBlockTiff (cognitive 31) src/core/predictor_stream.js:51— PredictorStream.readBlockTiff has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 7 (15 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.
AnnotationLayer.#addElementsToDOM (cognitive 31) src/display/annotation_layer.js:4125— AnnotationLayer.#addElementsToDOM has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 4 (9 pts), boolean chains 6 (nesting depth added 10). Of this number, 16 points are the body's own statements and 15 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.
PDFOutlineViewer._getPageNumberToDestHash (cognitive 31) web/pdf_outline_viewer.js:334— PDFOutlineViewer._getPageNumberToDestHash has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 3, loops 2 (3 pts), ternaries 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.
resetForm (cognitive 31) src/scripting_api/doc.js:1293— resetForm has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (8 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render (cognitive 31) src/display/xfa_layer.js:317— render has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 3, loops 2, other 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.
moveCaret (cognitive 31) web/caret_browsing.js:261— moveCaret has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 6 (14 pts), loops 2, 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.
Type1Parser.extractFontHeader (cognitive 30) src/core/type1_parser.js:1037— Type1Parser.extractFontHeader has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (10 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XRef.readXRefTable (cognitive 30) src/core/xref.js:230— XRef.readXRefTable has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 6, match/switch 1 (4 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FontFinder.find (cognitive 30) src/core/xfa/fonts.js:82— FontFinder.find has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 4 (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.
ChoiceWidgetAnnotation._getAppearance (cognitive 30) src/core/annotation.js:4023— ChoiceWidgetAnnotation._getAppearance has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 4 (6 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextHighlighter._renderMatches (cognitive 30) web/text_highlighter.js:155— TextHighlighter._renderMatches has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 2 (4 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 10). Of this number, 26 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.
FontView.#render (cognitive 30) web/internal/font_view.js:167— FontView.#render has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 3 (6 pts), ternaries 2 (4 pts), boolean chains 1 (nesting depth added 14). Of this number, 24 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.
parseIf (cognitive 30) src/core/xfa/formcalc_parser.js:1136— parseIf has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 5, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer.getString (cognitive 29) src/core/parser.js:1025— Lexer.getString has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (21 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XFAObject.[_applyPrototype] (cognitive 29) src/core/xfa/xfa_object.js:552— XFAObject.[_applyPrototype] has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InkAnnotation.constructor (cognitive 29) src/core/annotation.js:4875— InkAnnotation.constructor has cognitive complexity 29 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 5 (9 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 14). Of this number, 20 points are the body's own statements and 9 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.
FreeTextEditor.editorDivPaste (cognitive 29) src/display/editor/freetext.js:662— FreeTextEditor.editorDivPaste has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Field.constructor (cognitive 29) src/scripting_api/field.js:111— Field.constructor has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 19, if/else 5 (8 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
buildFormXObject (cognitive 29) src/core/evaluator.js:477— buildFormXObject has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 8, ternaries 2 (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.
#makeOutline::fillItems (cognitive 29) src/core/editor/pdf_editor.js:1925— #makeOutline::fillItems has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 4 (11 pts), boolean chains 3, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parse (cognitive 29) src/core/struct_tree.js:964— parse has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (6 pts), boolean chains 5 (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.
readXRef (cognitive 29) src/core/xref.js:735— readXRef has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 3, error handling 1 (2 pts), 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.
(computed) (cognitive 29) src/core/xfa/xfa_object.js:552— (computed) has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
getPdfFilenameFromUrl (cognitive 29) REDACTED:107— getPdfFilenameFromUrl has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 5, loops 2 (5 pts), boolean chains 2, other 1 (nesting depth added 8). Of this number, 20 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.
CFFParser.parseCharsets (cognitive 28) REDACTED:1045— CFFParser.parseCharsets has cognitive complexity 28 (threshold 15). Drivers by points: loops 5 (12 pts), ternaries 4 (12 pts), if/else 3, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PDFScriptingManager.#updateFromSandbox (cognitive 28) web/pdf_scripting_manager.js:328— PDFScriptingManager.#updateFromSandbox has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 3, match/switch 1 (2 pts), loops 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.
handleBreak (cognitive 28) src/core/xfa/template.js:328— handleBreak has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 5, 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.
renderDocs (cognitive 28) gulpfile.mjs:3387— renderDocs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (7 pts), boolean chains 2, other 2 (nesting depth added 13). Of this number, 17 points are the body's own statements and 11 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.
startXRef (cognitive 28) src/core/document.js:1106— startXRef has cognitive complexity 28 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 6 (12 pts), boolean chains 2 (nesting depth added 15). 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.
reset (cognitive 28) web/pdf_page_view.js:648— reset has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 12, if/else 9 (12 pts), match/switch 1 (2 pts), loops 1, other 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.
#setAttributes (cognitive 28) web/struct_tree_layer_builder.js:373— #setAttributes has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 2 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_bindItems (cognitive 28) src/core/xfa/bind.js:274— _bindItems has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialEvaluator.handleColorN (cognitive 27) src/core/evaluator.js:1612— PartialEvaluator.handleColorN has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 3 (10 pts), error handling 1 (3 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.
StructTreeRoot.canUpdateStructTree (cognitive 27) src/core/struct_tree.js:267— StructTreeRoot.canUpdateStructTree has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 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.
XRef.fetchCompressed (cognitive 27) src/core/xref.js:960— XRef.fetchCompressed has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, loops 2, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RadialAxialShadingPattern.getPattern (cognitive 27) src/display/pattern_helper.js:215— RadialAxialShadingPattern.getPattern has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
setGState (cognitive 27) REDACTED:1225— setGState has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (17 pts), boolean chains 4, ternaries 1 (3 pts), match/switch 1 (2 pts), loops 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.
_parseHashParams (cognitive 27) REDACTED:288— _parseHashParams has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 3 (7 pts), boolean chains 3, ternaries 2 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 25 points are the body's own statements and 2 belong to 32 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.
onWheel (cognitive 27) REDACTED:3105— onWheel has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 12, if/else 7 (11 pts), ternaries 1 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#postCollectPageData (cognitive 27) src/core/editor/pdf_editor.js:1223— #postCollectPageData has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6, ternaries 3 (6 pts), loops 1 (nesting depth added 10). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 1247). 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.
draw (cognitive 27) web/pdf_page_view.js:1075— draw has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 7, ternaries 3 (nesting depth added 2). Of this number, 19 points are the body's own statements and 8 belong to 7 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.
parse (cognitive 27) src/core/glyf.js:270— parse has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 5 (7 pts), ternaries 2 (6 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.
computeBbox (cognitive 27) src/core/xfa/html_utils.js:290— computeBbox has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (8 pts), boolean chains 3 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
migration.chrome.runtime.onInstalled.addListener() (cognitive 26) extensions/chromium/options/migration.js:18— migration.chrome.runtime.onInstalled.addListener() has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 92, 33, 55, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
PDFImage.getComponents (cognitive 26) src/core/image.js:587— PDFImage.getComponents has cognitive complexity 26 (threshold 15). Drivers by points: loops 5 (14 pts), if/else 8 (12 pts) (nesting depth added 13). 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.
RichMediaAnnotation.#findAsset (cognitive 26) src/core/annotation.js:5682— RichMediaAnnotation.#findAsset has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (3 pts), ternaries 1 (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.
pattern_helper.drawTriangle (cognitive 26) src/display/pattern_helper.js:287— pattern_helper.drawTriangle has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_createMaskCanvas (cognitive 26) REDACTED:1016— _createMaskCanvas has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 9, ternaries 4 (5 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.
constructor (cognitive 26) web/pdf_thumbnail_viewer.js:189— constructor has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (9 pts), match/switch 1 (2 pts), other 2 (nesting depth added 5). Of this number, 19 points are the body's own statements and 7 belong to 7 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.
#findClosestThumbnail (cognitive 26) web/pdf_thumbnail_viewer.js:1901— #findClosestThumbnail has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 4 (7 pts), boolean chains 4, other 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.
editorStats (cognitive 26) src/display/annotation_storage.js:216— editorStats has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 3 (4 pts), boolean chains 1, other 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.
(anonymous) (cognitive 26) extensions/chromium/options/migration.js:18— (anonymous) has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 92, a function literal at line 33, a function literal at line 55, …). 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.
CFFParser.parseEncoding (cognitive 25) REDACTED:1106— CFFParser.parseEncoding has cognitive complexity 25 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 4 (7 pts), match/switch 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 13). Of this number, 24 points are the body's own statements and 1 belongs 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.
PsWasmCompiler._compileNodeAsBoolI32 (cognitive 25) src/core/postscript/wasm_compiler.js:783— PsWasmCompiler._compileNodeAsBoolI32 has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 5, match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evaluator_utils.parseMarkedContentProps (cognitive 25) src/core/evaluator_utils.js:83— evaluator_utils.parseMarkedContentProps has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 1 (4 pts), ternaries 1 (3 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.
Catalog.#readDocumentOutline (cognitive 25) src/core/catalog.js:380— Catalog.#readDocumentOutline has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, ternaries 3 (5 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SignatureExtractor.#bilateralFilter (cognitive 25) src/display/editor/drawers/signaturedraw.js:277— SignatureExtractor.#bilateralFilter has cognitive complexity 25 (threshold 15). Drivers by points: loops 7 (14 pts), if/else 2 (9 pts), boolean chains 2 (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.
CommentDialog.open (cognitive 25) web/comment_manager.js:719— CommentDialog.open has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (22 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.
Stepper.updateOperatorList (cognitive 25) web/debugger.mjs:343— Stepper.updateOperatorList has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 8). Of this number, 23 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.
checkLastPage (cognitive 25) src/core/document.js:1772— checkLastPage has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 3 (7 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fillRgb (cognitive 25) src/core/colorspace.js:237— fillRgb has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 3 (9 pts), boolean chains 4 (nesting depth added 8). 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.
onReceiveData (cognitive 25) src/core/chunked_stream.js:437— onReceiveData has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 3 (4 pts), boolean chains 2, ternaries 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
applyPNGOptimumFilter (cognitive 25) src/core/editor/pdf_images.js:52— applyPNGOptimumFilter has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (13 pts), loops 4 (8 pts), if/else 1 (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.
core_utils.deepCompare (cognitive 24) REDACTED:208— core_utils.deepCompare has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, loops 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.
cmap.parseCMap (cognitive 24) src/core/cmap.js:566— cmap.parseCMap has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (3 pts), error handling 1 (2 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialEvaluator.readToUnicode (cognitive 24) src/core/evaluator.js:4057— PartialEvaluator.readToUnicode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 1 (2 pts), loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 12). Of this number, 15 points are the body's own statements and 9 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.
Binder._setProperties (cognitive 24) src/core/xfa/bind.js:170— Binder._setProperties has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotationEditorUIManager.#selectionChange (cognitive 24) src/display/editor/tools.js:1519— AnnotationEditorUIManager.#selectionChange has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 8). Of this number, 17 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.
Util.#createDateActions (cognitive 24) REDACTED:339— Util.#createDateActions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 5 (nesting depth added 6). None of this is in the body itself: all 24 points belong to 7 function literals inside it that branch (lines 344, 346, 354, …). 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.
initialization.initSandbox (cognitive 24) src/scripting_api/initialization.js:45— initialization.initSandbox has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 6 (8 pts), error handling 1 (nesting depth added 9). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
draw_ops_view.formatArg (cognitive 24) web/internal/draw_ops_view.js:169— draw_ops_view.formatArg has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 4 (8 pts), boolean chains 3 (nesting depth added 7). 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.
_createContainer (cognitive 24) src/display/annotation_layer.js:393— _createContainer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 8, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
#addExternalFileDropListeners (cognitive 24) web/pdf_thumbnail_viewer.js:1678— #addExternalFileDropListeners has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 9, loops 1, other 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 6 function items inside it that branch (hasMergeableItem, a function literal at line 1779, a function literal at line 1713, …). 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.
fillOpacity (cognitive 24) src/core/image.js:670— fillOpacity has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 11). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 4 function items inside it that branch (apply, apply, apply, …). 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.
getFontSubstitution (cognitive 24) src/core/font_substitutions.js:723— getFontSubstitution has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 9, loops 1 (2 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.
_encodeBMP (cognitive 24) src/core/image_resizer.js:403— _encodeBMP has cognitive complexity 24 (threshold 15). Drivers by points: loops 4 (13 pts), if/else 5 (8 pts), ternaries 1 (2 pts), 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.
constructSampled::constructSampledFn (cognitive 24) src/core/function.js:237— constructSampled::constructSampledFn has cognitive complexity 24 (threshold 15). Drivers by points: loops 8 (16 pts), if/else 3 (4 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 11). 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.
core_utils.validateFontName (cognitive 23) REDACTED:547— core_utils.validateFontName has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LZWStream.readBlock (cognitive 23) src/core/lzw_stream.js:60— LZWStream.readBlock has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (10 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.
Font.encodeString (cognitive 23) src/core/fonts.js:3780— Font.encodeString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (5 pts), ternaries 2 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NameOrNumberTree.getRaw (cognitive 23) src/core/name_number_tree.js:84— NameOrNumberTree.getRaw has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotationFactory.saveNewAnnotations (cognitive 23) src/core/annotation.js:390— AnnotationFactory.saveNewAnnotations has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), ternaries 1 (3 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotationFactory.printNewAnnotations (cognitive 23) src/core/annotation.js:484— AnnotationFactory.printNewAnnotations has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, ternaries 1 (3 pts), match/switch 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.
document.find (cognitive 23) src/core/document.js:964— document.find has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (10 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MessageHandler.#processStreamMessage (cognitive 23) src/shared/message_handler.js:408— MessageHandler.#processStreamMessage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 3, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
HighlightOutliner.#breakEdge (cognitive 23) src/display/editor/drawers/highlight.js:292— HighlightOutliner.#breakEdge has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StructTreeLayerBuilder.updateTextLayer (cognitive 23) web/struct_tree_layer_builder.js:499— StructTreeLayerBuilder.updateTextLayer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TilingPattern.createPatternCanvas (cognitive 23) src/display/pattern_helper.js:744— TilingPattern.createPatternCanvas has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (5 pts), ternaries 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.
PDFScriptingManager.setDocument (cognitive 23) web/pdf_scripting_manager.js:90— PDFScriptingManager.setDocument has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, loops 2 (5 pts), boolean chains 3, error handling 2 (nesting depth added 3). Of this number, 18 points are the body's own statements and 5 belong to 4 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.
CaretBrowsingMode.#setCaretPositionHelper (cognitive 23) web/caret_browsing.js:130— CaretBrowsingMode.#setCaretPositionHelper has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (18 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.
constructor (cognitive 23) src/core/annotation.js:3902— constructor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (6 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#setScaleUpdatePages (cognitive 23) web/pdf_viewer.js:1573— #setScaleUpdatePages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, other 2, 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.
mapStyle (cognitive 23) src/core/xfa/xhtml.js:116— mapStyle has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (6 pts), boolean chains 5, 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.
check_l10n.findDynamicLocation (cognitive 22) external/check_l10n/check_l10n.mjs:120— check_l10n.findDynamicLocation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (6 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gulpfile.runTests (cognitive 22) gulpfile.mjs:846— gulpfile.runTests has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 3, error handling 1 (2 pts), match/switch 1 (nesting depth added 3). None of this is in the body itself: all 22 points belong to 2 function literals inside it that branch (lines 847, 936). 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.
Dict.merge (cognitive 22) src/core/primitives.js:243— Dict.merge has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 5 (9 pts), boolean chains 3, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer.getName (cognitive 22) src/core/parser.js:1129— Lexer.getName has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CFFCompiler.compileDict (cognitive 22) REDACTED:1929— CFFCompiler.compileDict has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (7 pts), match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Annotation.setBorderStyle (cognitive 22) src/core/annotation.js:1145— Annotation.setBorderStyle has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 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.
PDFEditor.#fixFields (cognitive 22) src/core/editor/pdf_editor.js:2156— PDFEditor.#fixFields has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StampEditor.copyCanvas (cognitive 22) src/display/editor/stamp.js:486— StampEditor.copyCanvas has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TouchManager.#onTouchMove (cognitive 22) src/display/touch_manager.js:305— TouchManager.#onTouchMove has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5, 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.
AnnotationElement.commentButtonPosition (cognitive 22) src/display/annotation_layer.js:240— AnnotationElement.commentButtonPosition has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (7 pts), 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.
constructor (cognitive 22) src/core/annotation.js:734— constructor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 1 (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.
getFontFileType (cognitive 22) src/core/fonts.js:353— getFontFileType has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 4 (10 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.
createWebpackConfig (cognitive 22) gulpfile.mjs:310— createWebpackConfig has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 6, boolean chains 5, other 2, loops 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 7 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.
serialize (cognitive 22) src/display/editor/stamp.js:831— serialize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 1, other 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
createWrapper (cognitive 22) src/core/xfa/html_utils.js:404— createWrapper has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3 (7 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
toDateObject (cognitive 22) REDACTED:236— toDateObject has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, ternaries 7, if/else 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_createCanvas (cognitive 22) web/base_pdf_page_view.js:114— _createCanvas has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4 (nesting depth added 8). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 126). 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.
CFFParser.parseDict (cognitive 21) REDACTED:455— CFFParser.parseDict has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, loops 2 (nesting depth added 5). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (parseOperand, parseFloatOperand). 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.
CFFParser.parseCharStrings (cognitive 21) REDACTED:820— CFFParser.parseCharStrings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PSStackToTree._makeUnary (cognitive 21) src/core/postscript/ast.js:1276— PSStackToTree._makeUnary has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7 (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.
ast._evalBinaryConst (cognitive 21) src/core/postscript/ast.js:357— ast._evalBinaryConst has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (16 pts), boolean chains 2, if/else 1 (2 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
html_utils.setPara (cognitive 21) src/core/xfa/html_utils.js:553— html_utils.setPara has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (3 pts), match/switch 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataHandler.serialize (cognitive 21) src/core/xfa/data.js:31— DataHandler.serialize has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (6 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.
ButtonWidgetAnnotation._getOptInfo (cognitive 21) src/core/annotation.js:3615— ButtonWidgetAnnotation._getOptInfo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScreenAnnotation.#findRenditionAsset (cognitive 21) src/core/annotation.js:5809— ScreenAnnotation.#findRenditionAsset has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 1 (3 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Page.#replaceIdByRef (cognitive 21) src/core/document.js:326— Page.#replaceIdByRef has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FreeDrawOutline.#computeMinMax (cognitive 21) src/display/editor/drawers/freedraw.js:572— FreeDrawOutline.#computeMinMax has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Doc.constructor (cognitive 21) src/scripting_api/doc.js:120— Doc.constructor has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 21. 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.
EventDispatcher.#runCalculate (cognitive 21) src/scripting_api/event.js:313— EventDispatcher.#runCalculate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 1 (2 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.
PDFPageView.update (cognitive 21) web/pdf_page_view.js:784— PDFPageView.update has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 7 (nesting depth added 6). Of this number, 19 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.
_processCheckBox (cognitive 21) src/core/annotation.js:3688— _processCheckBox has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 5, boolean chains 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
documentInfo (cognitive 21) src/core/document.js:1577— documentInfo has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (5 pts), error handling 1, loops 1, other 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.
keydown (cognitive 21) src/display/editor/editor.js:2036— keydown has cognitive complexity 21 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 6 (8 pts), boolean chains 2 (nesting depth added 8). 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.
cssTransform (cognitive 21) web/pdf_page_view.js:983— cssTransform has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_parseBlock (cognitive 21) src/core/postscript/ast.js:274— _parseBlock has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 1 (2 pts), 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.
#onPagesEdited (cognitive 21) REDACTED:1108— #onPagesEdited has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), other 6, loops 2 (3 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
getVisibleElements (cognitive 21) web/ui_utils.js:435— getVisibleElements has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 5 (8 pts), boolean chains 2, loops 1 (nesting depth added 7). Of this number, 20 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.
setOperatorBBoxes (cognitive 21) web/debugger.mjs:441— setOperatorBBoxes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 5 (6 pts), other 3, ternaries 1 (2 pts) (nesting depth added 5). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 493, 468). 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.
#rebuildMultilineView (cognitive 21) web/internal/draw_ops_view.js:521— #rebuildMultilineView has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 3 (5 pts), boolean chains 2, other 1 (nesting depth added 4). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 547, a function literal at line 524, getText, …). 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.
#getOutlines (cognitive 21) src/display/editor/drawers/highlight.js:179— #getOutlines has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (7 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 10). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
createDataNode (cognitive 21) src/core/xfa/som.js:246— createDataNode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
core_utils.encodeToXmlString (cognitive 20) REDACTED:510— core_utils.encodeToXmlString has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 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.
ColorSpaceUtils.parse (cognitive 20) src/core/colorspace_utils.js:35— ColorSpaceUtils.parse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, error handling 1, 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.
Ascii85Stream.readBlock (cognitive 20) src/core/ascii_85_stream.js:34— Ascii85Stream.readBlock has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 5 (8 pts), boolean chains 2 (nesting depth added 8). 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.
fonts.createNameTable (cognitive 20) src/core/fonts.js:946— fonts.createNameTable has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, loops 7 (9 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
StructTreeRoot.getElementsForPage::walk (cognitive 20) src/core/struct_tree.js:110— StructTreeRoot.getElementsForPage::walk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XRef.parse (cognitive 20) src/core/xref.js:119— XRef.parse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 3 (4 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.
som.parseExpression (cognitive 20) src/core/xfa/som.js:64— som.parseExpression has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 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.
Page.getContentStream (cognitive 20) src/core/document.js:278— Page.getContentStream has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). Of this number, 16 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.
PDFDocument.#collectSignatureFields (cognitive 20) src/core/document.js:2006— PDFDocument.#collectSignatureFields has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (19 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.
Doc.getField (cognitive 20) src/scripting_api/doc.js:997— Doc.getField has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PDFViewer._updateSpreadMode (cognitive 20) web/pdf_viewer.js:2395— PDFViewer._updateSpreadMode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (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.
constructor (cognitive 20) src/core/annotation.js:1725— constructor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 3 (5 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.
#addEventListeners (cognitive 20) web/pdf_thumbnail_viewer.js:1414— #addEventListeners has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 9, match/switch 1 (nesting depth added 4). None of this is in the body itself: all 20 points belong to 3 function literals inside it that branch (lines 1424, 1417, 1494). 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.
create (cognitive 20) src/core/parser.js:1379— create has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (7 pts), ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 2 function items inside it that branch (getHints, getInt). 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.
isDestArraysEqual (cognitive 20) web/pdf_history.js:715— isDestArraysEqual has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 5). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to one function item inside it that branches (isEntryEqual). 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.
deleteItemAt (cognitive 20) src/scripting_api/field.js:653— deleteItemAt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (4 pts), loops 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.
#appendText (cognitive 20) src/display/text_layer.js:309— #appendText has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
pdfHandler.chrome.runtime.onMessage.addListener() (cognitive 19) REDACTED:316— pdfHandler.chrome.runtime.onMessage.addListener() has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, 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.
ImageResizer._rescaleImageData (cognitive 19) src/core/image_resizer.js:309— ImageResizer._rescaleImageData has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 4 (7 pts), error handling 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser.makeInlineImage (cognitive 19) src/core/parser.js:501— Parser.makeInlineImage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 1, match/switch 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.
fonts_utils.type1FontGlyphMapping (cognitive 19) src/core/fonts_utils.js:121— fonts_utils.type1FontGlyphMapping has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
font_renderer.parseCmap (cognitive 19) src/core/font_renderer.js:47— font_renderer.parseCmap has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 3 (5 pts), ternaries 1 (nesting depth added 9). 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.
PartialEvaluator.buildToUnicode (cognitive 19) src/core/evaluator.js:3973— PartialEvaluator.buildToUnicode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, loops 1 (3 pts) (nesting depth added 5). Of this number, 12 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.
StructTreePage.addNode (cognitive 19) src/core/struct_tree.js:1015— StructTreePage.addNode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Image.[$toHTML] (cognitive 19) src/core/xfa/template.js:3408— Image.[$toHTML] has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, loops 1 (2 pts), match/switch 1, 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.
TextWidgetAnnotation._splitLine (cognitive 19) src/core/annotation.js:3138— TextWidgetAnnotation._splitLine has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PDFDocument.#parseSignatureDict (cognitive 19) src/core/document.js:2088— PDFDocument.#parseSignatureDict has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9, boolean chains 5, if/else 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CanvasGraphics.fill (cognitive 19) REDACTED:2317— CanvasGraphics.fill has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, ternaries 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.
TextLayer.#processItems (cognitive 19) src/display/text_layer.js:265— TextLayer.#processItems has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (17 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.
FirefoxEventBus.dispatch (cognitive 19) web/event_utils.js:175— FirefoxEventBus.dispatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
AnnotationElement._getElementsByName (cognitive 19) src/display/annotation_layer.js:791— AnnotationElement._getElementsByName has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (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.
PDFFindController.#onFind (cognitive 19) REDACTED:492— PDFFindController.#onFind has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4 (nesting depth added 2). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 507). 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.
DrawOpDetailView.#makeImageArgPreview (cognitive 19) web/internal/draw_ops_view.js:378— DrawOpDetailView.#makeImageArgPreview has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7, loops 3 (7 pts), ternaries 2 (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.
ViewsManager.switchView (cognitive 19) web/views_manager.js:229— ViewsManager.switchView has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
putBinaryImageData (cognitive 19) REDACTED:322— putBinaryImageData has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 5 (6 pts), loops 3 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render (cognitive 19) src/display/annotation_layer.js:3732— render has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 5). Of this number, 15 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.
buildMozcentral (cognitive 19) gulpfile.mjs:1731— buildMozcentral has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 6). Of this number, 18 points are the body's own statements and 1 belongs to 23 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.
#collectPageLabels (cognitive 19) src/core/editor/pdf_editor.js:2368— #collectPageLabels has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (5 pts), loops 2, 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.
#loadXfaFonts (cognitive 19) src/core/document.js:1372— #loadXfaFonts has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (5 pts), error handling 1 (nesting depth added 5). Of this number, 18 points are the body's own statements and 1 belongs 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.
parse (cognitive 19) REDACTED:291— parse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#addDragListeners (cognitive 19) web/pdf_thumbnail_viewer.js:1525— #addDragListeners has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7 (nesting depth added 3). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 1529, a function literal at line 1577, a function literal at line 1641, …). 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.
cancelRendering (cognitive 19) web/pdf_page_view.js:932— cancelRendering has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (8 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
toggle (cognitive 19) web/comment_manager.js:1093— toggle has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, ternaries 2 (3 pts) (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
foundImageMaskGroup (cognitive 19) src/core/operator_list.js:195— foundImageMaskGroup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (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.
constructor (cognitive 19) src/display/draw_layer.js:230— constructor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 9). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 248, 282, 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.
executeOperatorList (cognitive 19) src/display/renderer_worker_proxy.js:128— executeOperatorList has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (2 pts), error handling 1, other 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.
#setup (cognitive 19) src/display/renderer_worker.js:317— #setup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), other 3, boolean chains 2, error handling 1, loops 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 467, 367, 318, …). 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.
(anonymous) (cognitive 19) REDACTED:316— (anonymous) has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, 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.
gulpfile.gulp.task("lint-chmod") (cognitive 18) gulpfile.mjs:2915— gulpfile.gulp.task("lint-chmod") has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 3 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
util._isValidExplicitDest (cognitive 18) REDACTED:1093— util._isValidExplicitDest has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, loops 1, match/switch 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.
core_utils._collectJS (cognitive 18) REDACTED:406— core_utils._collectJS has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
colorspace.resizeRgbaImage (cognitive 18) src/core/colorspace.js:64— colorspace.resizeRgbaImage has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 2, ternaries 1 (2 pts) (nesting depth added 9). 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.
QueueOptimizer._optimize (cognitive 18) src/core/operator_list.js:581— QueueOptimizer._optimize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 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.
Parser.makeFilter (cognitive 18) src/core/parser.js:800— Parser.makeFilter has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (4 pts), error handling 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CFFFont.getGlyphMapping (cognitive 18) src/core/cff_font.js:58— CFFFont.getGlyphMapping has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (6 pts), ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
obj_bin_transform_core.compileFontInfo (cognitive 18) src/core/obj_bin_transform_core.js:93— obj_bin_transform_core.compileFontInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 4 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 5). Of this number, 13 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.
RadialAxialShading.constructor (cognitive 18) src/core/pattern.js:169— RadialAxialShading.constructor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 3 (4 pts), boolean chains 3, ternaries 3 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
pattern.buildMeshVertexData (cognitive 18) src/core/pattern.js:394— pattern.buildMeshVertexData has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 4 (6 pts) (nesting depth added 9). 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.
PartialEvaluator.setGState (cognitive 18) src/core/evaluator.js:1133— PartialEvaluator.setGState has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Catalog.destinations (cognitive 18) src/core/catalog.js:751— Catalog.destinations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (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.
XFAObject.[_getPrototype] (cognitive 18) src/core/xfa/xfa_object.js:468— XFAObject.[_getPrototype] has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
AForm.AFRange_Validate (cognitive 18) src/scripting_api/aform.js:283— AForm.AFRange_Validate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 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.
PDFViewer.#setScale (cognitive 18) web/pdf_viewer.js:1685— PDFViewer.#setScale has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 1 (3 pts), boolean chains 2, match/switch 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.
PDFViewer.annotationEditorMode (cognitive 18) web/pdf_viewer.js:2707— PDFViewer.annotationEditorMode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). Of this number, 13 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.
PDFHistory.push (cognitive 18) web/pdf_history.js:193— PDFHistory.push has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6 (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.
TreeView.#buildChildren (cognitive 18) web/internal/tree_view.js:236— TreeView.#buildChildren has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SignatureManager.#initDrawTab (cognitive 18) web/signature_manager.js:387— SignatureManager.#initDrawTab has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4 (nesting depth added 1). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (drawCallback, a function literal at line 456, a function literal at line 484, …). 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.
_abortOperatorList (cognitive 18) src/display/api.js:2003— _abortOperatorList has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, 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· close (cognitive 18) · ×1
close (cognitive 18) REDACTED:1302— close has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 2 (5 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 18) gulpfile.mjs:2915— (anonymous) has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 3 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#computeThumbnailsPosition (cognitive 18) web/pdf_thumbnail_viewer.js:1340— #computeThumbnailsPosition has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#convertToRegExpString (cognitive 18) REDACTED:679— #convertToRegExpString has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 2). Most of this is not in the body itself: 6 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 693, addExtraWhitespaces, a function literal at line 749). 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.
fetchUncompressed (cognitive 18) src/core/xref.js:903— fetchUncompressed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, 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.
#renderValue (cognitive 18) web/internal/tree_view.js:639— #renderValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
(computed) (cognitive 18) src/core/xfa/xfa_object.js:468— (computed) has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
write (cognitive 18) src/core/glyf.js:635— write has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6 (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.
writeNumber (cognitive 18) external/cmapscompress/compress.mjs:370— writeNumber has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 2 (7 pts), if/else 3 (6 pts), loops 3 (5 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.
_parseContent (cognitive 18) src/core/xml_parser.js:80— _parseContent has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 3 (6 pts), loops 4 (5 pts) (nesting depth added 4). Of this number, 16 points are the body's own statements and 2 belong to one function item inside it that branches. This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
options.Promise.all().then() (cognitive 17) extensions/chromium/options/options.js:50— options.Promise.all().then() has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). None of this is in the body itself: all 17 points belong to 4 function items inside it that branch (a function literal at line 65, a function literal at line 123, a function literal at line 115, …). 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.
gulpfile.mirrorDir (cognitive 17) gulpfile.mjs:1988— gulpfile.mirrorDir has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, 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.
OperatorList._transfers (cognitive 17) src/core/operator_list.js:756— OperatorList._transfers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlateStream.generateHuffmanTable (cognitive 17) src/core/flate_stream.js:255— FlateStream.generateHuffmanTable has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 2 (5 pts) (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.
AESBaseCipher._decryptBlock2 (cognitive 17) REDACTED:396— AESBaseCipher._decryptBlock2 has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (7 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.
CipherTransformFactory.#prepareKeyData (cognitive 17) REDACTED:947— CipherTransformFactory.#prepareKeyData has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 5, boolean chains 1, ternaries 1 (nesting depth added 5). 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.
cmap.parseBfRange (cognitive 17) src/core/cmap.js:457— cmap.parseBfRange has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (4 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.
CFFCompiler.compile (cognitive 17) REDACTED:1630— CFFCompiler.compile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 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.
Font._spaceWidth (cognitive 17) src/core/fonts.js:3532— Font._spaceWidth has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, 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.
fonts.getRanges (cognitive 17) src/core/fonts.js:535— fonts.getRanges has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (6 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.
MurmurHash3_64.update (cognitive 17) src/shared/murmurhash3.js:31— MurmurHash3_64.update has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sound.soundStreamToWav (cognitive 17) src/core/sound.js:83— sound.soundStreamToWav has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StructElementNode.#collectAttributes (cognitive 17) src/core/struct_tree.js:696— StructElementNode.#collectAttributes has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextMeasure.compute (cognitive 17) src/core/xfa/text.js:222— TextMeasure.compute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PDFEditor.#findDuplicateNamedDestinations (cognitive 17) src/core/editor/pdf_editor.js:1672— PDFEditor.#findDuplicateNamedDestinations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (4 pts) (nesting depth added 8). Of this number, 13 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.
PDFEditor.#modalPageSize (cognitive 17) src/core/editor/pdf_editor.js:2602— PDFEditor.#modalPageSize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, 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.
PDFEditor.#makeNameNumTree (cognitive 17) src/core/editor/pdf_editor.js:2774— PDFEditor.#makeNameNumTree has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (5 pts), ternaries 4 (5 pts) (nesting depth added 7). 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.
PDFEditor.#collectEmbeddedFiles (cognitive 17) src/core/editor/pdf_editor.js:2840— PDFEditor.#collectEmbeddedFiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (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.
Lexer.getString (cognitive 17) src/core/xfa/formcalc_lexer.js:188— Lexer.getString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HighlightOutliner.constructor (cognitive 17) src/display/editor/drawers/highlight.js:85— HighlightOutliner.constructor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, loops 2, 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.
KeyboardManager.constructor (cognitive 17) src/display/editor/tools.js:521— KeyboardManager.constructor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (14 pts), 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.
CanvasDependencyTracker.recordCharacterBBox (cognitive 17) src/display/canvas_dependency_tracker.js:640— CanvasDependencyTracker.recordCharacterBBox has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 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.
OptionalContentConfig.constructor (cognitive 17) src/display/optional_content_config.js:99— OptionalContentConfig.constructor has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 5 (7 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PDFThumbnailViewer.#mergeFiles (cognitive 17) web/pdf_thumbnail_viewer.js:367— PDFThumbnailViewer.#mergeFiles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 1 (3 pts), loops 2, boolean chains 1, ternaries 1 (nesting depth added 6). 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.
PDFThumbnailViewer.scrollThumbnailIntoView (cognitive 17) web/pdf_thumbnail_viewer.js:451— PDFThumbnailViewer.scrollThumbnailIntoView has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 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.
CanvasContextDetailsView.wrapContext (cognitive 17) REDACTED:104— CanvasContextDetailsView.wrapContext has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 130, 144, 122). 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.
TreeView.#formatBytes (cognitive 17) web/internal/tree_view.js:852— TreeView.#formatBytes has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), boolean chains 4, if/else 3 (4 pts) (nesting depth added 6). 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, 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.
PDFPresentationMode.#touchSwipe (cognitive 17) web/pdf_presentation_mode.js:296— PDFPresentationMode.#touchSwipe has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, match/switch 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.
_create (cognitive 17) src/core/annotation.js:169— _create has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (4 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#findClipAsset (cognitive 17) src/core/annotation.js:5844— #findClipAsset has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3 (4 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.
_bakeSMaskCanvas (cognitive 17) REDACTED:1480— _bakeSMaskCanvas has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 2 (6 pts), boolean chains 2, other 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
render (cognitive 17) src/display/annotation_layer.js:967— render has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
initialize (cognitive 17) REDACTED:206— initialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, error handling 1, match/switch 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
getAnnotationsData (cognitive 17) src/core/document.js:750— getAnnotationsData has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, error handling 1 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
#nextMatch (cognitive 17) REDACTED:952— #nextMatch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 3, ternaries 1 (3 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.
#renderCanvas (cognitive 17) web/internal/page_view.js:676— #renderCanvas has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 1, error handling 1, other 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
(anonymous) (cognitive 17) extensions/chromium/options/options.js:50— (anonymous) has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1 (nesting depth added 3). None of this is in the body itself: all 17 points belong to 7 function items inside it that branch (a function literal at line 65, a function literal at line 123, a function literal at line 115, …). 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.
#setupResizer (cognitive 17) web/internal/split_view.js:128— #setupResizer has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 6, if/else 4 (nesting depth added 2). Most of this is not in the body itself: 2 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 183, a function literal at line 132, (anonymous)::cancelDrag, …). 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.
contentscript.watchObjectOrEmbed (cognitive 16) REDACTED:40— contentscript.watchObjectOrEmbed has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 1). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body: 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.
util.createValidAbsoluteUrl (cognitive 16) REDACTED:454— util.createValidAbsoluteUrl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 1 (3 pts), boolean chains 2, ternaries 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.
AlternateCS.getRgbBuffer (cognitive 16) src/core/colorspace.js:403— AlternateCS.getRgbBuffer has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (6 pts), if/else 4 (5 pts), boolean chains 3, ternaries 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.
AsciiHexStream.readBlock (cognitive 16) src/core/ascii_hex_stream.js:33— AsciiHexStream.readBlock has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
JBig2CCITTFaxImage.decode (cognitive 16) src/core/jbig2_ccittFax.js:39— JBig2CCITTFaxImage.decode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (8 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.
CipherTransformFactory.createCipherTransform (cognitive 16) REDACTED:1303— CipherTransformFactory.createCipherTransform has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3 (nesting depth added 6). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function item inside it that branches (resolveCipher). 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.
CFFParser.parseFDSelect (cognitive 16) REDACTED:1175— CFFParser.parseFDSelect has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CFFCompiler.compileCharset (cognitive 16) REDACTED:2009— CFFCompiler.compileCharset has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MeshShading._decodeType6Shading (cognitive 16) src/core/pattern.js:881— MeshShading._decodeType6Shading has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (6 pts), loops 3 (5 pts), if/else 1 (2 pts), match/switch 1 (2 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. This shape REPEATS in the file: one other method here (MeshShading._decodeType7Shading) 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.
MeshShading._decodeType7Shading (cognitive 16) src/core/pattern.js:1013— MeshShading._decodeType7Shading has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (6 pts), loops 3 (5 pts), if/else 1 (2 pts), match/switch 1 (2 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. This shape REPEATS in the file: one other method here (MeshShading._decodeType6Shading) 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.
MeshShading._buildFigureFromPatch (cognitive 16) src/core/pattern.js:1083— MeshShading._buildFigureFromPatch has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), boolean chains 3, if/else 1 (3 pts) (nesting depth added 8). 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.
font_substitutions.generateFont (cognitive 16) src/core/font_substitutions.js:643— font_substitutions.generateFont has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 6, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TranslatedFont.#removeType3ColorOperators (cognitive 16) src/core/evaluator.js:5018— TranslatedFont.#removeType3ColorOperators has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 2 (6 pts), loops 2 (4 pts), boolean chains 3, if/else 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.
StructElementNode.parseKid (cognitive 16) src/core/struct_tree.js:850— StructElementNode.parseKid has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (5 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.
StructTreePage.#parseWithoutParentTree (cognitive 16) src/core/struct_tree.js:1088— StructTreePage.#parseWithoutParentTree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 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.
Catalog.#readOptionalContentGroup (cognitive 16) src/core/catalog.js:549— Catalog.#readOptionalContentGroup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), match/switch 2 (6 pts) (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.
TextMeasure.addString (cognitive 16) src/core/xfa/text.js:170— TextMeasure.addString has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), boolean chains 4, if/else 2, ternaries 1 (2 pts) (nesting depth added 5). 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.
XmlObject.[$toString] (cognitive 16) src/core/xfa/xfa_object.js:824— XmlObject.[$toString] has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ChoiceList.[$toHTML] (cognitive 16) src/core/xfa/template.js:1416— ChoiceList.[$toHTML] has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Draw.[$toHTML] (cognitive 16) src/core/xfa/template.js:1894— Draw.[$toHTML] has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PageSet.[$getNextPage] (cognitive 16) src/core/xfa/template.js:4175— PageSet.[$getNextPage] has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, ternaries 2 (nesting depth added 4). 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 into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Binder._findDataByNameToConsume (cognitive 16) src/core/xfa/bind.js:111— Binder._findDataByNameToConsume has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnnotationBorderStyle.setDashArray (cognitive 16) src/core/annotation.js:1665— AnnotationBorderStyle.setDashArray has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, 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.
WidgetAnnotation._getSaveFieldResources (cognitive 16) src/core/annotation.js:2851— WidgetAnnotation._getSaveFieldResources has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, 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.
FreeTextAnnotation.createNewAppearanceStream (cognitive 16) src/core/annotation.js:4468— FreeTextAnnotation.createNewAppearanceStream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 3 (4 pts), boolean chains 2, match/switch 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PDFDocument.#getLinearizationPage (cognitive 16) src/core/document.js:1688— PDFDocument.#getLinearizationPage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
print_appearances.filterContentStream (cognitive 16) src/core/editor/print_appearances.js:115— print_appearances.filterContentStream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (3 pts), loops 2, boolean chains 1, 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.
PDFPageProxy.render::complete (cognitive 16) src/display/api.js:1584— PDFPageProxy.render::complete has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 1 (2 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.
PDFLinkService.goToDestination (cognitive 16) web/pdf_link_service.js:139— PDFLinkService.goToDestination has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 3). 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: 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.
RadioButtonWidgetAnnotationElement.render (cognitive 16) src/display/annotation_layer.js:2030— RadioButtonWidgetAnnotationElement.render has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 4). Of this number, 8 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.
AnnotationLayerBuilder.#checkInferredLinks (cognitive 16) web/annotation_layer_builder.js:306— AnnotationLayerBuilder.#checkInferredLinks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 5 (6 pts) (nesting depth added 6). None of this is in the body itself: all 16 points belong to 4 function items inside it that branch (a function literal at line 345, intersectAnnotations, annotationRects, …). 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.
AltTextManager.#setPosition (cognitive 16) web/alt_text_manager.js:188— AltTextManager.#setPosition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (16 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PDFDocumentProperties.#parsePageSize (cognitive 16) web/pdf_document_properties.js:266— PDFDocumentProperties.#parsePageSize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, ternaries 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_prepareSMaskCanvas (cognitive 16) REDACTED:1353— _prepareSMaskCanvas has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 5, ternaries 4, other 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.
_initializeMetadata (cognitive 16) REDACTED:2008— _initializeMetadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
bindWindowEvents (cognitive 16) REDACTED:2513— bindWindowEvents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 7. Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 10 function items inside it that branch (scroll, scrollend, addWindowResolutionChange, …). 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.
exec (cognitive 16) src/display/editor/tools.js:606— exec has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4, 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.
#extractText (cognitive 16) REDACTED:879— #extractText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 8). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 892). 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.
constructor (cognitive 16) src/core/pattern.js:456— constructor has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 3 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mathML (cognitive 16) src/core/struct_tree.js:662— mathML has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, ternaries 1 (3 pts), 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.
parseWhile (cognitive 16) src/core/xfa/formcalc_parser.js:1208— parseWhile has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 4, boolean chains 2 (nesting depth added 5). 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.
parseFor (cognitive 16) src/core/xfa/formcalc_parser.js:1262— parseFor has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 5, boolean chains 3 (nesting depth added 4). 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.
#setupEventListeners (cognitive 16) web/internal/page_view.js:450— #setupEventListeners has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 4, other 3. Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 14 function items inside it that branch (a function literal at line 571, a function literal at line 468, a function literal at line 536, …). 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.
deserialize (cognitive 16) src/display/editor/drawers/inkdraw.js:519— deserialize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (6 pts), other 2, match/switch 1 (nesting depth added 7). 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.
processDrawnLines (cognitive 16) src/display/editor/drawers/signaturedraw.js:579— processDrawnLines has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 4 (6 pts), loops 2 (3 pts), other 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editAltText (cognitive 16) web/new_alt_text_manager.js:372— editAltText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, error handling 1, other 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AFNumber_Format (cognitive 16) src/scripting_api/aform.js:105— AFNumber_Format has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 6, ternaries 1 (2 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.
babelPluginPDFJSPreprocessor::MemberExpression (cognitive 16) external/builder/babel-plugin-pdfjs-preprocessor.mjs:291— babelPluginPDFJSPreprocessor::MemberExpression has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, loops 2 (3 pts), other 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.
createEvent (cognitive 16) src/scripting_api/event.js:31— createEvent has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 14, other 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.
(anonymous) (cognitive 16) web/internal/debugger.js:211— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 4, error handling 1 (2 pts), ternaries 1 (2 pts), other 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the repository root runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
IC1 · Incompleteness & stubs· Both branches are identical · ×1
Both branches are identical — the condition decides nothing web/firefoxcom.js:623— Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
P12 · CI test-gate honesty· Coverage collected but not gated · ×1
Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
No structured logging — No logging call was found in the 332 JavaScript/TypeScript production file(s) this check read across 1 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.
Duplication concentrated across 2 sibling directories (17 clone groups) src/pdf.js:103— 17 duplicated blocks under the repository root have copies in at least two of the sibling directories src, web — 7 of them are reported below, and 10 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 17 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 17 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 17 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.
Duplication concentrated across 4 sibling directories (12 clone groups) src/core/document.js:95— 12 duplicated blocks under src/ have copies in at least two of the sibling directories core, display, scripting_api, shared — 5 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 12 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 12 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 12 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.
Duplicated block (317 lines × 3 locations) src/core/metrics.js:29— src/core/metrics.js:29 · src/core/metrics.js:347 · src/core/metrics.js:665 — all 3 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 (317 lines × 4 locations) src/core/metrics.js:1301— src/core/metrics.js:1301 · src/core/metrics.js:1619 · src/core/metrics.js:1937 · src/core/metrics.js:2255 — all 4 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 (185 lines × 2 locations) src/core/metrics.js:477— src/core/metrics.js:477 · src/core/metrics.js:795 — 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 (109 lines × 2 locations) src/core/metrics.js:364— src/core/metrics.js:364 · src/core/metrics.js:682 — 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 (70 matched lines × 2 locations) · ×1
Duplicated block with local edits (70 matched lines × 2 locations) REDACTED:39— REDACTED:39 · web/pdf_print_service.js:43 — the two spans are one implementation copied and then locally edited — 427 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 (64 matched lines × 2 locations) · ×1
Duplicated block with local edits (64 matched lines × 2 locations) src/display/canvas_dependency_tracker.js:518— src/display/canvas_dependency_tracker.js:518 · src/display/canvas_dependency_tracker.js:872 — the two spans are one implementation copied and then locally edited — 254 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.
Duplicated block (64 lines × 2 locations) src/pdf.js:103— src/pdf.js:103 · web/pdfjs.js:16 — the 2 copies are spread across 2 files, and what repeats is a LIST OF ENTRIES rather than behaviour — the same entries written out more than once. Extract them into one shared, exported constant and spread that constant into each site, rather than into a function the sites call: a list like this often lives in declarative metadata (a decorator's options object, a static configuration table) that a build step must be able to read statically, where a function call is not allowed. Adding an entry to one copy and not the other is the failure this prevents.
R10 · Code Duplication· Duplicated block with local edits (63 matched lines × 2 locations) · ×1
Duplicated block with local edits (63 matched lines × 2 locations) src/display/network.js:245— src/display/network.js:245 · src/display/transport_stream.js:165 — the two spans are one implementation copied and then locally edited — 359 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 (49 matched lines × 2 locations) · ×1
Duplicated block with local edits (49 matched lines × 2 locations) external/builder/test-fixtures.mjs:5— external/builder/test-fixtures.mjs:5 · external/builder/test-fixtures_babel.mjs:5 — the two spans are one implementation copied and then locally edited — 301 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (46 lines × 2 locations) src/display/editor/freetext.js:76— src/display/editor/freetext.js:76 · src/display/editor/tools.js:926 — the 2 copies are spread across 2 files, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (39 lines × 2 locations) src/core/evaluator.js:2069— src/core/evaluator.js:2069 · src/core/evaluator.js:2108 — 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.
R10 · Code Duplication· Duplicated block with local edits (39 matched lines × 2 locations) · ×1
Duplicated block with local edits (39 matched lines × 2 locations) src/core/postscript/js_evaluator.js:87— src/core/postscript/js_evaluator.js:87 · src/core/postscript/wasm_compiler.js:342 — the two spans are one implementation copied and then locally edited — 149 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 (38 matched lines × 2 locations) · ×1
Duplicated block with local edits (38 matched lines × 2 locations) web/pdf_layer_viewer.js:133— web/pdf_layer_viewer.js:133 · web/pdf_outline_viewer.js:224 — the two spans are one implementation copied and then locally edited — 223 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 (37 matched lines × 2 locations) · ×1
Duplicated block with local edits (37 matched lines × 2 locations) src/display/fetch_stream.js:127— src/display/fetch_stream.js:127 · src/display/node_stream.js:86 — the two spans are one implementation copied and then locally edited — 229 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 (32 matched lines × 2 locations) · ×1
Duplicated block with local edits (32 matched lines × 2 locations) src/core/binary_cmap.js:221— src/core/binary_cmap.js:221 · src/core/binary_cmap.js:266 — the two spans are one implementation copied and then locally edited — 199 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 (31 matched lines × 2 locations) · ×1
Duplicated block with local edits (31 matched lines × 2 locations) src/core/postscript/js_evaluator.js:139— src/core/postscript/js_evaluator.js:139 · src/core/postscript/js_evaluator.js:211 — the two spans are one implementation copied and then locally edited — 140 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.
Duplicated block (30 lines × 2 locations) src/core/evaluator.js:2861— src/core/evaluator.js:2861 · src/core/evaluator.js:2941 — 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 (27 lines × 2 locations) src/core/metrics.js:1817— src/core/metrics.js:1817 · src/core/metrics.js:2135 — 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 (26 lines × 2 locations) src/core/annotation.js:5272— src/core/annotation.js:5272 · src/core/annotation.js:5317 — 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 (26 lines × 3 locations) src/display/annotation_layer.js:3592— src/display/annotation_layer.js:3592 · src/display/annotation_layer.js:3623 · src/display/annotation_layer.js:3654 — all 3 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 (25 lines × 2 locations) src/core/annotation.js:3409— src/core/annotation.js:3409 · src/core/annotation.js:3468 — 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.
R10 · Code Duplication· Duplicated block with local edits (24 matched lines × 2 locations) · ×1
Duplicated block with local edits (24 matched lines × 2 locations) REDACTED:351— REDACTED:351 · REDACTED:508 — the two spans are one implementation copied and then locally edited — 144 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.
Duplicated block (23 lines × 2 locations) gulpfile.mjs:1497— gulpfile.mjs:1497 · gulpfile.mjs:2215 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Complex function onKeyDown (cyclomatic 120, cognitive 142) REDACTED:3258— onKeyDown has cyclomatic complexity 120 and cognitive complexity 142; 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.
Complex function checkAndRepair (cyclomatic 111, cognitive 188) src/core/fonts.js:1418— checkAndRepair has cyclomatic complexity 111 and cognitive complexity 188; 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.
Complex function promiseBody (cyclomatic 110, cognitive 187) src/core/evaluator.js:1755— promiseBody has cyclomatic complexity 110 and cognitive complexity 187; 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.
Complex function bidi (cyclomatic 94, cognitive 147) src/core/bidi.js:120— bidi has cyclomatic complexity 94 and cognitive complexity 147; 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.
Complex function decompress (cyclomatic 84, cognitive 250) external/brotli/decode.js:1214— decompress has cyclomatic complexity 84 and cognitive complexity 250; 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.
Complex function _makeBinary (cyclomatic 76, cognitive 116) src/core/postscript/ast.js:1043— _makeBinary has cyclomatic complexity 76 and cognitive complexity 116; 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.
Complex function (computed) (cyclomatic 74, cognitive 117) src/core/xfa/template.js:2741— (computed) has cyclomatic complexity 74 and cognitive complexity 117; 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.
Complex function extractCidKeyedFontProgram (cyclomatic 74, cognitive 68) src/core/type1_parser.js:778— extractCidKeyedFontProgram has cyclomatic complexity 74 and cognitive complexity 68; 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.
Complex function parse (cyclomatic 68, cognitive 98) src/core/jpg.js:890— parse has cyclomatic complexity 68 and cognitive complexity 98; 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.
Complex function parseDestDictionary (cyclomatic 67, cognitive 120) src/core/catalog.js:1806— parseDestDictionary has cyclomatic complexity 67 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.
Complex function _initializeViewerComponents (cyclomatic 66, cognitive 85) REDACTED:418— _initializeViewerComponents has cyclomatic complexity 66 and cognitive complexity 85; 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.
Complex function parse (cyclomatic 65, cognitive 119) src/core/font_renderer.js:382— parse has cyclomatic complexity 65 and cognitive complexity 119; 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.
Complex function #execOp (cyclomatic 62, cognitive 39) src/core/postscript/js_evaluator.js:537— #execOp has cyclomatic complexity 62 and cognitive complexity 39; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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.
Complex function createImageData (cyclomatic 61, cognitive 105) src/core/image.js:776— createImageData has cyclomatic complexity 61 and cognitive complexity 105; 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.
Complex function translateFont (cyclomatic 61, cognitive 104) src/core/evaluator.js:4496— translateFont has cyclomatic complexity 61 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 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.
Complex function sanitizeTTProgram (cyclomatic 60, cognitive 133) src/core/fonts.js:2484— sanitizeTTProgram has cyclomatic complexity 60 and cognitive complexity 133; 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.
Complex function getDocument (cyclomatic 59, cognitive 49) src/display/api.js:228— getDocument has cyclomatic complexity 59 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.
Complex function #cloneStructTreeNode (cyclomatic 58, cognitive 121) src/core/editor/pdf_editor.js:562— #cloneStructTreeNode has cyclomatic complexity 58 and cognitive complexity 121; 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.
Complex function readCmapTable (cyclomatic 58, cognitive 107) src/core/fonts.js:1602— readCmapTable has cyclomatic complexity 58 and cognitive complexity 107; 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.
Complex function parse (cyclomatic 57, cognitive 94) src/core/xfa/formcalc_parser.js:277— parse has cyclomatic complexity 57 and cognitive complexity 94; 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.
src/core/xfa/template.js: 5900 lines of code src/core/xfa/template.js:1— src/core/xfa/template.js has 5900 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/annotation.js: 5283 lines of code src/core/annotation.js:1— src/core/annotation.js has 5283 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/evaluator.js: 5081 lines of code src/core/evaluator.js:1— src/core/evaluator.js has 5081 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/glyphlist.js: 4552 lines of code src/core/glyphlist.js:1— src/core/glyphlist.js has 4552 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: 4098 lines of code REDACTED:1— REDACTED has 4098 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· src/display/annotation_layer.js · ×1
src/display/annotation_layer.js: 3937 lines of code src/display/annotation_layer.js:1— src/display/annotation_layer.js has 3937 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/fonts.js: 3554 lines of code src/core/fonts.js:1— src/core/fonts.js has 3554 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: 3285 lines of code REDACTED:1— REDACTED has 3285 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/display/api.js: 3227 lines of code src/display/api.js:1— src/display/api.js has 3227 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/metrics.js: 3053 lines of code src/core/metrics.js:1— src/core/metrics.js has 3053 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· src/core/editor/pdf_editor.js · ×1
src/core/editor/pdf_editor.js: 2984 lines of code src/core/editor/pdf_editor.js:1— src/core/editor/pdf_editor.js has 2984 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· src/display/editor/tools.js · ×1
src/display/editor/tools.js: 2716 lines of code src/display/editor/tools.js:1— src/display/editor/tools.js has 2716 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
web/pdf_viewer.js: 2513 lines of code web/pdf_viewer.js:1— web/pdf_viewer.js has 2513 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
external/brotli/decode.js: 2447 lines of code external/brotli/decode.js:1— external/brotli/decode.js has 2447 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/document.js: 2194 lines of code src/core/document.js:1— src/core/document.js has 2194 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· src/display/editor/editor.js · ×1
src/display/editor/editor.js: 2153 lines of code src/display/editor/editor.js:1— src/display/editor/editor.js has 2153 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: 2003 lines of code REDACTED:1— REDACTED has 2003 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/catalog.js: 1860 lines of code src/core/catalog.js:1— src/core/catalog.js has 1860 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· web/pdf_thumbnail_viewer.js · ×1
web/pdf_thumbnail_viewer.js: 1814 lines of code web/pdf_thumbnail_viewer.js:1— web/pdf_thumbnail_viewer.js has 1814 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/xfa/config.js: 1620 lines of code src/core/xfa/config.js:1— src/core/xfa/config.js has 1620 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/parser.js: 1347 lines of code src/core/parser.js:1— src/core/parser.js has 1347 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/image.js: 1343 lines of code src/core/image.js:1— src/core/image.js has 1343 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/postscript/ast.js: 1339 lines of code src/core/postscript/ast.js:1— src/core/postscript/ast.js has 1339 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/jpg.js: 1331 lines of code src/core/jpg.js:1— src/core/jpg.js has 1331 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: 1283 lines of code REDACTED:1— REDACTED has 1283 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
web/pdf_page_view.js: 1195 lines of code web/pdf_page_view.js:1— web/pdf_page_view.js has 1195 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/pattern.js: 1171 lines of code src/core/pattern.js:1— src/core/pattern.js has 1171 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· src/core/xfa/formcalc_parser.js · ×1
src/core/xfa/formcalc_parser.js: 1171 lines of code src/core/xfa/formcalc_parser.js:1— src/core/xfa/formcalc_parser.js has 1171 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/colorspace.js: 1170 lines of code src/core/colorspace.js:1— src/core/colorspace.js has 1170 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: 1144 lines of code REDACTED:1— REDACTED has 1144 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: 1144 lines of code REDACTED:1— REDACTED has 1144 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/display/editor/draw.js: 1129 lines of code src/display/editor/draw.js:1— src/display/editor/draw.js has 1129 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/struct_tree.js: 1122 lines of code src/core/struct_tree.js:1— src/core/struct_tree.js has 1122 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/scripting_api/doc.js: 1122 lines of code src/scripting_api/doc.js:1— src/scripting_api/doc.js has 1122 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
web/app_options.js: 1108 lines of code web/app_options.js:1— web/app_options.js has 1108 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· src/display/canvas_dependency_tracker.js · ×1
src/display/canvas_dependency_tracker.js: 1103 lines of code src/display/canvas_dependency_tracker.js:1— src/display/canvas_dependency_tracker.js has 1103 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
web/comment_manager.js: 1089 lines of code web/comment_manager.js:1— web/comment_manager.js has 1089 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/standard_fonts.js: 1076 lines of code src/core/standard_fonts.js:1— src/core/standard_fonts.js has 1076 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
src/core/type1_parser.js: 1042 lines of code src/core/type1_parser.js:1— src/core/type1_parser.js has 1042 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· src/core/postscript/wasm_compiler.js · ×1
src/core/postscript/wasm_compiler.js: 1008 lines of code src/core/postscript/wasm_compiler.js:1— src/core/postscript/wasm_compiler.js has 1008 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
No lint or typecheck 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.
Unused dependency 'cached-iterable' — Declared in the root 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.
Unused dependency 'caniuse-lite' — Declared in the root 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.
Unused dependency 'core-js' — Declared in the root 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.
Duplicated predicate src/display/editor/comment.js:161— `!(signal instanceof AbortSignal) || signal.aborted` appears character-identically in 2 files — src/display/editor/comment.js, src/display/editor/toolbar.js. 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 src/core/postscript/js_evaluator.js:214— `!this._compileNode(second) || !this._compileNode(first)` appears character-identically in 2 files — src/core/postscript/js_evaluator.js, src/core/postscript/wasm_compiler.js. 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 src/display/fetch_stream.js:121— `!this._isStreamingSupported && this._isRangeSupported` appears character-identically in 2 files — src/display/fetch_stream.js, src/display/node_stream.js. 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 src/scripting_api/aform.js:460— `("a" <= char && char <= "z") || ("A" <= char && char <= "Z")` appears character-identically in 2 files — src/scripting_api/aform.js, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/scripting_api/aform.js:465— `("a" <= char && char <= "z") || ("A" <= char && char <= "Z") || ("0" <= char && char <= "9")` appears character-identically in 2 files — src/scripting_api/aform.js, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/core/ascii_hex_stream.js:51— `(ch >= 0x41 && ch <= 0x46) || (ch >= 0x61 && ch <= 0x66)` appears character-identically in 2 files — src/core/ascii_hex_stream.js, src/core/parser.js. 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 web/alt_text_manager.js:93— `(e.ctrlKey || e.metaKey) && e.key === "Enter" && !saveButton.disabled` appears character-identically in 3 files — web/alt_text_manager.js, web/comment_manager.js, web/new_alt_text_manager.js. 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 src/core/font_renderer.js:775— `(typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) || FeatureTest.isFloat16ArraySupported` appears character-identically in 3 files — src/core/font_renderer.js, src/display/canvas_dependency_tracker.js, src/display/obj_bin_transform_display.js. 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 src/core/document.js:1545— `Array.isArray(fields) && fields.length > 0` appears character-identically in 2 files — src/core/document.js, src/core/editor/pdf_editor.js. 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 web/pdf_thumbnail_viewer.js:604— `Array.isArray(labels) && this.pdfDocument.numPages === labels.length` appears character-identically in 2 files — web/pdf_thumbnail_viewer.js, web/pdf_viewer.js. 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 src/core/primitives.js:194— `Array.isArray(value) || ArrayBuffer.isView(value)` appears character-identically in 2 files — src/core/primitives.js, src/core/writer.js. 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 src/core/image.js:260— `dict.getRaw("CS") || dict.getRaw("ColorSpace")` appears character-identically in 2 files — src/core/image.js, src/core/pattern.js. 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 web/viewer-geckoview.js:65— `document.readyState === "interactive" || document.readyState === "complete"` appears character-identically in 2 files — web/viewer-geckoview.js, web/viewer.js. 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 web/pdf_page_view.js:830— `drawingDelay >= 0 && drawingDelay < 1000` appears character-identically in 2 files — web/pdf_page_view.js, web/pdf_viewer.js. 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 src/display/editor/annotation_editor_layer.js:474— `event.button !== 0 || (event.ctrlKey && isMac)` appears character-identically in 2 files — src/display/editor/annotation_editor_layer.js, src/display/editor/editor.js. 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 src/core/postscript/js_evaluator.js:204— `first.type !== PS_NODE.const || !Number.isInteger(first.value) || !this._compileNode(second)` appears character-identically in 2 files — src/core/postscript/js_evaluator.js, src/core/postscript/wasm_compiler.js. 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 REDACTED:144— `printAnnotationStoragePromise || Promise.resolve()` appears character-identically in 2 files — REDACTED, web/pdf_print_service.js. 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 REDACTED:162— `size.width === width && size.height === height` appears character-identically in 2 files — REDACTED, web/pdf_print_service.js. 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 src/display/editor/freetext.js:865— `this.annotationElementId && !this.#hasElementChanged(serialized)` appears character-identically in 3 files — src/display/editor/freetext.js, src/display/editor/highlight.js, src/display/editor/ink.js. 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 src/display/api.js:1705— `typeof PDFJSDev !== "undefined" && !PDFJSDev.test("GENERIC")` appears character-identically in 2 files — src/display/api.js, web/genericcom.js. 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 src/core/document.js:2302— `typeof PDFJSDev !== "undefined" && !PDFJSDev.test("TESTING || INTERNAL_VIEWER")` appears character-identically in 2 files — src/core/document.js, src/core/internal_viewer_utils.js. 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 src/core/worker.js:108— `typeof PDFJSDev !== "undefined" && !PDFJSDev.test("TESTING")` appears character-identically in 7 files — src/core/worker.js, src/display/api.js, src/display/renderer_worker.js, src/display/renderer_worker_proxy.js. 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 REDACTED:1708— `typeof PDFJSDev !== "undefined" && PDFJSDev.test("CHROME")` appears character-identically in 2 files — REDACTED, web/app_options.js. 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 src/display/api.js:284— `typeof PDFJSDev !== "undefined" && PDFJSDev.test("GENERIC") && isNodeJS` appears character-identically in 3 files — src/display/api.js, src/display/api_utils.js, src/display/network_stream.js. 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 src/display/editor/tools.js:665— `typeof PDFJSDev !== "undefined" && PDFJSDev.test("LIB") && typeof document === "undefined"` appears character-identically in 2 files — src/display/editor/tools.js, web/ui_utils.js. 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.
Orphaned file REDACTED:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file REDACTED:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/core/xfa/formcalc_lexer.js:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/core/xfa/locale_set.js:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file extensions/chromium/preserve-referer.js:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/core/xfa/connection_set.js:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Silent fallback default in catch gulpfile.mjs:812— `checkFile` swallows every exception into `return false` — 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 gulpfile.mjs:821— `checkDir` swallows every exception into `return false` — 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 test/integration/test_utils.mjs:393— `waitForSerialized` swallows every exception into `return false` — 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 test/integration/test_utils.mjs:580— `serializeBitmapDimensions` swallows every exception into `return false` — 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 web/firefoxcom.js:708— `viewCertificate` swallows every exception into `return false` — 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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 31 significant file(s) lose their only recent owner: src/core/parser.js, src/core/xfa/xfa_object.js, src/core/chunked_stream.js, external/cmapscompress/compress.mjs, REDACTED, web/pdf_document_properties.js, src/core/primitives.js, src/core/calculate_sha_other.js (+23 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 14 significant file(s) lose their only recent owner: web/internal/multiline_view.js, src/display/touch_manager.js, src/scripting_api/event.js, src/display/editor/toolbar.js, src/display/webgpu.js, src/display/editor/ink.js, external/ccov/coverage_search.mjs, src/core/editor/print_appearances.js (+6 more). Pair on, review, or document these before any departure.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 1 of 1 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (167170 LoC, 590 module-visible types across 32 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 6 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: REDACTED, REDACTED, src/core/xfa/formcalc_lexer.js, src/core/xfa/locale_set.js, extensions/chromium/preserve-referer.js, src/core/xfa/connection_set.js (7 orphaned of 264 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 264 of the 326 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No 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· Write-only private field '#hasGPU' · ×1
Write-only private field '#hasGPU' src/core/pattern.js:80— This private field is assigned but never read: every reference in its class is a plain assignment, no string key or test reads it by name, and the instance never escapes as a whole (so nothing serialises or destructures it). The value it holds is dead state — read it where it was meant to take effect, or remove the field and its assignments.
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 0/6 async functions that make a cancellable request (fetch, axios, ky, ofetch) 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.
Skipped (documented): (unnamed test) test/chromium/test-telemetry.js:449— Skipped with a documented reason — a deferral, not lazy debt: declared with no body — a pending test the runner lists but never runs
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 10 file(s) — `REDACTED`, `src/core/worker.js`, `src/display/api.js`, `src/display/renderer_worker.js`, `src/scripting_api/app.js`, … (+5 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a17977-9a93-7852-8adf-76e028141397 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 57 · Warnings: 1594 · Recommendations: 49 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 26-10-2026 @ 18:27 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.