PDF Reader in JavaScript
This report summarizes scanner evidence for mozilla/pdf.js, a JavaScript project with 54,067 GitHub stars. SynthScan examined 287,729 lines of code across 608 source files, recording 133 pattern matches distributed across 12 syntactic categories. The legacy adjusted pattern signal is 0.6 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 115 finding(s).
Are imports declared and package/API names verified? 12 finding(s).
Are wrappers, guards, and repeated structures necessary? 67 finding(s).
Which changes need focused human review? 133 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 133 distinct pattern matches across 12 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/coverage_utils.js | 43 | async function fetchAndMergeWorkerCoverage(worker) { | CODE |
| LOW | test/unit/pattern_spec.js | 27 | function createFunctionBasedShading({ | CODE |
| LOW | test/unit/function_spec.js | 48 | function createExponentialFunction(c0, c1) { | CODE |
| LOW | test/unit/crypto_spec.js | 610 | function ensureAESEncryptedStringHasCorrectLength( | CODE |
| LOW | test/unit/crypto_spec.js | 634 | function ensureEncryptDecryptIsIdentity(dict, fileId, password, string) { | CODE |
| LOW | test/unit/crypto_spec.js | 643 | function ensureCrossCipherIsIdentity( | CODE |
| LOW | test/unit/api_spec.js | 130 | function buildSharedImageResourcePdf() { | CODE |
| LOW | test/unit/api_spec.js | 150 | function buildGeneratedAppearancePdf(pageContents = null) { | CODE |
| LOW | test/unit/api_spec.js | 1132 | function getDocumentWithGatedRenderer(body, filename = basicApiFileName) { | CODE |
| LOW | test/unit/api_spec.js | 1204 | async function countDiffsWithReadyRenderer(context, filename) { | CODE |
| LOW | test/unit/api_spec.js | 6721 | async function checkImageSmoothingPixelRatio(disableWorkerRendering) { | CODE |
| LOW | test/unit/common_pdfstream_tests.js | 66 | function getCrossOriginUrlWithRedirects(testserverUrl, redirectIfRange) { | CODE |
| LOW | test/unit/jasmine-boot.js | 146 | function installWorkerCoverageHook(WorkerClass, targetName) { | CODE |
| LOW | test/unit/jasmine-boot.js | 179 | async function flushPendingWorkerCoverage() { | CODE |
| LOW | test/benchmarks/stream_utils.js | 68 | async function capturePNGPredictorInputs( | CODE |
| LOW | test/pdfs/sig_corpus/generate.py | 52 | def _resolve_mozilla_central_dir(cli_value): | CODE |
| LOW | web/ui_utils.js | 322 | function backtrackBeforeAllVisibleElements(index, views, top) { | CODE |
| LOW | web/ui_utils.js | 457 | function isElementBottomAfterViewTop(view) { | CODE |
| LOW | web/ui_utils.js | 463 | function isElementNextAfterViewHorizontally(view) { | CODE |
| LOW | web/ui_utils.js | 582 | function normalizeWheelEventDirection(evt) { | CODE |
| LOW | web/ui_utils.js | 741 | function getActiveOrFocusedElement() { | CODE |
| LOW | web/ui_utils.js | 760 | function apiPageLayoutToViewerModes(layout) { | CODE |
| LOW | web/chromecom.js | 151 | function isAllowedFileSchemeAccess(callback) { | CODE |
| LOW | web/chromecom.js | 166 | function reloadIfRuntimeIsUnavailable() { | CODE |
| LOW | web/pdf_viewer.js | 83 | function isValidAnnotationEditorMode(mode) { | CODE |
| LOW | web/app.js | 2536 | function addWindowResolutionChange(evt = null) { | CODE |
| LOW | extensions/chromium/pdfHandler.js | 222 | async function isHeaderConditionSupported() { | CODE |
| LOW | external/openjpeg/openjpeg.js | 2 | async function OpenJPEG(moduleArg={}){var Module=moduleArg;var ENVIRONMENT_IS_WEB=true;var ENVIRONMENT_IS_WORKER=false;v | CODE |
| LOW | external/brotli/decode.js | 67 | function calculateDistanceAlphabetSize(npostfix, ndirect, maxndistbits) { | CODE |
| LOW | external/brotli/decode.js | 77 | function calculateDistanceAlphabetLimit(s, maxDistance, npostfix, ndirect) { | CODE |
| LOW | external/brotli/decode.js | 371 | function inverseMoveToFrontTransform(v, vLen) { | CODE |
| LOW | external/brotli/decode.js | 736 | function decodeDistanceBlockSwitch(s) { | CODE |
| LOW | external/brotli/decode.js | 744 | function maybeReallocateRingBuffer(s) { | CODE |
| LOW | external/brotli/decode.js | 882 | function readMetablockHuffmanCodesAndContextMaps(s) { | CODE |
| LOW | external/brotli/decode.js | 1047 | function huffmanTreeGroupAllocSize(alphabetSizeLimit, n) { | CODE |
| LOW | external/brotli/decode.js | 1133 | function initializeCompoundDictionary(s) { | CODE |
| LOW | external/brotli/decode.js | 1157 | function initializeCompoundDictionaryCopy(s, address, length) { | CODE |
| LOW | external/brotli/decode.js | 1182 | function copyFromCompoundDictionary(s, fence) { | CODE |
| LOW | external/jbig2/jbig2.js | 2 | async function JBig2(moduleArg={}){var Module=moduleArg;var ENVIRONMENT_IS_WEB=true;var ENVIRONMENT_IS_WORKER=false;var | CODE |
| LOW | …nal/builder/fixtures_babel/instantiatewasm-expected.js | 33 | function aliasBeforeInitialization() { | CODE |
| LOW | external/builder/fixtures_babel/instantiatewasm.js | 56 | function aliasBeforeInitialization() { | CODE |
| LOW | src/core/pattern.js | 52 | function getColorConversionBatchSize(count, numComps) { | CODE |
| LOW | src/core/annotation.js | 710 | function writeLineToCurveToAppearance(data, buffer, maybeClose = false) { | CODE |
| LOW | src/core/fonts.js | 386 | function applyStandardFontGlyphMap(map, glyphMap) { | CODE |
| LOW | src/core/fonts.js | 1509 | function readTrueTypeCollectionHeader(ttc) { | CODE |
| LOW | src/core/fonts.js | 1542 | function readTrueTypeCollectionData(ttc, fontName) { | CODE |
| LOW | src/core/evaluator.js | 1748 | function closePendingMarkedContentOPS() { | CODE |
| LOW | src/core/evaluator.js | 3203 | function closePendingMarkedContentItems(level = 0) { | CODE |
| LOW | src/core/glyf.js | 695 | function pruneCompositeGlyphCycles(glyfTable, locaEntries, numGlyphs) { | CODE |
| LOW | src/core/crypto.js | 805 | function cipherTransformDecryptStream(data, finalize) { | CODE |
| LOW | src/core/xfa/data.js | 25 | class DataHandler { | CODE |
| LOW | src/core/postscript/wasm_compiler.js | 1074 | function buildPostScriptWasmFunction(source, domain, range) { | CODE |
| LOW | src/core/postscript/js_evaluator.js | 822 | function buildPostScriptJsFunction( | CODE |
| LOW | src/shared/image_utils.js | 29 | function convertBlackAndWhiteToRGBA({ | CODE |
| LOW | src/display/content_disposition.js | 30 | function getFilenameFromContentDispositionHeader(contentDisposition) { | CODE |
| LOW | src/display/display_utils.js | 98 | function getCurrentTransformInverse(ctx) { | CODE |
| LOW | src/display/network_utils.js | 51 | function validateRangeRequestCapabilities({ | CODE |
| LOW | src/display/network_utils.js | 94 | function extractFilenameFromHeader(responseHeaders) { | CODE |
| LOW | src/display/editor/drawers/highlight.js | 24 | function getHighlightSVGProperties(outline) { | CODE |
| LOW | src/display/editor/drawers/highlight.js | 45 | function getHighlightFocusSVGProperties(outline, rotation) { | CODE |
| 1 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/unit/ui_utils_spec.js | 201 | COMMENT | |
| LOW | test/unit/ui_utils_spec.js | 221 | // margins, borders, or padding. | COMMENT |
| LOW | test/unit/api_spec.js | 10901 | }); | COMMENT |
| LOW | test/unit/api_spec.js | 11081 | await newLoadingTask.destroy(); | COMMENT |
| LOW | web/ui_utils.js | 321 | */ | COMMENT |
| LOW | web/ui_utils.js | 341 | // **** = fully hidden | COMMENT |
| LOW | web/ui_utils.js | 361 | // case 3, and this assumption is correct. | COMMENT |
| LOW | web/chromecom.js | 261 | // to the background page. | COMMENT |
| LOW | web/pdf_history.js | 561 | // more than `POSITION_UPDATED_THRESHOLD` times. | COMMENT |
| LOW | web/pdf_find_controller.js | 161 | // The goal of this function is to normalize the string and | COMMENT |
| LOW | extensions/chromium/telemetry.js | 21 | // determine whether it is safe to drop support for old Chrome versions in | COMMENT |
| LOW | extensions/chromium/contentscript.js | 141 | } | COMMENT |
| LOW | extensions/chromium/contentscript.js | 181 | // <object> and <embed> elements have a "display:inline" style by default. | COMMENT |
| LOW | examples/learning/helloworld.html | 21 | // | COMMENT |
| LOW | .github/workflows/ref_tests_request.yml | 1 | name: Request reference tests | COMMENT |
| LOW | src/core/cff_parser.js | 961 | privateDict.setByName("BlueShift", DEFAULT_BLUE_SHIFT); | COMMENT |
| LOW | src/core/cff_parser.js | 1641 | COMMENT | |
| LOW | src/core/annotation.js | 661 | // lies outside the region specified by the rectangle. The rectangle | COMMENT |
| LOW | src/core/annotation.js | 2441 | rotation = this.rotation; | COMMENT |
| LOW | src/core/evaluator.js | 2481 | negativeSpaceMax: -Infinity, | COMMENT |
| LOW | src/core/evaluator.js | 2541 | COMMENT | |
| LOW | src/core/evaluator.js | 5421 | // - An empty array. This indicates that the caller is providing the | COMMENT |
| LOW | src/core/type1_font.js | 121 | warn('Unable to recover "Length1" property in Type1 font -- using as is.'); | COMMENT |
| LOW | src/core/parser.js | 921 | // While lexing, we build up many strings one char at a time. Using += for | COMMENT |
| LOW | src/core/xfa/formcalc_parser.js | 241 | // operation ('... * - ...' can't be a subtraction). | COMMENT |
| LOW | src/core/postscript/ast.js | 1361 | // When the condition is a numeric comparison between two expressions A and | COMMENT |
| LOW | src/core/editor/pdf_editor.js | 141 | // times. This is used to determine if we can preserve information that can't | COMMENT |
| LOW | src/display/content_disposition.js | 181 | // We are more strict and only recognize RFC 2047-encoding if the value | COMMENT |
| LOW | src/display/canvas_dependency_tracker.js | 1201 | sin < 1e-6 || | COMMENT |
| LOW | src/display/canvas_dependency_tracker.js | 1221 | // are helper variables used to compute the effective transform. | COMMENT |
| LOW | src/display/canvas.js | 561 | static #pathCaches = new WeakMap(); | COMMENT |
| LOW | src/display/canvas.js | 641 | this.smaskPreparedEntry = null; | COMMENT |
| LOW | src/display/canvas.js | 1381 | // Alpha, or Luminosity with no backdrop: OOB input is transparent, | COMMENT |
| LOW | src/display/canvas.js | 1661 | } | COMMENT |
| LOW | src/display/canvas.js | 3541 | // mode and/or a soft mask) can't use the direct path above, so it | COMMENT |
| LOW | src/display/canvas.js | 3561 | // case, left untouched to avoid changing its rendering (issue 13520). | COMMENT |
| LOW | src/display/canvas.js | 3741 | colorCtx.drawImage(groupCtx.canvas, 0, 0); | COMMENT |
| LOW | src/display/pattern_helper.js | 761 | // | COMMENT |
| LOW | src/display/dom_filter_factory.js | 421 | newBgRGB, | COMMENT |
| LOW | src/display/editor/draw.js | 641 | // We've to deal with two rotations: the rotation of the annotation and the | COMMENT |
| LOW | src/display/editor/drawers/inkdraw.js | 61 | COMMENT | |
| LOW | src/display/editor/drawers/freedraw.js | 21 | COMMENT | |
| LOW | src/display/editor/drawers/signaturedraw.js | 661 | height, | COMMENT |
| LOW | src/scripting_api/app.js | 61 | #runtimeHighlightColor = ["T"]; | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | test/pdfs/sig_corpus/generate.py | 98 | # --------------------------------------------------------------------- | COMMENT |
| MEDIUM | test/pdfs/sig_corpus/generate.py | 100 | # --------------------------------------------------------------------- | COMMENT |
| MEDIUM | test/pdfs/sig_corpus/generate.py | 290 | # --------------------------------------------------------------------- | COMMENT |
| MEDIUM | test/pdfs/sig_corpus/generate.py | 292 | # --------------------------------------------------------------------- | COMMENT |
| MEDIUM | test/pdfs/sig_corpus/generate.py | 462 | # --------------------------------------------------------------------- | STRING |
| MEDIUM | test/pdfs/sig_corpus/generate.py | 464 | # --------------------------------------------------------------------- | STRING |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/unit/scripting_spec.js | 3364 | value = await myeval(`eMailValidate("foo@bar.com")`); | CODE |
| LOW | test/unit/annotation_spec.js | 2184 | "(Lorem ipsum dolor sit amet, consectetur adipiscing elit.) Tj\n" + | CODE |
| LOW | test/unit/annotation_spec.js | 2184 | "(Lorem ipsum dolor sit amet, consectetur adipiscing elit.) Tj\n" + | CODE |
| LOW | test/unit/annotation_spec.js | 2213 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r" + | CODE |
| LOW | test/unit/annotation_spec.js | 2213 | "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r" + | CODE |
| LOW⚡ | test/unit/bidi_spec.js | 96 | const str = "Lorem ipsum dolor sit amet, consectetur adipisicing elit."; | CODE |
| LOW⚡ | test/unit/bidi_spec.js | 96 | const str = "Lorem ipsum dolor sit amet, consectetur adipisicing elit."; | CODE |
| LOW⚡ | test/unit/bidi_spec.js | 100 | "Lorem ipsum dolor sit amet, consectetur adipisicing elit." | CODE |
| LOW⚡ | test/unit/bidi_spec.js | 100 | "Lorem ipsum dolor sit amet, consectetur adipisicing elit." | CODE |
| LOW | web/pdf_thumbnail_viewer.js | 800 | placeholder.classList.add("thumbnailImageContainer", "placeholder"); | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | docs/contents/js/jquery-3.7.1.min.js | 2 | !function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):f | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/scripting_api/doc.js | 1207 | print( | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/core/xfa/html_utils.js | 151 | // TODO: implement this correctly ! | COMMENT |
| LOW | src/core/xfa/som.js | 63 | // TODO: implement that stuff and the remove the noExpr param. | COMMENT |
| LOW | src/core/xfa/template.js | 1640 | // TODO: implement all the missing properties. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | src/core/annotation.js | 4947 | // In order to simplify things, we utilize straight lines for now. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/display/editor/tools.js | 907 | // like zooming, hence we need to check if the container has the | COMMENT |
| LOW | src/display/editor/tools.js | 920 | // like zooming, hence we need to check if the container has the | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | web/toggle_button.css | 23 | in such a case don't forget to change the revision in the above link). | CODE |
| LOW | src/core/parser.js | 563 | // Finally, don't forget to reset the stream position. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | web/firefoxcom.js | 285 | // NOTE: This method is currently not invoked in the Firefox PDF Viewer. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | test/pdfs/sig_corpus/generate.py | 103 | CODE |