Repository Analysis

mozilla/pdf.js

PDF Reader in JavaScript

0.5 Likely human-written View on GitHub
0.5
Adjusted Score
0.5
Raw Score
100%
Time Factor
2026-05-29
Last Push
53,382
Stars
JavaScript
Language
253,053
Lines of Code
531
Files
96
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 1HIGH 1MEDIUM 1LOW 93

Pattern Findings

96 matches across 8 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers43 hits · 43 pts
SeverityFileLineSnippet
LOWtest/coverage_utils.js43async function fetchAndMergeWorkerCoverage(pdfWorker) {
LOWtest/unit/pattern_spec.js27 function createFunctionBasedShading({
LOWtest/unit/crypto_spec.js567 function ensureAESEncryptedStringHasCorrectLength(
LOWtest/unit/crypto_spec.js591 function ensureEncryptDecryptIsIdentity(dict, fileId, password, string) {
LOWtest/unit/common_pdfstream_tests.js66function getCrossOriginUrlWithRedirects(testserverUrl, redirectIfRange) {
LOWtest/unit/jasmine-boot.js135function installWorkerCoverageHook() {
LOWtest/unit/jasmine-boot.js175async function flushPendingWorkerCoverage() {
LOWweb/ui_utils.js328function backtrackBeforeAllVisibleElements(index, views, top) {
LOWweb/ui_utils.js459 function isElementBottomAfterViewTop(view) {
LOWweb/ui_utils.js465 function isElementNextAfterViewHorizontally(view) {
LOWweb/ui_utils.js590function normalizeWheelEventDirection(evt) {
LOWweb/ui_utils.js750function getActiveOrFocusedElement() {
LOWweb/ui_utils.js769function apiPageLayoutToViewerModes(layout) {
LOWweb/chromecom.js153function isAllowedFileSchemeAccess(callback) {
LOWweb/chromecom.js168function reloadIfRuntimeIsUnavailable() {
LOWweb/pdf_viewer.js82function isValidAnnotationEditorMode(mode) {
LOWweb/app.js2257 function addWindowResolutionChange(evt = null) {
LOWextensions/chromium/pdfHandler.js222async function isHeaderConditionSupported() {
LOWexternal/openjpeg/openjpeg.js2async function OpenJPEG(moduleArg={}){var moduleRtn;var Module=moduleArg;var ENVIRONMENT_IS_WEB=true;var ENVIRONMENT_IS_
LOWexternal/brotli/decode.js67 function calculateDistanceAlphabetSize(npostfix, ndirect, maxndistbits) {
LOWexternal/brotli/decode.js77 function calculateDistanceAlphabetLimit(s, maxDistance, npostfix, ndirect) {
LOWexternal/brotli/decode.js371 function inverseMoveToFrontTransform(v, vLen) {
LOWexternal/brotli/decode.js736 function decodeDistanceBlockSwitch(s) {
LOWexternal/brotli/decode.js744 function maybeReallocateRingBuffer(s) {
LOWexternal/brotli/decode.js882 function readMetablockHuffmanCodesAndContextMaps(s) {
LOWexternal/brotli/decode.js1047 function huffmanTreeGroupAllocSize(alphabetSizeLimit, n) {
LOWexternal/brotli/decode.js1133 function initializeCompoundDictionary(s) {
LOWexternal/brotli/decode.js1157 function initializeCompoundDictionaryCopy(s, address, length) {
LOWexternal/brotli/decode.js1182 function copyFromCompoundDictionary(s, fence) {
LOWexternal/jbig2/jbig2.js2async function JBig2(moduleArg={}){var moduleRtn;var Module=moduleArg;var ENVIRONMENT_IS_WEB=true;var ENVIRONMENT_IS_WOR
LOWsrc/core/fonts.js384function applyStandardFontGlyphMap(map, glyphMap) {
LOWsrc/core/fonts.js1448 function readTrueTypeCollectionHeader(ttc) {
LOWsrc/core/fonts.js1481 function readTrueTypeCollectionData(ttc, fontName) {
LOWsrc/core/glyf.js701function pruneCompositeGlyphCycles(glyfTable, locaEntries, numGlyphs) {
LOWsrc/core/crypto.js797 function cipherTransformDecryptStream(data, finalize) {
LOWsrc/core/xfa/data.js25class DataHandler {
LOWsrc/core/postscript/wasm_compiler.js1068function buildPostScriptWasmFunction(source, domain, range) {
LOWsrc/core/postscript/js_evaluator.js798function buildPostScriptJsFunction(
LOWsrc/shared/image_utils.js29function convertBlackAndWhiteToRGBA({
LOWsrc/display/content_disposition.js31function getFilenameFromContentDispositionHeader(contentDisposition) {
LOWsrc/display/display_utils.js427function getCurrentTransformInverse(ctx) {
LOWsrc/display/network_utils.js40function validateRangeRequestCapabilities({
LOWsrc/display/network_utils.js82function extractFilenameFromHeader(responseHeaders) {
Over-Commented Block37 hits · 37 pts
SeverityFileLineSnippet
LOWtest/unit/ui_utils_spec.js201
LOWtest/unit/ui_utils_spec.js221 // margins, borders, or padding.
LOWtest/unit/api_spec.js7121 // Copy A contributes (page 1 kept):
LOWweb/pdf_thumbnail_viewer.js1861
LOWweb/ui_utils.js321 * @param {Array} views - array of pages, into which `index` is an index
LOWweb/ui_utils.js341 if (index < 2) {
LOWweb/ui_utils.js361 //
LOWweb/ui_utils.js381 // Now we backtrack to the first page that still has its bottom below
LOWweb/chromecom.js261// 1. When disconnected, the background page knows that the frame has unload.
LOWweb/pdf_history.js561 // In practice, it seems that the event is arriving too late in order for
LOWweb/pdf_find_controller.js161
LOWextensions/chromium/telemetry.js21 // determine whether it is safe to drop support for old Chrome versions in
LOWextensions/chromium/contentscript.js141}
LOWextensions/chromium/contentscript.js181 // <object> and <embed> elements have a "display:inline" style by default.
LOWexamples/learning/helloworld.html21 //
LOWsrc/core/cff_parser.js861 privateDict.setByName("BlueFuzz", DEFAULT_BLUE_FUZZ);
LOWsrc/core/cff_parser.js1501 // when there is one in the main top dict and the sub top dicts.
LOWsrc/core/annotation.js641 // order of the quadpoints should be bottom left, bottom right, top right
LOWsrc/core/annotation.js2381
LOWsrc/core/annotation.js2441 // /NeedAppearances trick to let the different software correctly render
LOWsrc/core/fonts.js3081 }
LOWsrc/core/evaluator.js1341 }
LOWsrc/core/evaluator.js2461 // A white <= fontSize * TRACKING_SPACE_FACTOR is a tracking space
LOWsrc/core/evaluator.js5341 //
LOWsrc/core/type1_font.js121 warn('Unable to recover "Length1" property in Type1 font -- using as is.');
LOWsrc/core/xfa/formcalc_parser.js241// operation ('... * - ...' can't be a subtraction).
LOWsrc/core/postscript/ast.js1281 }
LOWsrc/display/content_disposition.js181
LOWsrc/display/pages_mapper.js321 // For example if the final pdf contains page 3 twice and they are moved at
LOWsrc/display/canvas_dependency_tracker.js1201 // We instead need to find the transform that maps the original
LOWsrc/display/canvas.js621 this.smaskPreparedEntry = null;
LOWsrc/display/canvas.js1601 ctx.restore();
LOWsrc/display/canvas.js3541 height
LOWsrc/display/pattern_helper.js721
LOWsrc/display/editor/drawers/inkdraw.js21 // The last 3 points of the line.
LOWsrc/display/editor/drawers/freedraw.js21
LOWsrc/display/editor/drawers/signaturedraw.js661 outlines,
Fake / Example Data9 hits · 11 pts
SeverityFileLineSnippet
LOWtest/unit/scripting_spec.js2002 value = await myeval(`eMailValidate("foo@bar.com")`);
LOWtest/unit/annotation_spec.js1974 "(Lorem ipsum dolor sit amet, consectetur adipiscing elit.) Tj\n" +
LOWtest/unit/annotation_spec.js1974 "(Lorem ipsum dolor sit amet, consectetur adipiscing elit.) Tj\n" +
LOWtest/unit/annotation_spec.js2003 "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r" +
LOWtest/unit/annotation_spec.js2003 "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\r" +
LOWtest/unit/bidi_spec.js96 const str = "Lorem ipsum dolor sit amet, consectetur adipisicing elit.";
LOWtest/unit/bidi_spec.js96 const str = "Lorem ipsum dolor sit amet, consectetur adipisicing elit.";
LOWtest/unit/bidi_spec.js100 "Lorem ipsum dolor sit amet, consectetur adipisicing elit."
LOWtest/unit/bidi_spec.js100 "Lorem ipsum dolor sit amet, consectetur adipisicing elit."
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippet
CRITICALdocs/contents/js/jquery-3.7.1.min.js2!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):f
Cross-Language Confusion (JS/TS)1 hit · 5 pts
SeverityFileLineSnippet
HIGHsrc/scripting_api/doc.js1147 print(
AI Slop Vocabulary1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMsrc/core/annotation.js4609 // In order to simplify things, we utilize straight lines for now.
Verbosity Indicators2 hits · 3 pts
SeverityFileLineSnippet
LOWsrc/display/editor/tools.js850 // like zooming, hence we need to check if the container has the
LOWsrc/display/editor/tools.js863 // like zooming, hence we need to check if the container has the
Slop Phrases2 hits · 2 pts
SeverityFileLineSnippet
LOWweb/toggle_button.css54 in such a case don't forget to change the revision in the above link).
LOWsrc/core/parser.js602 // Finally, don't forget to reset the stream position.