Public report — pdf.js, published 16 Aug 2026.
Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version;
ask the repo owner for the full report.
558findings with an exact file:lineof 571 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
39/120dimensions across the health lenses166343 LoC — wide & deep
Executive summary
Read through the Production lens — the standard calibration. *Green* means good enough to run in production. The score is absolute and comparable across repos.
mozilla/pdf.js carries serious gaps (45%). Several issues below can materially affect correctness, security, or the cost of changing it — and propagate to everything that depends on it.
It is strongest in Domain Modelling (100%) — the domain model is expressive and well-guarded. Architecture (99%) is solid too.
The area that most needs attention is Code Health (30%) — changes there are slower and more error-prone. Accessibility (36%) is the next concern — it raises ongoing delivery and operational cost.
Leadership focus, highest impact first: Migrate the remaining .js/.jsx files to TypeScript (Type Safety); each oversized file along the responsibilities already in it (Large Files); Break down the listed branch-heavy functions (Cyclomatic Complexity).
For scale: Large (~166,343 production lines); rebuilding it from scratch would take roughly ~1.4 person-years (~1–3 engineers). Approximate, ±~30%.
It builds on a genuinely strong Domain Modelling foundation (100%); the priorities above are the highest-leverage way to bring the rest up to that level.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Raise Code Health 30 → 70 (the Healthy floor) ⇒ headline 45 → ~56.
Code composition — where the lines go
Tests 100%
New since the last scan (100+)
299 finding(s) are new versus the previous scan (2026-08-06) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
0.7× (at 45% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~1.4 person-years of build effort (about ~€210,000 to rebuild). Its weakest lens is Code Health at 30% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Migrate the remaining .js/.jsx files to TypeScript.
Value concentrated against a weak lens · High · Value at risk
This is a Large asset (~1.4 person-years to rebuild), and its weakest lens is Code Health at 30%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Code Health first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 21.8–131 engineer-days every year, paid as drag on the ~165,532 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–5 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 5–12% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 40,816 line(s) changed over a 90-day window ⇒ ~165,532/year · D1/D2/D4 code quality: averaging 5.9/10 ⇒ a 5–12% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 5 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Migrate the remaining .js/.jsx files to TypeScript. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Migrate the remaining .js/.jsx files to TypeScript.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 5.9/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 5–12% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4 code quality: averaging 5.9/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
At a glance — Code Health · 30% · Weak · gated by D2, D3, 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
A02:2021 — Cryptographic Failures
3
High / Critical
Roadmap
Top priorities: Migrate the remaining .js/.jsx files to TypeScript; Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package; Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Migrate the remaining .js/.jsx files to TypeScript.
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 your test runner's axe binding (jest-axe, vitest-axe, cypress-axe or @axe-core/playwright) in tests, then gate axe/pa11y/Lighthouse in CI.
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. 38 of 39 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 1 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.5 — 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 — 39 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, 558 of 571 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.
D21 Naming Consistency — LLM provider failed — The model provider returned an unusable result, so this LLM-assisted dimension fell back to a measurement gap (confidence 0) rather than a penalty. Re-run with a reachable provider to score it.
D30 Dependency Vulnerabilities — scanner not present in this environment — The backing tool was not installed where this scan ran, so this dimension was not scored. Install the tool (or run in the hosted environment, where it is always present) for a graded result.
Repo exclusion declarations: 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 (jscpd) — it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement.
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").
D33 JS/npm Dependency Vulnerabilities: JS/npm CVE matching reads package manifests and lockfiles — risk from how a dependency is used, and advisories not yet published, fall outside this scan.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A clean result is "no unlabelled native control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
The LLM boundary
LLM-set scores this run (2): D19, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score (documentation, ADR quality, naming, comment value, onboarding) — D25 sets the ADR-conformance fraction over sampled code, D22 judges API accuracy over a sample. These are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
158 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was onKeyDown at 120. A further 3 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being create at 28 — they are counted neither in the figure above nor in this dimension's score.
+ 149 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 constructor (cyclomatic 17) finding(s) in Cyclomatic Complexity — start with pdf_thumbnail_viewer.js, field.js, event.js. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 2 (anonymous) (cyclomatic 26) finding(s) in Cyclomatic Complexity — start with pdf_thumbnail_viewer.js, tree_view.js. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 2 (anonymous) (cyclomatic 19) finding(s) in Cyclomatic Complexity — start with pdf_find_controller.js, worker.js. — One of this dimension's main actionable groups (2 warning-level).
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.
+ 239 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 (anonymous) (cognitive 18) finding(s) in Cognitive Complexity — start with pdf_viewer.js, pdf_thumbnail_viewer.js, draw_ops_view.js. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 3 constructor (cognitive 16) finding(s) in Cognitive Complexity — start with field.js, event.js, pattern.js. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 2 render (cognitive 31) finding(s) in Cognitive Complexity — start with xfa_layer.js, annotation_layer.js. — One of this dimension's main actionable groups (2 warning-level).
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 Classes0.0 / 10Critical✓ 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 56 FileTooLong finding(s) in God Classes — start with template.js, glyphlist.js, evaluator.js. — One of this dimension's main actionable groups (56 warning-level).
Resolve the 23 TooManyMethods finding(s) in God Classes — start with canvas_dependency_tracker.js (3), config.js, editor.js. — One of this dimension's main actionable groups (23 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 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.
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: web/app.js (20×120=2400); src/core/evaluator.js (20×110=2200); src/core/editor/pdf_editor.js (29×58=1682)
Hotspot: web/app.js · ×67web/app.js
What to do
Resolve the 67 Hotspot finding(s) in Churn × Complexity Hotspots — start with fonts.js (2), util.js (2), app.js. — One of this dimension's main actionable groups (67 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 Factor7.5 / 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.
63 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is web/internal/page_view.js.
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: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
PDF.js has excellent documentation: an authoritative README with Contributing, Getting Started (online demo, browser extensions), and a dedicated font-tests, standard_fonts, jbig2, iccs, cmapscompress, brotli, and webpack example directories. The README itself is well written and complete for the project's size.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Git-history secret scan via gitleaks detect over full history in an isolated checkout; each match flagged High. Exhaustive; degrades cleanly when tool absent.
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.
Secret: aws-access-token · ×2external/jbig2/jbig2_nowasm_fallback.js:4detected by gitleaks finding
Rotate the exposed credentials — git history can't be un-committed
What to do
Resolve the 2 Secret finding(s) in Secrets (history) — start with jbig2_nowasm_fallback.js, pdfjs.config. — 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: 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.
2 of 255 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is extensions/chromium/preserve-referer.js.
Further orphaned files (smaller)
✓ On the Gold path — maintain.
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; coupling through a build step, config, or non-source file isn't seen.
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.
Resolve the 1 No build provenance finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 No artifact signing finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 No SBOM finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
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 dependencies have known published vulnerabilities (CVEs) per the OSV database — read natively from whatever lockfile the repository ships (Cargo, npm, Go, Python, Maven, RubyGems, …). D33 and D30 add ecosystem-specific scanners on top for npm and .NET.
Method: Multi-ecosystem dependency-CVE scan via osv-scanner --recursive (queries the osv.dev database + parses lockfiles natively across ecosystems: npm package-lock/yarn/pnpm/bun, Go go.mod, Rust Cargo.lock, Maven/Gradle pom.xml/gradle.lockfile, PyPI requirements.txt/poetry.lock/Pipfile.lock, Composer composer.lock, RubyGems Gemfile.lock, Hex mix.lock, pub pubspec.lock, Swift Package.resolved); severity tally (Critical/High/Medium/Low) to 0-10 tight normalizer (8.0). NotApplicable only when the repo declares no supported non-.NET dependency lockfile (a NuGet-only repo stays NotApplicable — .NET CVEs are D30's domain); coverage needs a resolved lockfile. Additive to D33 (trivy fs); exhaustive + deterministic, DB kept fresh.
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×5) — viewer-snippet-chrome-overlays.html:17, viewer.html:378, viewer.html:403, …
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) — viewer.html:1034, viewer.html:1104
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). (×6) — viewer.html:1046, viewer.html:1099, viewer.html:1121, …
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.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×3) — options.html:17, viewer-geckoview.html:23, 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) — options.html:17, debugger.html:17, 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) — viewer-geckoview.html:26, 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, 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.
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. — viewer.html:1201
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.
Abstract roles exist only to organise the ARIA taxonomy and must never be used in markup. Use a concrete role. (×5) — viewer.html:1016, viewer.html:1092, 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) — viewer.html:1212, 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.
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.
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 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 your test runner's axe binding (jest-axe, vitest-axe, cypress-axe or @axe-core/playwright) in tests, then gate axe/pa11y/Lighthouse in CI.
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (TypeORM/Prisma/MikroORM/Sequelize/Mongoose) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
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 significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
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.
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 · 437 plain JS — the untyped files are extensions/chromium/background.js, extensions/chromium/contentscript.js, extensions/chromium/extension-router.js, extensions/chromium/options/migration.js, extensions/chromium/options/options.js, extensions/chromium/pdfHandler.js (+431 more).
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Copy-pasted token-identical blocks across the frontend (the D4 clone algorithm over JS/TS tokens, D-386).
Method: Copy-pasted token-identical blocks across the frontend (the D4 clone algorithm run over JS/TS tokens). Deterministic.
src/core/evaluator.js:2058 · src/core/evaluator.js:2097 — 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. — evaluator.js:2058
src/core/xfa/template.js:678 · src/core/xfa/template.js:5346 — 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. — template.js:678
src/core/xfa/config.js:316 · src/core/xfa/config.js:757 — 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. — config.js:316
src/core/annotation.js:5556 · src/core/evaluator.js:144 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — annotation.js:5556
src/core/catalog.js:1015 · src/core/catalog.js:1045 — 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. — catalog.js:1015
src/core/xfa/bind.js:186 · src/core/xfa/bind.js:310 — 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. — bind.js:186
src/core/xfa/template.js:2300 · src/core/xfa/template.js:2652 — 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. — template.js:2300
src/core/xfa/template.js:2324 · src/core/xfa/template.js:4824 — 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. — template.js:2324
src/core/xfa/template.js:2495 · src/core/xfa/template.js:5098 — 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. — template.js:2495
extensions/chromium/options/migration.js:112 · extensions/chromium/options/migration.js:132 — 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. Check what actually differs between the copies before collapsing them: every one of them is an argument to a `addListener(…)` call, so where these calls are a MATRIX of cases — one per input, differing precisely in the case each one pins — the repetition is the enumeration and extracting the shared part would delete cases rather than de-duplicate anything. — migration.js:112
src/core/annotation.js:5205 · src/core/annotation.js:5250 — 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. — annotation.js:5205
src/core/evaluator.js:224 · src/display/annotation_layer.js:2533 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — evaluator.js:224
src/core/postscript/ast.js:1099 · src/core/postscript/ast.js:1166 — 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. — ast.js:1099
src/core/worker.js:920 · src/core/worker.js:962 — 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. — worker.js:920
src/core/xfa/bind.js:333 · src/core/xfa/bind.js:351 — 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. — bind.js:333
src/core/xfa/config.js:147 · src/core/xfa/locale_set.js:52 · src/core/xfa/locale_set.js:164 · src/core/xfa/locale_set.js:203 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — config.js:147
src/core/xfa/config.js:497 · src/core/xfa/config.js:1198 — 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. — config.js:497
src/core/xfa/config.js:760 · src/core/xfa/config.js:865 · src/core/xfa/config.js:1037 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — config.js:760
src/core/xfa/config.js:1126 · src/core/xfa/config.js:1228 — 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. — config.js:1126
src/core/xfa/template.js:1819 · src/core/xfa/template.js:2162 — 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. — template.js:1819
src/core/xfa/template.js:1929 · src/core/xfa/template.js:2880 — 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. — template.js:1929
src/display/annotation_layer.js:3599 · src/display/annotation_layer.js:3630 · src/display/annotation_layer.js:3661 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — annotation_layer.js:3599
src/display/annotation_layer.js:3877 · src/display/annotation_layer.js:3893 — 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. — annotation_layer.js:3877
src/core/annotation.js:4334 · src/core/annotation.js:5089 — 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. — annotation.js:4334
src/core/brotli_stream.js:60 · src/core/flate_stream.js:167 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — brotli_stream.js:60
src/core/core_utils.js:67 · src/core/xfa/config.js:60 · src/core/xfa/config.js:92 · src/core/xfa/config.js:210 · +12 more site(s) not listed — the 4 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — core_utils.js:67
src/core/xfa/config.js:1056 · src/core/xfa/locale_set.js:34 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — config.js:1056
src/core/catalog.js:947 · src/core/catalog.js:968 — 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. — catalog.js:947
src/core/cff_parser.js:1694 · src/core/core_utils.js:360 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — cff_parser.js:1694
src/core/editor/pdf_editor.js:603 · src/core/editor/pdf_editor.js:1571 — 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. — pdf_editor.js:603
src/core/evaluator.js:1841 · src/core/evaluator.js:2205 · src/core/evaluator.js:3464 · src/core/evaluator.js:3520 — 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. — evaluator.js:1841
src/core/evaluator.js:2814 · src/core/evaluator.js:2880 — 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. — evaluator.js:2814
src/core/parser.js:424 · src/core/parser.js:497 — 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. — parser.js:424
src/core/xfa/config.js:467 · src/core/xfa/config.js:532 — 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. — config.js:467
src/core/xfa/config.js:1359 · src/core/xfa/connection_set.js:148 · src/core/xfa/locale_set.js:243 · src/core/xfa/xhtml.js:533 — the 4 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — config.js:1359
src/core/xfa/formcalc_parser.js:611 · src/core/xfa/formcalc_parser.js:815 — 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. — formcalc_parser.js:611
src/core/xfa/formcalc_parser.js:830 · src/core/xfa/formcalc_parser.js:921 — 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. — formcalc_parser.js:830
src/core/xfa/formcalc_parser.js:867 · src/core/xfa/formcalc_parser.js:883 — 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. — formcalc_parser.js:867
src/core/xfa/template.js:525 · src/core/xfa/template.js:3684 · src/core/xfa/template.js:4631 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — template.js:525
src/core/xfa/template.js:1379 · src/core/xfa/template.js:1723 · src/core/xfa/template.js:3871 · src/core/xfa/template.js:5837 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. — template.js:1379
397 further occurrence(s) are not listed individually; the score already reflects all 437.
What to do
Extract the duplicated blocks into shared functions/components.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
Branch-heavy code is where defects cluster — extract decisions into smaller functions. (×20) — app.js:3145, fonts.js:1423, evaluator.js:1730, …
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.
106 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: src/core/xfa/template.js (5910), src/core/annotation.js (5233), src/core/evaluator.js (5034), src/core/glyphlist.js (4552), src/display/canvas.js (3947), src/display/annotation_layer.js (3933) (+100 more).
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.8 / 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. (×25) — app.js, pdf_thumbnail_viewer.js, comment_manager.js, …
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 D33 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D33). Deterministic.
Do you agree with this assessment?
R6 · Tooling6.7 / 10Adequate✓ 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 ✗
What to do
Add `tsc --noEmit` as package.json scripts and run them in CI.
Do you agree with this assessment?
R7 · Dead Code10.0 / 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.
441 file(s) (~260383 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: test/unit/test_utils.js imports '../../../../test/webserver.mjs', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here.
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. — types
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. — 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.
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.
Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Not included — 81 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 — no DI registrations detected
AX10 Code composition — not assessed — code composition is computed by ROLE over a document set that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — no singleton implementations detected
AX3 Project dependency cycles — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX4 Dependency direction — not assessed — project cycles and dependency direction are computed over a project-reference graph that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — not assessed — test isolation is computed from a project graph (which projects are test projects, and what they reference) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D10 Test Quality — ~38 lines of test source are present (.ts, .mjs, .js) but the test-quality collector reads C# only, so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included
D12 Dependency Hygiene — Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
D14 License Compliance — Not scored — this repository's package manifest is not parsed for licence data yet. A gap in the analyzer's language coverage, NOT a finding that the repository's licenses are compliant (package.json), which this pass does not parse yet — so this dimension asserts nothing about this repository's licensing in either direction.
D17 Explicit Debt — explicit-debt markers are read through a C# workspace today, so they were not read for this repository's language — this asserts nothing about how many markers the code carries. Not scored — this is a gap in the analyzer, not a finding about this repository
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
D21 Naming Consistency — LLM evaluation failed
D22 Internal API Consistency — No exposed public API
D23 Boundary Type-Coupling — Zero projects and zero LoC mean the codebase is trivial and has no structure to justify boundaries.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D26 Project Cohesion — Project cohesion is assessed over the .NET project set; this target exposed no projects, so project size and spread could not be assessed. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D27 Navigability — No calls could be sampled, so navigability was not assessed — tracing effort is measured over resolved call sites and this target exposed none. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D29 Static Analysis (SAST) — Static Analysis (SAST) not included (time budget)
D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (package.json — not scanned yet) — where an OSV-supported manifest exists, dependency vulnerabilities for this repository are reported under D38 instead.
D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Terraform, Kubernetes/Helm, CloudFormation); nothing to scan.
D32 Data Compliance (PII/GDPR) — No PII/GDPR-handling patterns detected (p/gdpr ruleset) — no data-compliance surface to assess.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D5 Coupling — Inter-project coupling could not be assessed — no analyzable project graph was found for this repository. Not scored: a gap in the analyzer's reach, not a verdict about this repository. (Coupling here is Martin afferent/efferent/instability plus reference cycles across a project-reference graph, read today from .NET project files; other ecosystems' module graphs are not read yet.)
D6 Cohesion (LCOM4) — No production classes were analyzable, so cohesion (LCOM4) was not measured (the solution likely failed to load or has no production code).
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 included — suite not readable by the collector
D9 Test Distribution — Test source is present (.ts, .mjs, .js) but the test-pyramid classifier reads C# only, so its unit/integration/BDD/E2E split couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
DM1 Aggregate boundaries — not scored for TypeScript: a class holding another class reads the same whether the inner type is an aggregate or a value object, so this cannot be decided from source without guessing — reported as guidance rather than measured
DM2 Strongly-typed ids — not scored for TypeScript: branded ids (`type Id = string & { __brand }`) are an uncommon idiom, so a bare-string id is not on its own evidence of a missing typed id — reported as guidance rather than measured
DM3 Integration-event coupling — not scored for TypeScript: a domain type used across packages is indistinguishable in source from a deliberate shared-kernel package, so this is reported as guidance rather than measured
DM4 Rich vs anemic model — not scored for TypeScript: telling a rich domain entity from an anemic data holder needs the behaviour a source-only read cannot always attribute (components, DTOs and readonly value objects are all legitimately data-shaped), so this is reported as guidance rather than measured
DM5 Encapsulated state — not scored for TypeScript: the language already steers state behind #private/private/readonly, so a mutable public field is rare enough that we report this as guidance rather than measuring it
DM7 Repository granularity — not scored for TypeScript: deciding whether a repository belongs to an aggregate root needs the aggregate structure, which source alone does not state — reported as guidance rather than measured
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this check looks for
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this check looks for
GD1 Unfinished & placeholder code — no source files
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P2 Observability — Observability was not assessed: this check reads a source model that does not carry this repository's product — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of a logging idiom this check recognises is NOT evidence that this repo lacks structured logging (it may log through its own ecosystem's logger). This is a gap in the analyzer, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
P7 Outbound HTTP resilience — not measured — the application kind could not be determined for this repo
P8 Schema migrations — not assessed — schema-migration practice is read from a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF2 Allocation hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
PF3 Async & latency hygiene — Performance was not assessed: this lens reads a source model that was not loaded for this repository, because the repository is written in a language this lens does not yet model or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository — in particular it is NOT a statement that this repo is unpackaged or performance-careless.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X9 Subsumed condition operand — Reported, not scored — this card publishes what it found rather than grading it. Its content is the findings and the key metric above.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Issue — 28 finding(s)
AC2 · Forms & labels· <button> with no accessible text · ×6
<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: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: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).
<button> with no accessible text web/viewer.html:1153— 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:1162— 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).
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:378— 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:403— 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.
Hotspot: web/app.js web/app.js— web/app.js changed 20 times in last 90 days, max complexity 120. 5 of those changes were fix/bug commits, and the other 15 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.
Hotspot: src/core/evaluator.js src/core/evaluator.js— src/core/evaluator.js changed 20 times in last 90 days, max complexity 110. 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.
Hotspot: src/core/editor/pdf_editor.js src/core/editor/pdf_editor.js— src/core/editor/pdf_editor.js changed 29 times in last 90 days, max complexity 58. 2 of those changes were fix/bug commits, and the other 27 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.
Hotspot: src/core/fonts.js src/core/fonts.js— src/core/fonts.js changed 13 times in last 90 days, max complexity 112. 1 of those changes was a fix/bug commit, and the other 12 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.
Hotspot: src/core/annotation.js src/core/annotation.js— src/core/annotation.js changed 28 times in last 90 days, max complexity 38. 2 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.
Hotspot: src/core/catalog.js src/core/catalog.js— src/core/catalog.js changed 15 times in last 90 days, max complexity 68. 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.
Hotspot: src/display/canvas.js src/display/canvas.js— src/display/canvas.js changed 16 times in last 90 days, max complexity 48. 2 of those changes were fix/bug commits, 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.
Hotspot: src/display/api.js src/display/api.js— src/display/api.js changed 13 times in last 90 days, max complexity 53. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves.
Hotspot: src/core/document.js src/core/document.js— src/core/document.js changed 20 times in last 90 days, max complexity 27. 3 of those changes were fix/bug commits, and the other 17 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.
Hotspot: src/core/worker.js src/core/worker.js— src/core/worker.js changed 16 times in last 90 days, max complexity 33. 1 of those changes was a fix/bug commit, and the other 15 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.
Hotspot: src/display/annotation_layer.js src/display/annotation_layer.js— src/display/annotation_layer.js changed 18 times in last 90 days, max complexity 29. 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.
Hotspot: src/core/cff_parser.js src/core/cff_parser.js— src/core/cff_parser.js changed 8 times in last 90 days, max complexity 54. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves.
Hotspot: web/pdf_viewer.js web/pdf_viewer.js— web/pdf_viewer.js changed 8 times in last 90 days, max complexity 48. 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.
Hotspot: src/core/type1_parser.js src/core/type1_parser.js— src/core/type1_parser.js changed 4 times in last 90 days, max complexity 74. 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.
Hotspot: src/core/xref.js src/core/xref.js— src/core/xref.js changed 5 times in last 90 days, max complexity 54. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves.
Hotspot: src/core/font_renderer.js src/core/font_renderer.js— src/core/font_renderer.js changed 4 times in last 90 days, max complexity 65. 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.
Hotspot: src/core/struct_tree.js src/core/struct_tree.js— src/core/struct_tree.js changed 9 times in last 90 days, max complexity 27. 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.
Hotspot: src/core/crypto.js src/core/crypto.js— src/core/crypto.js changed 6 times in last 90 days, max complexity 40. 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.
Hotspot: src/core/parser.js src/core/parser.js— src/core/parser.js changed 5 times in last 90 days, max complexity 47. 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.
Hotspot: web/pdf_thumbnail_viewer.js web/pdf_thumbnail_viewer.js— web/pdf_thumbnail_viewer.js changed 9 times in last 90 days, max complexity 26. 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.
Hotspot: web/pdf_page_view.js web/pdf_page_view.js— web/pdf_page_view.js changed 8 times in last 90 days, max complexity 29. 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.
Hotspot: src/core/xfa/template.js src/core/xfa/template.js— src/core/xfa/template.js changed 3 times in last 90 days, max complexity 74. 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.
Hotspot: gulpfile.mjs gulpfile.mjs— gulpfile.mjs changed 11 times in last 90 days, max complexity 20. 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.
Hotspot: src/display/editor/tools.js src/display/editor/tools.js— src/display/editor/tools.js changed 8 times in last 90 days, max complexity 27. 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.
Hotspot: src/display/draw_layer.js src/display/draw_layer.js— src/display/draw_layer.js changed 4 times in last 90 days, max complexity 53. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves.
FileTooLong: xfa/template.js src/core/xfa/template.js:0— FileTooLong — 4618 significant lines (blank, comment-only and punctuation-only lines excluded). 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:0— 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). 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:0— FileTooLong — 3664 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 (222-4838). 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:0— FileTooLong — 3616 significant lines (blank, comment-only and punctuation-only lines excluded). 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:0— 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). 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/canvas.js src/display/canvas.js:0— FileTooLong — 2795 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 (494-4360). 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:0— FileTooLong — 2774 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). 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:0— FileTooLong — 2509 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 (1054-3779). 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/app.js web/app.js:0— FileTooLong — 2214 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 73% of them inside a single declaration: PDFViewerApplication (110-2677). 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:0— FileTooLong — 1976 significant lines (blank, comment-only and punctuation-only lines excluded), about 96% of them inside a single declaration: PDFEditor (133-3133). 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:0— FileTooLong — 1715 significant lines (blank, comment-only and punctuation-only lines excluded), about 78% of them inside a single declaration: AnnotationEditorUIManager (738-3072). 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:0— FileTooLong — 1677 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). 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:0— 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-2807). 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:0— FileTooLong — 1607 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). 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:0— FileTooLong — 1388 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: AnnotationEditor (45-2449). 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/cff_parser.js src/core/cff_parser.js:0— FileTooLong — 1367 significant lines (blank, comment-only and punctuation-only lines excluded). 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_thumbnail_viewer.js web/pdf_thumbnail_viewer.js:0— FileTooLong — 1305 significant lines (blank, comment-only and punctuation-only lines excluded), about 98% of them inside a single declaration: PDFThumbnailViewer (89-1961). 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:0— FileTooLong — 1281 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: Catalog (120-2078). 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:0— FileTooLong — 1131 significant lines (blank, comment-only and punctuation-only lines excluded). 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:0— FileTooLong — 956 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). 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/crypto.js src/core/crypto.js:0— FileTooLong — 939 significant lines (blank, comment-only and punctuation-only lines excluded). 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:0— FileTooLong — 937 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). 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:0— FileTooLong — 867 significant lines (blank, comment-only and punctuation-only lines excluded). 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/comment_manager.js web/comment_manager.js:0— FileTooLong — 863 significant lines (blank, comment-only and punctuation-only lines excluded). 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: shared/util.js src/shared/util.js:0— FileTooLong — 838 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). 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.
+ 31 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×25
No test reaches this file web/app.js— 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— 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— 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— 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— 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— 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— 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— 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— 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— 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— 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— 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— 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— 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/canvas_context_details_view.js— 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— 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— 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— 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— 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_print_service.js— 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_outline_viewer.js— 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_document_properties.js— 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 extensions/chromium/pdfHandler.js— 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/caret_browsing.js— 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/builder/babel-plugin-pdfjs-preprocessor.mjs— 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.
TooManyMethods: ConfigNamespace src/core/xfa/config.js:1356— TooManyMethods — 140 methods. 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. 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:738— TooManyMethods — 124 methods. 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:6131— TooManyMethods — 114 methods. 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 src/display/canvas.js:494— TooManyMethods — 110 methods. 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:34— TooManyMethods — 109 methods. 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. 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:133— TooManyMethods — 56 methods. 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. 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:89— TooManyMethods — 51 methods. 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. 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. 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:29— TooManyMethods — 47 methods. 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. 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:2416— TooManyMethods — 38 methods. 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:32— TooManyMethods — 37 methods. 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:222— TooManyMethods — 36 methods. 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:691— TooManyMethods — 33 methods. 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:107— TooManyMethods — 33 methods. 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:423— TooManyMethods — 32 methods. 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:809— TooManyMethods — 32 methods. 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. 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:21— TooManyMethods — 31 methods. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (16 lines × 2 locations) extensions/chromium/options/migration.js:112— extensions/chromium/options/migration.js:112 · extensions/chromium/options/migration.js:132 — 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. Check what actually differs between the copies before collapsing them: every one of them is an argument to a `addListener(…)` call, so where these calls are a MATRIX of cases — one per input, differing precisely in the case each one pins — the repetition is the enumeration and extracting the shared part would delete cases rather than de-duplicate anything.
Duplicated block (16 lines × 2 locations) src/core/annotation.js:5205— src/core/annotation.js:5205 · src/core/annotation.js:5250 — 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 (16 lines × 2 locations) src/core/evaluator.js:224— src/core/evaluator.js:224 · src/display/annotation_layer.js:2533 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (16 lines × 2 locations) src/core/postscript/ast.js:1099— src/core/postscript/ast.js:1099 · src/core/postscript/ast.js:1166 — 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 (16 lines × 2 locations) src/core/worker.js:920— src/core/worker.js:920 · src/core/worker.js:962 — 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 (16 lines × 2 locations) src/core/xfa/bind.js:333— src/core/xfa/bind.js:333 · src/core/xfa/bind.js:351 — 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 (16 lines × 2 locations) src/core/xfa/config.js:497— src/core/xfa/config.js:497 · src/core/xfa/config.js:1198 — 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 (16 lines × 2 locations) src/core/xfa/config.js:1126— src/core/xfa/config.js:1126 · src/core/xfa/config.js:1228 — 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 (16 lines × 2 locations) src/core/xfa/template.js:1819— src/core/xfa/template.js:1819 · src/core/xfa/template.js:2162 — 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 (16 lines × 2 locations) src/core/xfa/template.js:1929— src/core/xfa/template.js:1929 · src/core/xfa/template.js:2880 — 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 (16 lines × 2 locations) src/display/annotation_layer.js:3877— src/display/annotation_layer.js:3877 · src/display/annotation_layer.js:3893 — 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 (14 lines × 2 locations) src/core/catalog.js:947— src/core/catalog.js:947 · src/core/catalog.js:968 — 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 (14 lines × 2 locations) src/core/cff_parser.js:1694— src/core/cff_parser.js:1694 · src/core/core_utils.js:360 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (14 lines × 2 locations) src/core/editor/pdf_editor.js:603— src/core/editor/pdf_editor.js:603 · src/core/editor/pdf_editor.js:1571 — 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 (14 lines × 2 locations) src/core/evaluator.js:2814— src/core/evaluator.js:2814 · src/core/evaluator.js:2880 — 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 (14 lines × 2 locations) src/core/parser.js:424— src/core/parser.js:424 · src/core/parser.js:497 — 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 (14 lines × 2 locations) src/core/xfa/config.js:467— src/core/xfa/config.js:467 · src/core/xfa/config.js:532 — 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 (14 lines × 2 locations) src/core/xfa/formcalc_parser.js:611— src/core/xfa/formcalc_parser.js:611 · src/core/xfa/formcalc_parser.js:815 — 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 (14 lines × 2 locations) src/core/xfa/formcalc_parser.js:830— src/core/xfa/formcalc_parser.js:830 · src/core/xfa/formcalc_parser.js:921 — 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 (14 lines × 2 locations) src/core/xfa/formcalc_parser.js:867— src/core/xfa/formcalc_parser.js:867 · src/core/xfa/formcalc_parser.js:883 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2 locations) src/core/annotation.js:5556— src/core/annotation.js:5556 · src/core/evaluator.js:144 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (17 lines × 2 locations) src/core/catalog.js:1015— src/core/catalog.js:1015 · src/core/catalog.js:1045 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (17 lines × 2 locations) src/core/xfa/bind.js:186— src/core/xfa/bind.js:186 · src/core/xfa/bind.js:310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2 locations) src/core/xfa/template.js:2300— src/core/xfa/template.js:2300 · src/core/xfa/template.js:2652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2 locations) src/core/xfa/template.js:2324— src/core/xfa/template.js:2324 · src/core/xfa/template.js:4824 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2 locations) src/core/xfa/template.js:2495— src/core/xfa/template.js:2495 · src/core/xfa/template.js:5098 — 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.
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>.
constructor (cyclomatic 17) web/pdf_thumbnail_viewer.js:183— constructor has cyclomatic complexity 17 (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.
constructor (cyclomatic 17) src/scripting_api/field.js:22— constructor has cyclomatic complexity 17 (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.
constructor (cyclomatic 17) src/scripting_api/event.js:22— constructor has cyclomatic complexity 17 (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.
(anonymous) (cognitive 18) web/pdf_viewer.js:993— (anonymous) has cognitive complexity 18 (threshold 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.
(anonymous) (cognitive 18) web/pdf_thumbnail_viewer.js:1397— (anonymous) has cognitive complexity 18 (threshold 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.
(anonymous) (cognitive 18) web/internal/draw_ops_view.js:548— (anonymous) has cognitive complexity 18 (threshold 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.
constructor (cognitive 16) src/scripting_api/field.js:22— constructor has cognitive complexity 16 (threshold 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.
constructor (cognitive 16) src/scripting_api/event.js:22— constructor has cognitive complexity 16 (threshold 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.
constructor (cognitive 16) src/core/pattern.js:464— constructor has cognitive complexity 16 (threshold 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.
Duplicated block (15 lines × 2 locations) src/core/annotation.js:4334— src/core/annotation.js:4334 · src/core/annotation.js:5089 — 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 (15 lines × 2 locations) src/core/brotli_stream.js:60— src/core/brotli_stream.js:60 · src/core/flate_stream.js:167 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (15 lines × 2 locations) src/core/xfa/config.js:1056— src/core/xfa/config.js:1056 · src/core/xfa/locale_set.js:34 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (14 lines × 4 locations) src/core/evaluator.js:1841— src/core/evaluator.js:1841 · src/core/evaluator.js:2205 · src/core/evaluator.js:3464 · src/core/evaluator.js:3520 — 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 (14 lines × 4 locations) src/core/xfa/config.js:1359— src/core/xfa/config.js:1359 · src/core/xfa/connection_set.js:148 · src/core/xfa/locale_set.js:243 · src/core/xfa/xhtml.js:533 — the 4 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (14 lines × 4 locations) src/core/xfa/template.js:1379— src/core/xfa/template.js:1379 · src/core/xfa/template.js:1723 · src/core/xfa/template.js:3871 · src/core/xfa/template.js:5837 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
(anonymous) (cyclomatic 26) web/pdf_thumbnail_viewer.js:1397— (anonymous) has cyclomatic complexity 26 (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.
(anonymous) (cyclomatic 26) web/internal/tree_view.js:122— (anonymous) has cyclomatic complexity 26 (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.
(anonymous) (cyclomatic 19) web/pdf_find_controller.js:205— (anonymous) has cyclomatic complexity 19 (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.
(anonymous) (cyclomatic 19) src/core/worker.js:592— (anonymous) has cyclomatic complexity 19 (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.
render (cognitive 31) src/display/xfa_layer.js:318— render has cognitive complexity 31 (threshold 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.
render (cognitive 31) src/display/annotation_layer.js:4032— render has cognitive complexity 31 (threshold 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.
(anonymous) (cognitive 28) web/pdf_find_controller.js:205— (anonymous) has cognitive complexity 28 (threshold 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.
(anonymous) (cognitive 28) src/display/api.js:2809— (anonymous) has cognitive complexity 28 (threshold 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.
Change coupling: app.js ↔ generic_scripting.js web/app.js— `web/app.js` and `web/generic_scripting.js` change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking.
Change coupling: api.js ↔ pdf.sandbox.js src/display/api.js— `src/display/api.js` and `src/pdf.sandbox.js` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well) 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.
Duplicated block (16 lines × 3 locations) src/core/xfa/config.js:760— src/core/xfa/config.js:760 · src/core/xfa/config.js:865 · src/core/xfa/config.js:1037 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3 locations) src/display/annotation_layer.js:3599— src/display/annotation_layer.js:3599 · src/display/annotation_layer.js:3630 · src/display/annotation_layer.js:3661 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
AC4 · Keyboard semantics· Anchor without href · ×1
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.
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.
onKeyDown (cyclomatic 120) web/app.js:3145— onKeyDown has cyclomatic complexity 120 (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.
checkAndRepair (cyclomatic 112) src/core/fonts.js:1423— checkAndRepair has cyclomatic complexity 112 (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.
promiseBody (cyclomatic 110) src/core/evaluator.js:1730— promiseBody has cyclomatic complexity 110 (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.
extractCidKeyedFontProgram (cyclomatic 74) src/core/type1_parser.js:749— extractCidKeyedFontProgram has cyclomatic complexity 74 (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.
parse (cyclomatic 65) src/core/font_renderer.js:382— parse has cyclomatic complexity 65 (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.
_initializeViewerComponents (cyclomatic 63) web/app.js:414— _initializeViewerComponents has cyclomatic complexity 63 (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.
translateFont (cyclomatic 61) src/core/evaluator.js:4451— translateFont has cyclomatic complexity 61 (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.
sanitizeTTProgram (cyclomatic 60) src/core/fonts.js:2468— sanitizeTTProgram has cyclomatic complexity 60 (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.
createImageData (cyclomatic 59) src/core/image.js:715— createImageData has cyclomatic complexity 59 (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.
readCmapTable (cyclomatic 56) src/core/fonts.js:1607— readCmapTable has cyclomatic complexity 56 (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.
indexObjects (cyclomatic 54) src/core/xref.js:429— indexObjects has cyclomatic complexity 54 (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.
#selectionChange (cyclomatic 53) src/display/draw_layer.js:385— #selectionChange has cyclomatic complexity 53 (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.
getDocument (cyclomatic 53) src/display/api.js:234— getDocument has cyclomatic complexity 53 (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.
constructor (cyclomatic 53) src/core/image.js:80— constructor has cyclomatic complexity 53 (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.
promiseBody (cyclomatic 53) src/core/evaluator.js:3191— promiseBody has cyclomatic complexity 53 (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.
convert (cyclomatic 52) src/core/type1_parser.js:92— convert has cyclomatic complexity 52 (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.
preEvaluateFont (cyclomatic 51) src/core/evaluator.js:4288— preEvaluateFont has cyclomatic complexity 51 (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.
constructor (cyclomatic 48) web/pdf_viewer.js:310— constructor has cyclomatic complexity 48 (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.
beginGroup (cyclomatic 48) src/display/canvas.js:3196— beginGroup has cyclomatic complexity 48 (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.
compareWithLastPosition (cyclomatic 48) src/core/evaluator.js:2723— compareWithLastPosition has cyclomatic complexity 48 (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.
findDCTDecodeInlineStreamEnd (cyclomatic 47) src/core/parser.js:343— findDCTDecodeInlineStreamEnd has cyclomatic complexity 47 (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.
showText (cyclomatic 45) src/display/canvas.js:2654— showText 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.
getObj (cyclomatic 45) src/core/parser.js:1278— 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.
extractFontProgram (cyclomatic 44) src/core/type1_parser.js:555— extractFontProgram has cyclomatic complexity 44 (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.
extractDataStructures (cyclomatic 42) src/core/evaluator.js:3609— extractDataStructures has cyclomatic complexity 42 (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.
compileType3Glyph (cyclomatic 41) src/core/fonts_utils.js:212— compileType3Glyph has cyclomatic complexity 41 (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.
buildPaintImageXObject (cyclomatic 41) src/core/evaluator.js:605— buildPaintImageXObject has cyclomatic complexity 41 (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.
scrollPageIntoView (cyclomatic 37) web/pdf_viewer.js:1795— scrollPageIntoView has cyclomatic complexity 37 (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.
fallbackToSystemFont (cyclomatic 36) src/core/fonts.js:1257— fallbackToSystemFont has cyclomatic complexity 36 (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.
(anonymous) (cyclomatic 35) src/scripting_api/util.js:82— (anonymous) has cyclomatic complexity 35 (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.
setGState (cyclomatic 35) src/core/evaluator.js:1115— setGState has cyclomatic complexity 35 (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.
#walk (cyclomatic 34) web/struct_tree_layer_builder.js:534— #walk has cyclomatic complexity 34 (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.
setHash (cyclomatic 34) web/pdf_link_service.js:360— setHash has cyclomatic complexity 34 (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.
(anonymous) (cyclomatic 33) src/core/worker.js:688— (anonymous) has cyclomatic complexity 33 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
getString (cyclomatic 33) src/core/parser.js:1071— getString has cyclomatic complexity 33 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
compileGlyf (cyclomatic 33) src/core/font_renderer.js:163— compileGlyf has cyclomatic complexity 33 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
extractWidths (cyclomatic 33) src/core/evaluator.js:4096— extractWidths has cyclomatic complexity 33 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
hasBlendModes (cyclomatic 32) src/core/evaluator.js:279— hasBlendModes has cyclomatic complexity 32 (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.
#removeType3ColorOperators (cyclomatic 32) src/core/evaluator.js:4965— #removeType3ColorOperators has cyclomatic complexity 32 (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.
(anonymous) (cyclomatic 31) web/text_layer_builder.js:272— (anonymous) has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
#updateFromSandbox (cyclomatic 31) web/pdf_scripting_manager.js:297— #updateFromSandbox has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
findDefaultInlineStreamEnd (cyclomatic 31) src/core/parser.js:202— findDefaultInlineStreamEnd has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
constructor (cyclomatic 31) src/core/fonts.js:1061— constructor has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
readBlock (cyclomatic 31) src/core/flate_stream.js:287— readBlock has cyclomatic complexity 31 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
printx (cyclomatic 30) src/scripting_api/util.js:269— 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.
buildTextContentItem (cyclomatic 30) src/core/evaluator.js:2950— buildTextContentItem 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.
#getPageAdvance (cyclomatic 29) web/pdf_viewer.js:2438— #getPageAdvance 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.
reset (cyclomatic 29) web/pdf_page_view.js:634— 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.
#renderCard (cyclomatic 29) web/digital_signature_properties_manager.js:428— #renderCard 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.
render (cyclomatic 29) src/display/annotation_layer.js:1490— render 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.
makeFilter (cyclomatic 29) src/core/parser.js:846— makeFilter 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.
createOS2Table (cyclomatic 29) src/core/fonts.js:800— createOS2Table 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.
_simpleFontToUnicode (cyclomatic 29) src/core/evaluator.js:3815— _simpleFontToUnicode 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.
dispatch (cyclomatic 28) src/scripting_api/event.js:83— dispatch has cyclomatic complexity 28 (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.
_binaryToExpr (cyclomatic 28) src/core/internal_viewer_utils.js:149— _binaryToExpr has cyclomatic complexity 28 (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.
pruneCompositeGlyphCycles (cyclomatic 28) src/core/glyf.js:695— pruneCompositeGlyphCycles has cyclomatic complexity 28 (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.
createCmapTable (cyclomatic 28) src/core/fonts.js:590— createCmapTable has cyclomatic complexity 28 (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.
nodeToSerializable (cyclomatic 27) src/core/struct_tree.js:1030— nodeToSerializable has cyclomatic complexity 27 (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.
getOperatorList (cyclomatic 27) src/core/document.js:471— getOperatorList has cyclomatic complexity 27 (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.
tableAttributes (cyclomatic 26) src/core/struct_tree.js:693— tableAttributes has cyclomatic complexity 26 (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.
fillGrayBuffer (cyclomatic 26) src/core/image.js:1000— fillGrayBuffer has cyclomatic complexity 26 (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.
parseXml (cyclomatic 25) src/core/xml_parser.js:174— 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.
setAttributes (cyclomatic 24) src/display/xfa_layer.js:222— setAttributes has cyclomatic complexity 24 (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.
isVisible (cyclomatic 24) src/display/optional_content_config.js:186— isVisible has cyclomatic complexity 24 (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.
paintChar (cyclomatic 24) src/display/canvas.js:2497— paintChar has cyclomatic complexity 24 (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.
getNumber (cyclomatic 24) src/core/parser.js:995— getNumber has cyclomatic complexity 24 (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.
sanitizeGlyph (cyclomatic 24) src/core/fonts.js:1986— sanitizeGlyph has cyclomatic complexity 24 (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.
loadFont (cyclomatic 24) src/core/evaluator.js:1250— loadFont has cyclomatic complexity 24 (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.
constructor (cyclomatic 23) web/pdf_page_view.js:183— constructor 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.
onWheel (cyclomatic 23) web/app.js:2992— onWheel 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.
toDateObject (cyclomatic 23) src/display/display_utils.js:294— toDateObject 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.
_createContainer (cyclomatic 23) src/display/annotation_layer.js:400— _createContainer 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.
compileFontInfo (cyclomatic 23) src/core/obj_bin_transform_core.js:101— compileFontInfo 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.
_charToGlyph (cyclomatic 23) src/core/fonts.js:3552— _charToGlyph 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.
normalizeBlendMode (cyclomatic 23) src/core/evaluator.js:130— normalizeBlendMode 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.
#collectFieldObjects (cyclomatic 23) src/core/document.js:1851— #collectFieldObjects 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.
#parseSignatureDict (cyclomatic 23) src/core/document.js:2083— #parseSignatureDict 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.
onPagesEdited (cyclomatic 22) web/pdf_viewer.js:1228— onPagesEdited 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.
_isValidExplicitDest (cyclomatic 22) src/shared/util.js:1081— _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.
constructor (cyclomatic 22) src/scripting_api/doc.js:39— constructor 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.
executeOperatorList (cyclomatic 22) src/display/canvas.js:662— executeOperatorList 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.
_createMaskCanvas (cyclomatic 22) src/display/canvas.js:938— _createMaskCanvas 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.
addNode (cyclomatic 22) src/core/struct_tree.js:951— addNode 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.
readBlockPng (cyclomatic 22) src/core/predictor_stream.js:137— 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.
getObj (cyclomatic 22) src/core/parser.js:121— getObj 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.
getFontSubstitution (cyclomatic 22) src/core/font_substitutions.js:714— getFontSubstitution 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.
read (cyclomatic 22) src/core/evaluator.js:5384— read 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.
documentInfo (cyclomatic 22) src/core/document.js:1535— documentInfo 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.
toJSObject (cyclomatic 22) src/core/document.js:2301— toJSObject 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.
getNormalizeWithNFKC (cyclomatic 21) web/pdf_find_utils.js:61— getNormalizeWithNFKC has cyclomatic complexity 21 (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.
_parseHashParams (cyclomatic 21) web/app.js:284— _parseHashParams has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity· show (cyclomatic 21) · ×1
show (cyclomatic 21) web/internal/draw_ops_view.js:221— show has cyclomatic complexity 21 (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.
render (cyclomatic 21) src/display/xfa_layer.js:318— render has cyclomatic complexity 21 (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.
onclick (cyclomatic 21) src/display/annotation_layer.js:1207— onclick has cyclomatic complexity 21 (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.
stringToPDFString (cyclomatic 21) src/core/string_utils.js:66— stringToPDFString has cyclomatic complexity 21 (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.
makeInlineImage (cyclomatic 21) src/core/parser.js:537— makeInlineImage has cyclomatic complexity 21 (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.
buildFormXObject (cyclomatic 21) src/core/evaluator.js:469— buildFormXObject has cyclomatic complexity 21 (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.
#findClosestThumbnail (cyclomatic 20) web/pdf_thumbnail_viewer.js:1874— #findClosestThumbnail has cyclomatic complexity 20 (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.
getHighestPriority (cyclomatic 20) web/pdf_rendering_queue.js:112— getHighestPriority has cyclomatic complexity 20 (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.
#onPagesEdited (cyclomatic 20) web/pdf_find_controller.js:1098— #onPagesEdited has cyclomatic complexity 20 (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.
_initializeMetadata (cyclomatic 20) web/app.js:1896— _initializeMetadata has cyclomatic complexity 20 (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.
#processStreamMessage (cyclomatic 20) src/shared/message_handler.js:393— #processStreamMessage has cyclomatic complexity 20 (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.
readXRefTable (cyclomatic 20) src/core/xref.js:230— readXRefTable has cyclomatic complexity 20 (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.
fetchCompressed (cyclomatic 20) src/core/xref.js:957— fetchCompressed has cyclomatic complexity 20 (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 20) src/core/writer.js:54— writeStream has cyclomatic complexity 20 (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.
sanitizeGlyphLocations (cyclomatic 20) src/core/fonts.js:2166— sanitizeGlyphLocations has cyclomatic complexity 20 (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.
switchView (cyclomatic 19) web/views_manager.js:229— switchView has cyclomatic complexity 19 (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.
#setAttributes (cyclomatic 19) web/struct_tree_layer_builder.js:351— #setAttributes has cyclomatic complexity 19 (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.
#setScaleUpdatePages (cyclomatic 19) web/pdf_viewer.js:1568— #setScaleUpdatePages has cyclomatic complexity 19 (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.
cancelRendering (cyclomatic 19) web/pdf_page_view.js:918— cancelRendering has cyclomatic complexity 19 (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.
moveCaret (cyclomatic 19) web/caret_browsing.js:261— moveCaret has cyclomatic complexity 19 (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.
parse (cyclomatic 19) src/core/struct_tree.js:901— parse has cyclomatic complexity 19 (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.
createNameTable (cyclomatic 19) src/core/fonts.js:954— createNameTable has cyclomatic complexity 19 (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.
draw (cyclomatic 18) web/pdf_page_view.js:1060— draw has cyclomatic complexity 18 (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.
initSandbox (cyclomatic 18) src/scripting_api/initialization.js:41— initSandbox has cyclomatic complexity 18 (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.
#appendText (cyclomatic 18) src/display/text_layer.js:322— #appendText has cyclomatic complexity 18 (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.
(anonymous) (cyclomatic 18) src/display/api.js:2809— (anonymous) has cyclomatic complexity 18 (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.
readXRefStream (cyclomatic 18) src/core/xref.js:347— readXRefStream has cyclomatic complexity 18 (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.
constructor (cyclomatic 18) src/core/pattern.js:151— constructor has cyclomatic complexity 18 (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.
getVisibleElements (cyclomatic 17) web/ui_utils.js:437— getVisibleElements has cyclomatic complexity 17 (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.
push (cyclomatic 17) web/pdf_history.js:193— push has cyclomatic complexity 17 (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.
toggle (cyclomatic 17) web/comment_manager.js:1093— toggle has cyclomatic complexity 17 (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.
initialize (cyclomatic 17) web/app.js:202— initialize has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity· run (cyclomatic 17) · ×1
run (cyclomatic 17) web/app.js:882— run has cyclomatic complexity 17 (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.
#renderValue (cyclomatic 17) web/internal/tree_view.js:640— #renderValue has cyclomatic complexity 17 (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.
formatArg (cyclomatic 17) web/internal/draw_ops_view.js:169— formatArg has cyclomatic complexity 17 (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.
AFNumber_Format (cyclomatic 17) src/scripting_api/aform.js:106— AFNumber_Format has cyclomatic complexity 17 (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.
setupStorage (cyclomatic 17) src/display/xfa_layer.js:151— setupStorage has cyclomatic complexity 17 (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.
recordCharacterBBox (cyclomatic 17) src/display/canvas_dependency_tracker.js:628— recordCharacterBBox has cyclomatic complexity 17 (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.
setGState (cyclomatic 17) src/display/canvas.js:1145— setGState has cyclomatic complexity 17 (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.
endGroup (cyclomatic 17) src/display/canvas.js:3460— endGroup has cyclomatic complexity 17 (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.
render (cyclomatic 17) src/display/annotation_layer.js:4032— render has cyclomatic complexity 17 (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.
readXRef (cyclomatic 17) src/core/xref.js:732— readXRef has cyclomatic complexity 17 (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.
searchNode (cyclomatic 17) src/core/xml_parser.js:353— 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.
canUpdateStructTree (cyclomatic 17) src/core/struct_tree.js:211— canUpdateStructTree has cyclomatic complexity 17 (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.
write (cyclomatic 17) src/core/glyf.js:404— write has cyclomatic complexity 17 (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.
_renderMatches (cyclomatic 16) web/text_highlighter.js:156— _renderMatches has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
#touchSwipe (cyclomatic 16) web/pdf_presentation_mode.js:299— #touchSwipe has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
update (cyclomatic 16) web/pdf_page_view.js:770— update has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
cssTransform (cyclomatic 16) web/pdf_page_view.js:969— cssTransform has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
(anonymous) (cyclomatic 16) web/app.js:1661— (anonymous) has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
_prepareSMaskCanvas (cyclomatic 16) src/display/canvas.js:1246— _prepareSMaskCanvas has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
extractPages (cyclomatic 16) src/display/api.js:2969— extractPages has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
render (cyclomatic 16) src/display/annotation_layer.js:985— render has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
#setAnnotationCanvasMap (cyclomatic 16) src/display/annotation_layer.js:4288— #setAnnotationCanvasMap has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
_parseContent (cyclomatic 16) src/core/xml_parser.js:80— _parseContent has cyclomatic complexity 16 (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.
getSoundFormat (cyclomatic 16) src/core/sound.js:45— getSoundFormat has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
readBlockTiff (cyclomatic 16) src/core/predictor_stream.js:51— readBlockTiff has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
#intersects (cyclomatic 16) src/core/intersector.js:65— #intersects has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
type1FontGlyphMapping (cyclomatic 16) src/core/fonts_utils.js:111— type1FontGlyphMapping has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
generateFont (cyclomatic 16) src/core/font_substitutions.js:634— generateFont has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
promiseBody (cognitive 191) src/core/evaluator.js:1730— promiseBody has cognitive complexity 191 (threshold 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.
checkAndRepair (cognitive 163) src/core/fonts.js:1423— checkAndRepair has cognitive complexity 163 (threshold 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.
onKeyDown (cognitive 142) web/app.js:3145— onKeyDown has cognitive complexity 142 (threshold 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.
sanitizeTTProgram (cognitive 125) src/core/fonts.js:2468— sanitizeTTProgram has cognitive complexity 125 (threshold 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.
parse (cognitive 119) src/core/font_renderer.js:382— parse has cognitive complexity 119 (threshold 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.
#selectionChange (cognitive 114) src/display/draw_layer.js:385— #selectionChange has cognitive complexity 114 (threshold 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.
preEvaluateFont (cognitive 112) src/core/evaluator.js:4288— preEvaluateFont has cognitive complexity 112 (threshold 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.
indexObjects (cognitive 108) src/core/xref.js:429— indexObjects has cognitive complexity 108 (threshold 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.
extractWidths (cognitive 108) src/core/evaluator.js:4096— extractWidths has cognitive complexity 108 (threshold 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.
readCmapTable (cognitive 101) src/core/fonts.js:1607— readCmapTable has cognitive complexity 101 (threshold 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.
createImageData (cognitive 93) src/core/image.js:715— createImageData has cognitive complexity 93 (threshold 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.
translateFont (cognitive 92) src/core/evaluator.js:4451— translateFont has cognitive complexity 92 (threshold 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.
hasBlendModes (cognitive 90) src/core/evaluator.js:279— hasBlendModes has cognitive complexity 90 (threshold 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.
constructor (cognitive 86) src/core/image.js:80— constructor has cognitive complexity 86 (threshold 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.
convert (cognitive 85) src/core/type1_parser.js:92— convert has cognitive complexity 85 (threshold 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.
promiseBody (cognitive 83) src/core/evaluator.js:3191— promiseBody has cognitive complexity 83 (threshold 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.
compileType3Glyph (cognitive 78) src/core/fonts_utils.js:212— compileType3Glyph has cognitive complexity 78 (threshold 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.
_initializeViewerComponents (cognitive 75) web/app.js:414— _initializeViewerComponents has cognitive complexity 75 (threshold 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.
parseXml (cognitive 75) src/core/xml_parser.js:174— parseXml has cognitive complexity 75 (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.
showText (cognitive 72) src/display/canvas.js:2654— showText has cognitive complexity 72 (threshold 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.
findDefaultInlineStreamEnd (cognitive 71) src/core/parser.js:202— findDefaultInlineStreamEnd has cognitive complexity 71 (threshold 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.
extractCidKeyedFontProgram (cognitive 68) src/core/type1_parser.js:749— extractCidKeyedFontProgram has cognitive complexity 68 (threshold 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.
buildPaintImageXObject (cognitive 66) src/core/evaluator.js:605— buildPaintImageXObject has cognitive complexity 66 (threshold 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.
#getPageAdvance (cognitive 64) web/pdf_viewer.js:2438— #getPageAdvance has cognitive complexity 64 (threshold 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.
read (cognitive 63) src/core/evaluator.js:5384— read has cognitive complexity 63 (threshold 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.
extractDataStructures (cognitive 62) src/core/evaluator.js:3609— extractDataStructures has cognitive complexity 62 (threshold 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.
setHash (cognitive 60) web/pdf_link_service.js:360— setHash has cognitive complexity 60 (threshold 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.
extractFontProgram (cognitive 60) src/core/type1_parser.js:555— extractFontProgram has cognitive complexity 60 (threshold 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.
#walk (cognitive 59) web/struct_tree_layer_builder.js:534— #walk has cognitive complexity 59 (threshold 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.
compareWithLastPosition (cognitive 59) src/core/evaluator.js:2723— compareWithLastPosition has cognitive complexity 59 (threshold 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.
isVisible (cognitive 58) src/display/optional_content_config.js:186— isVisible has cognitive complexity 58 (threshold 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.
compileGlyf (cognitive 58) src/core/font_renderer.js:163— compileGlyf has cognitive complexity 58 (threshold 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.
buildTextContentItem (cognitive 58) src/core/evaluator.js:2950— buildTextContentItem has cognitive complexity 58 (threshold 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.
readBlock (cognitive 56) src/core/flate_stream.js:287— readBlock has cognitive complexity 56 (threshold 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.
pruneCompositeGlyphCycles (cognitive 54) src/core/glyf.js:695— pruneCompositeGlyphCycles has cognitive complexity 54 (threshold 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.
(anonymous) (cognitive 52) src/scripting_api/util.js:82— (anonymous) has cognitive complexity 52 (threshold 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.
render (cognitive 52) src/display/annotation_layer.js:1490— render has cognitive complexity 52 (threshold 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.
fillGrayBuffer (cognitive 52) src/core/image.js:1000— fillGrayBuffer has cognitive complexity 52 (threshold 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.
(anonymous) (cognitive 51) src/core/worker.js:592— (anonymous) has cognitive complexity 51 (threshold 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.
fallbackToSystemFont (cognitive 51) src/core/fonts.js:1257— fallbackToSystemFont has cognitive complexity 51 (threshold 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.
constructor (cognitive 50) web/pdf_viewer.js:310— constructor has cognitive complexity 50 (threshold 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.
(anonymous) (cognitive 50) src/core/worker.js:688— (anonymous) has cognitive complexity 50 (threshold 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.
tableAttributes (cognitive 50) src/core/struct_tree.js:693— tableAttributes has cognitive complexity 50 (threshold 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.
executeOperatorList (cognitive 49) src/display/canvas.js:662— executeOperatorList has cognitive complexity 49 (threshold 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.
getObj (cognitive 47) src/core/parser.js:121— getObj has cognitive complexity 47 (threshold 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.
_simpleFontToUnicode (cognitive 47) src/core/evaluator.js:3815— _simpleFontToUnicode has cognitive complexity 47 (threshold 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.
getOperatorList (cognitive 47) src/core/document.js:471— getOperatorList has cognitive complexity 47 (threshold 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.
getDocument (cognitive 45) src/display/api.js:234— getDocument has cognitive complexity 45 (threshold 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.
(anonymous) (cognitive 44) web/text_layer_builder.js:272— (anonymous) has cognitive complexity 44 (threshold 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.
createCmapTable (cognitive 43) src/core/fonts.js:590— createCmapTable has cognitive complexity 43 (threshold 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.
getNormalizeWithNFKC (cognitive 42) web/pdf_find_utils.js:61— getNormalizeWithNFKC has cognitive complexity 42 (threshold 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.
#findStreamLength (cognitive 42) src/core/parser.js:662— #findStreamLength has cognitive complexity 42 (threshold 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.
printx (cognitive 41) src/scripting_api/util.js:269— printx has cognitive complexity 41 (threshold 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.
onPagesEdited (cognitive 38) web/pdf_viewer.js:1228— onPagesEdited has cognitive complexity 38 (threshold 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.
searchNode (cognitive 38) src/core/xml_parser.js:353— searchNode has cognitive complexity 38 (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.
dispatch (cognitive 37) src/scripting_api/event.js:83— dispatch has cognitive complexity 37 (threshold 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.
setAttributes (cognitive 37) src/display/xfa_layer.js:222— setAttributes has cognitive complexity 37 (threshold 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.
#walk (cognitive 37) src/core/object_loader.js:81— #walk has cognitive complexity 37 (threshold 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.
write (cognitive 37) src/core/glyf.js:404— write has cognitive complexity 37 (threshold 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.
scrollPageIntoView (cognitive 36) web/pdf_viewer.js:1795— scrollPageIntoView has cognitive complexity 36 (threshold 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.
beginGroup (cognitive 36) src/display/canvas.js:3196— beginGroup has cognitive complexity 36 (threshold 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.
readXRefStream (cognitive 36) src/core/xref.js:347— readXRefStream has cognitive complexity 36 (threshold 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.
(anonymous) (cognitive 35) web/internal/tree_view.js:122— (anonymous) has cognitive complexity 35 (threshold 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.
createOS2Table (cognitive 35) src/core/fonts.js:800— createOS2Table has cognitive complexity 35 (threshold 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.
loadFont (cognitive 35) src/core/evaluator.js:1250— loadFont has cognitive complexity 35 (threshold 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.
readBlockPng (cognitive 34) src/core/predictor_stream.js:137— readBlockPng has cognitive complexity 34 (threshold 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.
toJSObject (cognitive 34) src/core/document.js:2301— toJSObject has cognitive complexity 34 (threshold 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.
#renderCard (cognitive 33) web/digital_signature_properties_manager.js:428— #renderCard has cognitive complexity 33 (threshold 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.
#setAnnotationCanvasMap (cognitive 33) src/display/annotation_layer.js:4288— #setAnnotationCanvasMap has cognitive complexity 33 (threshold 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.
stringToPDFString (cognitive 33) src/core/string_utils.js:66— stringToPDFString has cognitive complexity 33 (threshold 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.
getHighestPriority (cognitive 32) web/pdf_rendering_queue.js:112— getHighestPriority has cognitive complexity 32 (threshold 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.
getScaleForStroking (cognitive 32) src/display/canvas.js:4247— getScaleForStroking has cognitive complexity 32 (threshold 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.
extractPages (cognitive 32) src/display/api.js:2969— extractPages has cognitive complexity 32 (threshold 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.
nodeToSerializable (cognitive 32) src/core/struct_tree.js:1030— nodeToSerializable has cognitive complexity 32 (threshold 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.
getNumber (cognitive 32) src/core/parser.js:995— getNumber has cognitive complexity 32 (threshold 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.
getObj (cognitive 32) src/core/parser.js:1278— getObj has cognitive complexity 32 (threshold 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.
compileFontInfo (cognitive 32) src/core/obj_bin_transform_core.js:101— compileFontInfo has cognitive complexity 32 (threshold 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.
getAll (cognitive 32) src/core/name_number_tree.js:37— getAll has cognitive complexity 32 (threshold 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.
type1FontGlyphMapping (cognitive 32) src/core/fonts_utils.js:111— type1FontGlyphMapping has cognitive complexity 32 (threshold 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.
adjustMapping (cognitive 32) src/core/fonts.js:465— adjustMapping has cognitive complexity 32 (threshold 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.
constructor (cognitive 32) src/core/fonts.js:1061— constructor has cognitive complexity 32 (threshold 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.
_getPageNumberToDestHash (cognitive 31) web/pdf_outline_viewer.js:334— _getPageNumberToDestHash has cognitive complexity 31 (threshold 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.
moveCaret (cognitive 31) web/caret_browsing.js:261— moveCaret has cognitive complexity 31 (threshold 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.
readTrueTypeCollectionData (cognitive 31) src/core/fonts.js:1544— readTrueTypeCollectionData has cognitive complexity 31 (threshold 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.
#collectFieldObjects (cognitive 31) src/core/document.js:1851— #collectFieldObjects has cognitive complexity 31 (threshold 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.
initSandbox (cognitive 30) src/scripting_api/initialization.js:41— initSandbox has cognitive complexity 30 (threshold 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.
setupStorage (cognitive 30) src/display/xfa_layer.js:151— setupStorage has cognitive complexity 30 (threshold 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.
paintChar (cognitive 30) src/display/canvas.js:2497— paintChar has cognitive complexity 30 (threshold 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.
writeStream (cognitive 30) src/core/writer.js:54— writeStream has cognitive complexity 30 (threshold 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.
readBlock (cognitive 30) src/core/lzw_stream.js:62— readBlock has cognitive complexity 30 (threshold 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.
sanitizeGlyphLocations (cognitive 30) src/core/fonts.js:2166— sanitizeGlyphLocations has cognitive complexity 30 (threshold 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.
getPattern (cognitive 29) src/display/pattern_helper.js:175— getPattern has cognitive complexity 29 (threshold 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.
readXRefTable (cognitive 29) src/core/xref.js:230— readXRefTable has cognitive complexity 29 (threshold 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.
readXRef (cognitive 29) src/core/xref.js:732— readXRef has cognitive complexity 29 (threshold 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.
parse (cognitive 29) src/core/struct_tree.js:901— parse has cognitive complexity 29 (threshold 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.
getString (cognitive 29) src/core/parser.js:1071— getString has cognitive complexity 29 (threshold 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.
sanitizeGlyph (cognitive 29) src/core/fonts.js:1986— sanitizeGlyph has cognitive complexity 29 (threshold 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.
_charToGlyph (cognitive 29) src/core/fonts.js:3552— _charToGlyph has cognitive complexity 29 (threshold 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.
buildFormXObject (cognitive 29) src/core/evaluator.js:469— buildFormXObject has cognitive complexity 29 (threshold 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.
#setAttributes (cognitive 28) web/struct_tree_layer_builder.js:351— #setAttributes has cognitive complexity 28 (threshold 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.
#updateFromSandbox (cognitive 28) web/pdf_scripting_manager.js:297— #updateFromSandbox has cognitive complexity 28 (threshold 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.
reset (cognitive 28) web/pdf_page_view.js:634— reset has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity· show (cognitive 28) · ×1
show (cognitive 28) web/internal/draw_ops_view.js:221— show has cognitive complexity 28 (threshold 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.
endGroup (cognitive 28) src/display/canvas.js:3460— endGroup has cognitive complexity 28 (threshold 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.
onclick (cognitive 28) src/display/annotation_layer.js:1207— onclick has cognitive complexity 28 (threshold 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.
fetchCompressed (cognitive 27) src/core/xref.js:957— fetchCompressed has cognitive complexity 27 (threshold 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.
canUpdateStructTree (cognitive 27) src/core/struct_tree.js:211— canUpdateStructTree has cognitive complexity 27 (threshold 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.
#collectParents (cognitive 27) src/core/struct_tree.js:460— #collectParents has cognitive complexity 27 (threshold 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.
parse (cognitive 27) src/core/glyf.js:270— parse has cognitive complexity 27 (threshold 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.
handleColorN (cognitive 27) src/core/evaluator.js:1594— handleColorN has cognitive complexity 27 (threshold 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.
editorStats (cognitive 26) src/display/annotation_storage.js:218— editorStats has cognitive complexity 26 (threshold 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.
extractFontHeader (cognitive 26) src/core/type1_parser.js:1008— extractFontHeader has cognitive complexity 26 (threshold 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.
readBlockTiff (cognitive 26) src/core/predictor_stream.js:51— readBlockTiff has cognitive complexity 26 (threshold 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.
_renderMatches (cognitive 25) web/text_highlighter.js:156— _renderMatches has cognitive complexity 25 (threshold 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.
constructor (cognitive 25) web/pdf_page_view.js:183— constructor has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity· open (cognitive 25) · ×1
open (cognitive 25) web/comment_manager.js:719— open has cognitive complexity 25 (threshold 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 25) web/app.js:284— _parseHashParams has cognitive complexity 25 (threshold 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.
onWheel (cognitive 25) web/app.js:2992— onWheel has cognitive complexity 25 (threshold 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.
drawTriangle (cognitive 25) src/display/pattern_helper.js:270— drawTriangle has cognitive complexity 25 (threshold 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.
_createMaskCanvas (cognitive 25) src/display/canvas.js:938— _createMaskCanvas has cognitive complexity 25 (threshold 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.
parseMarkedContentProps (cognitive 25) src/core/evaluator_utils.js:83— parseMarkedContentProps has cognitive complexity 25 (threshold 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.
#replaceIdByRef (cognitive 25) src/core/document.js:327— #replaceIdByRef has cognitive complexity 25 (threshold 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.
checkLastPage (cognitive 25) src/core/document.js:1750— checkLastPage has cognitive complexity 25 (threshold 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.
#render (cognitive 24) web/internal/font_view.js:167— #render has cognitive complexity 24 (threshold 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.
_createContainer (cognitive 24) src/display/annotation_layer.js:400— _createContainer has cognitive complexity 24 (threshold 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.
getFontSubstitution (cognitive 24) src/core/font_substitutions.js:714— getFontSubstitution has cognitive complexity 24 (threshold 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.
documentInfo (cognitive 24) src/core/document.js:1535— documentInfo has cognitive complexity 24 (threshold 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.
updateTextLayer (cognitive 23) web/struct_tree_layer_builder.js:477— updateTextLayer has cognitive complexity 23 (threshold 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.
#setScaleUpdatePages (cognitive 23) web/pdf_viewer.js:1568— #setScaleUpdatePages has cognitive complexity 23 (threshold 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.
#setCaretPositionHelper (cognitive 23) web/caret_browsing.js:130— #setCaretPositionHelper has cognitive complexity 23 (threshold 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.
#processStreamMessage (cognitive 23) src/shared/message_handler.js:393— #processStreamMessage has cognitive complexity 23 (threshold 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.
getRaw (cognitive 23) src/core/name_number_tree.js:84— getRaw has cognitive complexity 23 (threshold 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.
_encodeBMP (cognitive 23) src/core/image_resizer.js:389— _encodeBMP has cognitive complexity 23 (threshold 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.
getComponents (cognitive 23) src/core/image.js:525— getComponents has cognitive complexity 23 (threshold 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.
encodeString (cognitive 23) src/core/fonts.js:3729— encodeString has cognitive complexity 23 (threshold 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.
formatArg (cognitive 22) web/internal/draw_ops_view.js:169— formatArg has cognitive complexity 22 (threshold 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.
toDateObject (cognitive 22) src/display/display_utils.js:294— toDateObject has cognitive complexity 22 (threshold 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.
commentButtonPosition (cognitive 22) src/display/annotation_layer.js:243— commentButtonPosition has cognitive complexity 22 (threshold 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.
_getElementsByName (cognitive 22) src/display/annotation_layer.js:802— _getElementsByName has cognitive complexity 22 (threshold 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.
getName (cognitive 22) src/core/parser.js:1171— getName has cognitive complexity 22 (threshold 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.
#onPagesEdited (cognitive 21) web/pdf_find_controller.js:1098— #onPagesEdited has cognitive complexity 21 (threshold 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.
runCalculate (cognitive 21) src/scripting_api/event.js:316— runCalculate has cognitive complexity 21 (threshold 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.
constructor (cognitive 21) src/scripting_api/doc.js:39— constructor has cognitive complexity 21 (threshold 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.
#writeKids (cognitive 21) src/core/struct_tree.js:344— #writeKids has cognitive complexity 21 (threshold 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.
merge (cognitive 21) src/core/primitives.js:236— merge has cognitive complexity 21 (threshold 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.
startXRef (cognitive 21) src/core/document.js:1073— startXRef has cognitive complexity 21 (threshold 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.
getVisibleElements (cognitive 20) web/ui_utils.js:437— getVisibleElements has cognitive complexity 20 (threshold 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.
#findClosestThumbnail (cognitive 20) web/pdf_thumbnail_viewer.js:1874— #findClosestThumbnail has cognitive complexity 20 (threshold 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.
cssTransform (cognitive 20) web/pdf_page_view.js:969— cssTransform has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity· run (cognitive 20) · ×1
run (cognitive 20) web/app.js:882— run has cognitive complexity 20 (threshold 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.
deleteItemAt (cognitive 20) src/scripting_api/field.js:363— deleteItemAt has cognitive complexity 20 (threshold 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.
_getField (cognitive 20) src/scripting_api/doc.js:926— _getField has cognitive complexity 20 (threshold 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.
resetForm (cognitive 20) src/scripting_api/doc.js:1230— resetForm has cognitive complexity 20 (threshold 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.
#AFSpecial_KeystrokeEx_helper (cognitive 20) src/scripting_api/aform.js:451— #AFSpecial_KeystrokeEx_helper has cognitive complexity 20 (threshold 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.
#appendText (cognitive 20) src/display/text_layer.js:322— #appendText has cognitive complexity 20 (threshold 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.
getPdfFilenameFromUrl (cognitive 20) src/display/display_utils.js:123— getPdfFilenameFromUrl has cognitive complexity 20 (threshold 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.
parse (cognitive 20) src/core/xref.js:119— parse has cognitive complexity 20 (threshold 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.
getFontFileType (cognitive 20) src/core/fonts.js:357— getFontFileType has cognitive complexity 20 (threshold 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.
createNameTable (cognitive 20) src/core/fonts.js:954— createNameTable has cognitive complexity 20 (threshold 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.
readPostScriptTable (cognitive 20) src/core/fonts.js:2331— readPostScriptTable has cognitive complexity 20 (threshold 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.
find (cognitive 20) src/core/document.js:952— find has cognitive complexity 20 (threshold 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.
#collectSignatureFields (cognitive 20) src/core/document.js:2001— #collectSignatureFields has cognitive complexity 20 (threshold 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.
switchView (cognitive 19) web/views_manager.js:229— switchView has cognitive complexity 19 (threshold 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.
constructor (cognitive 19) web/pdf_thumbnail_viewer.js:183— constructor has cognitive complexity 19 (threshold 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.
update (cognitive 19) web/pdf_page_view.js:770— update has cognitive complexity 19 (threshold 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.
cancelRendering (cognitive 19) web/pdf_page_view.js:918— cancelRendering has cognitive complexity 19 (threshold 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.
draw (cognitive 19) web/pdf_page_view.js:1060— draw has cognitive complexity 19 (threshold 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.
dispatch (cognitive 19) web/event_utils.js:176— dispatch has cognitive complexity 19 (threshold 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.
(anonymous) (cognitive 19) web/base_pdf_page_view.js:124— (anonymous) has cognitive complexity 19 (threshold 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.
#makeImageArgPreview (cognitive 19) web/internal/draw_ops_view.js:379— #makeImageArgPreview has cognitive complexity 19 (threshold 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.
#buildLine (cognitive 19) web/internal/draw_ops_view.js:639— #buildLine has cognitive complexity 19 (threshold 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.
#processItems (cognitive 19) src/display/text_layer.js:278— #processItems has cognitive complexity 19 (threshold 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.
createPatternCanvas (cognitive 19) src/display/pattern_helper.js:712— createPatternCanvas has cognitive complexity 19 (threshold 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.
putBinaryImageData (cognitive 19) src/display/canvas.js:318— putBinaryImageData has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity· fill (cognitive 19) · ×1
fill (cognitive 19) src/display/canvas.js:2189— fill has cognitive complexity 19 (threshold 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.
addNode (cognitive 19) src/core/struct_tree.js:951— addNode has cognitive complexity 19 (threshold 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.
makeInlineImage (cognitive 19) src/core/parser.js:537— makeInlineImage has cognitive complexity 19 (threshold 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.
readNameTable (cognitive 19) src/core/fonts.js:2397— readNameTable has cognitive complexity 19 (threshold 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.
convert (cognitive 19) src/core/fonts.js:3284— convert has cognitive complexity 19 (threshold 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.
parseCmap (cognitive 19) src/core/font_renderer.js:47— parseCmap has cognitive complexity 19 (threshold 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.
#computeThumbnailsPosition (cognitive 18) web/pdf_thumbnail_viewer.js:1313— #computeThumbnailsPosition has cognitive complexity 18 (threshold 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.
push (cognitive 18) web/pdf_history.js:193— push has cognitive complexity 18 (threshold 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.
toggle (cognitive 18) web/comment_manager.js:1093— toggle has cognitive complexity 18 (threshold 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.
#buildChildren (cognitive 18) web/internal/tree_view.js:237— #buildChildren has cognitive complexity 18 (threshold 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.
#renderValue (cognitive 18) web/internal/tree_view.js:640— #renderValue has cognitive complexity 18 (threshold 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.
_isValidExplicitDest (cognitive 18) src/shared/util.js:1081— _isValidExplicitDest has cognitive complexity 18 (threshold 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.
AFRange_Validate (cognitive 18) src/scripting_api/aform.js:289— AFRange_Validate has cognitive complexity 18 (threshold 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.
showType3Text (cognitive 18) src/display/canvas.js:2915— showType3Text has cognitive complexity 18 (threshold 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.
_abortOperatorList (cognitive 18) src/display/api.js:1990— _abortOperatorList has cognitive complexity 18 (threshold 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.
fetchUncompressed (cognitive 18) src/core/xref.js:900— fetchUncompressed has cognitive complexity 18 (threshold 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.
#getValue (cognitive 18) src/core/primitives.js:92— #getValue has cognitive complexity 18 (threshold 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.
constructor (cognitive 18) src/core/pattern.js:151— constructor has cognitive complexity 18 (threshold 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.
buildMeshVertexData (cognitive 18) src/core/pattern.js:402— buildMeshVertexData has cognitive complexity 18 (threshold 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.
findASCII85DecodeInlineStreamEnd (cognitive 18) src/core/parser.js:445— findASCII85DecodeInlineStreamEnd has cognitive complexity 18 (threshold 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.
makeFilter (cognitive 18) src/core/parser.js:846— makeFilter has cognitive complexity 18 (threshold 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.
foundImageMaskGroup (cognitive 18) src/core/operator_list.js:195— foundImageMaskGroup has cognitive complexity 18 (threshold 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.
_optimize (cognitive 18) src/core/operator_list.js:581— _optimize has cognitive complexity 18 (threshold 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.
#rescaleImageData (cognitive 18) src/core/image_resizer.js:304— #rescaleImageData has cognitive complexity 18 (threshold 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.
write (cognitive 18) src/core/glyf.js:635— write has cognitive complexity 18 (threshold 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.
setGState (cognitive 18) src/core/evaluator.js:1115— setGState has cognitive complexity 18 (threshold 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.
#loadXfaFonts (cognitive 18) src/core/document.js:1330— #loadXfaFonts has cognitive complexity 18 (threshold 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.
#parseSignatureDict (cognitive 18) src/core/document.js:2083— #parseSignatureDict has cognitive complexity 18 (threshold 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.
#touchSwipe (cognitive 17) web/pdf_presentation_mode.js:299— #touchSwipe has cognitive complexity 17 (threshold 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.
normalize (cognitive 17) web/pdf_find_controller.js:94— normalize has cognitive complexity 17 (threshold 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.
#nextMatch (cognitive 17) web/pdf_find_controller.js:942— #nextMatch has cognitive complexity 17 (threshold 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.
initialize (cognitive 17) web/app.js:202— initialize has cognitive complexity 17 (threshold 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.
(anonymous) (cognitive 17) web/app.js:1661— (anonymous) has cognitive complexity 17 (threshold 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.
#renderCanvas (cognitive 17) web/internal/page_view.js:678— #renderCanvas has cognitive complexity 17 (threshold 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.
update (cognitive 17) src/shared/murmurhash3.js:31— update has cognitive 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.
recordCharacterBBox (cognitive 17) src/display/canvas_dependency_tracker.js:628— recordCharacterBBox has cognitive complexity 17 (threshold 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.
#collectAttributes (cognitive 17) src/core/struct_tree.js:633— #collectAttributes has cognitive complexity 17 (threshold 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.
soundStreamToWav (cognitive 17) src/core/sound.js:87— soundStreamToWav has cognitive complexity 17 (threshold 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.
_transfers (cognitive 17) src/core/operator_list.js:765— _transfers has cognitive complexity 17 (threshold 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.
getRanges (cognitive 17) src/core/fonts.js:542— getRanges has cognitive complexity 17 (threshold 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.
_spaceWidth (cognitive 17) src/core/fonts.js:3511— _spaceWidth has cognitive complexity 17 (threshold 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.
generateHuffmanTable (cognitive 17) src/core/flate_stream.js:240— generateHuffmanTable has cognitive complexity 17 (threshold 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.
getAnnotationsData (cognitive 17) src/core/document.js:738— getAnnotationsData has cognitive complexity 17 (threshold 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.
#isValidState (cognitive 16) web/pdf_history.js:463— #isValidState has cognitive complexity 16 (threshold 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.
#parsePageSize (cognitive 16) web/pdf_document_properties.js:263— #parsePageSize has cognitive complexity 16 (threshold 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.
editAltText (cognitive 16) web/new_alt_text_manager.js:372— editAltText has cognitive complexity 16 (threshold 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.
_initializeMetadata (cognitive 16) web/app.js:1896— _initializeMetadata has cognitive complexity 16 (threshold 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.
#setPosition (cognitive 16) web/alt_text_manager.js:188— #setPosition has cognitive complexity 16 (threshold 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.
createValidAbsoluteUrl (cognitive 16) src/shared/util.js:450— createValidAbsoluteUrl has cognitive complexity 16 (threshold 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.
AFNumber_Format (cognitive 16) src/scripting_api/aform.js:106— AFNumber_Format has cognitive complexity 16 (threshold 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.
bind (cognitive 16) src/display/font_loader.js:155— bind has cognitive complexity 16 (threshold 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.
_prepareSMaskCanvas (cognitive 16) src/display/canvas.js:1246— _prepareSMaskCanvas has cognitive complexity 16 (threshold 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.
_bakeSMaskCanvas (cognitive 16) src/display/canvas.js:1373— _bakeSMaskCanvas has cognitive complexity 16 (threshold 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.
complete (cognitive 16) src/display/api.js:1561— complete has cognitive complexity 16 (threshold 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.
(anonymous) (cognitive 16) src/display/annotation_layer.js:1596— (anonymous) has cognitive complexity 16 (threshold 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.
_parseContent (cognitive 16) src/core/xml_parser.js:80— _parseContent has cognitive complexity 16 (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.
mathML (cognitive 16) src/core/struct_tree.js:599— mathML has cognitive complexity 16 (threshold 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.
parseKid (cognitive 16) src/core/struct_tree.js:787— parseKid has cognitive complexity 16 (threshold 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.
_decodeType6Shading (cognitive 16) src/core/pattern.js:889— _decodeType6Shading has cognitive complexity 16 (threshold 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.
_decodeType7Shading (cognitive 16) src/core/pattern.js:1021— _decodeType7Shading has cognitive complexity 16 (threshold 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.
_buildFigureFromPatch (cognitive 16) src/core/pattern.js:1091— _buildFigureFromPatch has cognitive complexity 16 (threshold 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.
adjustTrueTypeToUnicode (cognitive 16) src/core/fonts.js:142— adjustTrueTypeToUnicode has cognitive complexity 16 (threshold 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.
generateFont (cognitive 16) src/core/font_substitutions.js:634— generateFont has cognitive complexity 16 (threshold 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.
#removeType3ColorOperators (cognitive 16) src/core/evaluator.js:4965— #removeType3ColorOperators has cognitive complexity 16 (threshold 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.
getContentStream (cognitive 16) src/core/document.js:279— getContentStream has cognitive complexity 16 (threshold 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.
#getLinearizationPage (cognitive 16) src/core/document.js:1650— #getLinearizationPage has cognitive complexity 16 (threshold 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.
Duplicated block (21 lines × 2 locations) src/core/evaluator.js:2058— src/core/evaluator.js:2058 · src/core/evaluator.js:2097 — 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 (19 lines × 2 locations) src/core/xfa/template.js:678— src/core/xfa/template.js:678 · src/core/xfa/template.js:5346 — 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 (18 lines × 2 locations) src/core/xfa/config.js:316— src/core/xfa/config.js:316 · src/core/xfa/config.js:757 — 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 (16 lines × 4 locations) src/core/xfa/config.js:147— src/core/xfa/config.js:147 · src/core/xfa/locale_set.js:52 · src/core/xfa/locale_set.js:164 · src/core/xfa/locale_set.js:203 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (15 lines × 16 locations) src/core/core_utils.js:67— src/core/core_utils.js:67 · src/core/xfa/config.js:60 · src/core/xfa/config.js:92 · src/core/xfa/config.js:210 · +12 more site(s) not listed — the 4 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (14 lines × 3 locations) src/core/xfa/template.js:525— src/core/xfa/template.js:525 · src/core/xfa/template.js:3684 · src/core/xfa/template.js:4631 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Complex function onKeyDown (cyclomatic 120, cognitive 142) web/app.js:3145— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function checkAndRepair (cyclomatic 112, cognitive 163) src/core/fonts.js:1423— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function promiseBody (cyclomatic 110, cognitive 191) src/core/evaluator.js:1730— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function bidi (cyclomatic 95, cognitive 148) src/core/bidi.js:120— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function decompress (cyclomatic 84, cognitive 228) external/brotli/decode.js:1214— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function (computed) (cyclomatic 74, cognitive 115) src/core/xfa/template.js:2741— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function extractCidKeyedFontProgram (cyclomatic 74, cognitive 68) src/core/type1_parser.js:749— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function _makeBinary (cyclomatic 71, cognitive 110) src/core/postscript/ast.js:988— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function parseDestDictionary (cyclomatic 68, cognitive 121) src/core/catalog.js:1823— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function parse (cyclomatic 68, cognitive 98) src/core/jpg.js:885— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function parse (cyclomatic 65, cognitive 119) src/core/font_renderer.js:382— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function _initializeViewerComponents (cyclomatic 63, cognitive 75) web/app.js:414— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function translateFont (cyclomatic 61, cognitive 92) src/core/evaluator.js:4451— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function #execOp (cyclomatic 61, cognitive 38) src/core/postscript/js_evaluator.js:535— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function sanitizeTTProgram (cyclomatic 60, cognitive 125) src/core/fonts.js:2468— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function createImageData (cyclomatic 59, cognitive 93) src/core/image.js:715— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function #cloneStructTreeNode (cyclomatic 58, cognitive 121) src/core/editor/pdf_editor.js:556— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function parse (cyclomatic 57, cognitive 94) src/core/xfa/formcalc_parser.js:277— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function execute (cyclomatic 57, cognitive 44) src/core/postscript/js_evaluator.js:326— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
Complex function readCmapTable (cyclomatic 56, cognitive 101) src/core/fonts.js:1607— Branch-heavy code is where defects cluster — extract decisions into smaller functions.
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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 48 significant file(s) lose their only recent owner: src/core/xfa/xfa_object.js, src/core/xfa/bind.js, src/scripting_api/field.js, src/core/chunked_stream.js, external/cmapscompress/compress.mjs, src/core/fonts_utils.js, web/pdf_document_properties.js, src/core/primitives.js (+40 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 15 significant file(s) lose their only recent owner: web/internal/page_view.js, web/internal/multiline_view.js, src/core/flate_stream.js, src/display/touch_manager.js, src/core/unicode.js, src/display/editor/toolbar.js, src/display/webgpu.js, src/display/editor/ink.js (+7 more). Pair on, review, or document these before any departure.
D11 · Test Reliability· Test reliability not included · ×1
Test reliability not included — Test source is present (.ts, .mjs, .js) but the built-in reliability runner does not support this repository's ecosystem, so flakiness couldn't be assessed. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
Rotate the exposed credentials — git history can't be un-committed — Some of these secrets are in git HISTORY: deleting the file does not remove them (the commit persists on every clone, fork and backup). The remediation is to ROTATE each historically-exposed credential and treat it as compromised — not to delete the file. Rewriting history is disruptive and unreliable across existing forks. (Working-tree-only secrets — no commit — can instead be removed from the file and moved to a secret store.)
D29 · Static Analysis (SAST)· Static Analysis (SAST) not included (time budget) · ×1
Static Analysis (SAST) not included (time budget) — Static Analysis (SAST) couldn't be assessed within its 5-minute budget on a solution this large — not included in this run.
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 2 of 255 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 100 lines or more, excluding tests, vendored, generated and example/demo trees, largest first). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — largest first: extensions/chromium/preserve-referer.js, extensions/chromium/extension-router.js. 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 build provenance — No SLSA provenance generation or build attestation found in CI — nothing binds a released artifact to the build that produced it, so a consumer cannot tell your artifact from a substituted one. On GitHub Actions, `actions/attest-build-provenance` (or slsa-github-generator) emits one from the job's own OIDC identity; elsewhere, run `cosign attest` over the released artifact from the release pipeline and publish the attestation beside it.
No artifact signing — No artifact signing found in CI — sign your released artifacts with whatever your ecosystem ships (a GPG/minisign detached signature — or `cosign sign-blob` — over the release archives, or over a checksum file published alongside them, `npm publish --provenance` under GitHub OIDC for npm packages) so consumers can verify what you built.
D36 · Supply-chain Provenance & Signing· No SBOM · ×1
No SBOM — No SBOM generation or committed SBOM found — produce one with what your ecosystem ships (`npm sbom --sbom-format cyclonedx` (npm 9+) or `@cyclonedx/cyclonedx-npm` over the lockfile, `syft` (or `anchore/sbom-action` in CI) over the source tree or released image). Publish it as a release asset (`*.spdx.json` / `*.cdx.json`) so consumers can see what they are installing.
Coverage not included — suite not readable by the collector — Coverage NOT READ here — but this repository measures it: a coverage step in CI (`codecov/codecov-action`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.ts, .mjs, .js), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) into the repo working tree before the scan — a CI step is the usual place, since the artefact is commonly gitignored.
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.
…and 397 more — 397 further occurrence(s) are not listed individually; the score already reflects all 437.
Info — 2 finding(s)
D12 · Dependency Hygiene· Dependency hygiene not measured · ×1
Dependency hygiene not measured — dependency manifest found but not parsed for hygiene — This repository's dependency manifest (package.json) was found, but this pass cannot parse it for hygiene, so no package was assessed. Zero packages read is NOT a clean dependency tree, so this is NOT SCORED — a gap in the analyzer, not a verdict about this repository. This row is about dependency HYGIENE — outdated, deprecated or unmaintained direct dependencies; known CVEs in the same dependency graph are a separate question, reported under D38 wherever the manifest is OSV-readable. Your package.json IS read in this same run: the frontend dependency lens (R8) parses it for unused declarations, undeclared imports and misplaced production dependencies — what is missing here is the outdated/deprecated/unmaintained signal for those npm packages, not the manifest.
D22 · Internal API Consistency· No exposed public API · ×1
No exposed public API — No intentionally-exposed types (IsPackable or .Contracts) to evaluate.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Terraform, Kubernetes/Helm, CloudFormation); nothing to scan.
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.
0
—
Run 01a00aa2-1ffd-716f-97d0-e160c9bf1e7c · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 28 · Warnings: 654 · Recommendations: 12 · Info: 2 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 16-08-2026 @ 12:53 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.