Repository Analysis

GoogleChrome/chrome-extensions-samples

Chrome Extensions Samples

1.1 Likely human-written View on GitHub
1.1
Adjusted Score
1.1
Raw Score
100%
Time Factor
2026-05-29
Last Push
17,573
Stars
JavaScript
Language
381,821
Lines of Code
2312
Files
284
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 9HIGH 4MEDIUM 21LOW 250

Pattern Findings

284 matches across 15 categories. Click a row to expand file-level details.

Over-Commented Block162 hits · 162 pts
SeverityFileLineSnippet
LOW…les/declarativeNetRequest/no-cookies/service-worker.js1// Copyright 2023 Google LLC
LOW…s/declarativeNetRequest/url-redirect/service_worker.js1// Copyright 2023 Google LLC
LOW…es/declarativeNetRequest/url-blocker/service_worker.js1// Copyright 2023 Google LLC
LOWapi-samples/scripting/index.js1// Copyright 2023 Google LLC
LOWapi-samples/scripting/content-script.js1// Copyright 2023 Google LLC
LOWapi-samples/scripting/sw.js1// Copyright 2023 Google LLC
LOWapi-samples/privacy/service-worker.js1// Copyright 2023 Google LLC
LOWapi-samples/browsingData/popup.js1// Copyright 2023 Google LLC
LOWapi-samples/browsingData/popup.css1/**
LOWapi-samples/readingList/index.js1// Copyright 2023 Google LLC
LOWapi-samples/readingList/sw.js1// Copyright 2023 Google LLC
LOWapi-samples/richNotification/popup.js1// Copyright 2023 Google LLC
LOWapi-samples/printing/background.js1// Copyright 2023 Google LLC
LOW…/fontSettings/fontSettings Advanced/pending_changes.js1/// Copyright 2023 Google LLC
LOW…-samples/fontSettings/fontSettings Advanced/options.js1/* eslint-disable no-unused-vars */
LOW…i-samples/fontSettings/fontSettings Advanced/slider.js1// Copyright 2023 Google LLC
LOWapi-samples/fontSettings/fontSettings Advanced/js/cr.js1/* eslint-disable no-undef */
LOW…samples/fontSettings/fontSettings Advanced/js/cr/ui.js1/* eslint-disable no-undef */
LOW…fontSettings/fontSettings Advanced/js/cr/ui/overlay.js1/* eslint-disable no-undef */
LOWapi-samples/fontSettings/fontSettings Basic/popup.js1// Ported from MV2 samples. Some coding practices are non-standard in MV3, but the sample remains a robust demonstration
LOWapi-samples/bookmarks/popup.js1// Copyright 2023 Google LLC
LOWapi-samples/devtools/inspectedWindow/panel.js1// Copyright 2023 Google LLC
LOWapi-samples/devtools/inspectedWindow/devtools.js1// Copyright 2023 Google LLC
LOWapi-samples/devtools/panels/devtools.js1// Copyright 2023 Google LLC
LOWapi-samples/sandbox/sandboxed-content/service-worker.js1// Copyright 2023 Google LLC
LOWapi-samples/sandbox/sandbox/mainpage.js1// Copyright 2023 Google LLC
LOWapi-samples/sandbox/sandbox/service-worker.js1// Copyright 2023 Google LLC
LOWapi-samples/history/showHistory/popup.js1// Copyright 2023 Google LLC
LOWapi-samples/contentSettings/popup.js1// Copyright 2023 Google LLC
LOWapi-samples/commands/popup.js1// Copyright 2025 Google LLC
LOWapi-samples/commands/background.js1// Copyright 2025 Google LLC
LOWapi-samples/windows/background.js1// Copyright 2023 Google LLC
LOWapi-samples/topSites/magic8ball/newTab.js1// Copyright 2023 Google LLC
LOWapi-samples/webRequest/http-auth/service-worker.js1// Copyright 2023 Google LLC
LOWapi-samples/contextMenus/basic/sample.js1// Copyright 2023 Google LLC
LOWapi-samples/userScripts/user-script.js1// Copyright 2023 Google LLC
LOWapi-samples/userScripts/options.js1// Copyright 2023 Google LLC
LOWapi-samples/userScripts/sw.js1// Copyright 2023 Google LLC
LOWapi-samples/webNavigation/basic/service-worker.js1// Copyright 2023 Google LLC
LOW…-samples/sample.bookmarks/third-party/jquery-1.12.4.js1201
LOW…mples/sample.bookmarks/third-party/jquery-ui-1.12.1.js8041 // Some browsers only repeat keydown events, not keypress events,
LOWfunctional-samples/cookbook.file_handlers/view-file.js1// Copyright 2023 Google LLC
LOWfunctional-samples/tutorial.focus-mode/background.js1// Copyright 2022 Google LLC
LOW…onal-samples/cookbook.sidepanel-open/service-worker.js1// Copyright 2023 Google LLC
LOW…tional-samples/sample.tabcapture-recorder/offscreen.js1// Copyright 2023 Google LLC
LOW…l-samples/sample.tabcapture-recorder/service-worker.js1// Copyright 2023 Google LLC
LOWfunctional-samples/tutorial.tabs-manager/popup.js1// Copyright 2022 Google LLC
LOWfunctional-samples/tutorial.broken-color/popup.js1// Copyright 2023 Google LLC
LOWfunctional-samples/tutorial.broken-color/options.js1// Copyright 2023 Google LLC
LOW…tional-samples/tutorial.broken-color/service-worker.js1// Copyright 2018 Google LLC
LOW…ional-samples/tutorial.reading-time/scripts/content.js1// Copyright 2022 Google LLC
LOW…-samples/cookbook.sidepanel-multiple/service-worker.js1// Copyright 2023 Google LLC
LOWfunctional-samples/cookbook.offscreen-dom/background.js1// Copyright 2023 Google LLC
LOWfunctional-samples/cookbook.offscreen-dom/offscreen.js1// Copyright 2023 Google LLC
LOW…ookbook.permissions-addhostaccessrequest/background.js1// Copyright 2024 Google LLC
LOWfunctional-samples/sample.milestones/popup.js1// Copyright 2022 Google LLC
LOW…al-samples/tutorial.focus-mode-debugging/background.js1// Copyright 2023 Google LLC
LOW…al-samples/tutorial.focus-mode-debugging/focus-mode.js1// Copyright 2023 Google LLC
LOW…ples/tutorial.focus-mode-debugging/fixed/background.js1// Copyright 2023 Google LLC
LOW…ples/tutorial.focus-mode-debugging/fixed/focus-mode.js1// Copyright 2023 Google LLC
102 more matches not shown…
Hallucination Indicators9 hits · 90 pts
SeverityFileLineSnippet
CRITICALapi-samples/printing/printers.js103 return printerInfo.capabilities.printer.media_size.option.find(
CRITICALapi-samples/printing/printers.js121 printer.info.capabilities.printer.vendor_capability.some(
CRITICALapi-samples/devtools/panels/devtools.js34 chrome.devtools.panels.elements.onSelectionChanged.addListener(
CRITICAL…-samples/sample.bookmarks/third-party/jquery-1.12.4.js8517jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
CRITICAL…xtensions/proxy_configuration/proxy_form_controller.js424 t.parentNode.parentNode.parentNode.classList.contains('active')
CRITICAL…chive/mv2/api/devtools/panels/chrome-query/devtools.js24 chrome.devtools.panels.elements.onSelectionChanged.addListener(
CRITICAL…es/managed-in-app-payments/scripts/jquery-2.0.3.min.js5};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.
CRITICAL…apps/samples/identity/sample_support/sample_support.js32 this.log_area.ownerDocument.defaultView.console.log(
CRITICAL…ve/apps/samples/window-options/js/jquery-1.10.1.min.js5}),n=s=l=u=r=o=null,t}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var
Hyper-Verbose Identifiers62 hits · 64 pts
SeverityFileLineSnippet
LOWapi-samples/scripting/index.js17async function isDynamicContentScriptRegistered() {
LOWapi-samples/privacy/service-worker.js25async function updateAutofillEnabledStatus(toggle = false) {
LOW…-samples/sample.bookmarks/third-party/jquery-1.12.4.js9115function addToPrefiltersOrTransports( structure ) {
LOW…-samples/sample.bookmarks/third-party/jquery-1.12.4.js9149function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
LOW…amples/ai.gemini-on-device-calendar-mate/background.js110function extractTextBetweenCurlyBraces(str) {
LOWfunctional-samples/cookbook.offscreen-dom/background.js24async function sendMessageToOffscreenDocument(type, data) {
LOWfunctional-samples/cookbook.offscreen-dom/background.js63async function handleAddExclamationMarkResult(dom) {
LOWfunctional-samples/cookbook.offscreen-dom/offscreen.js39function addExclamationMarksToHeadings(htmlString) {
LOWfunctional-samples/cookbook.push/background.js19async function subscribeUserVisibleOnlyFalse() {
LOWfunctional-samples/cookbook.push/background.js38function logSubscriptionDataToConsole(subscription) {
LOW_archive/mv2/extensions/speak_selection/tabs.js20function loadContentScriptInAllTabs() {
LOW…ve/mv2/extensions/irc/servlet/jstemplate/jstemplate.js914function jstLoadTemplateIfNotPresent(doc, name, loadHtmlFn, opt_target) {
LOW_archive/mv2/extensions/talking_alarm_clock/common.js142function speakPhraseWithTimeString(timeString) {
LOW_archive/mv2/extensions/talking_alarm_clock/common.js148function speakPhraseWithCurrentTime() {
LOW_archive/mv2/extensions/buildbot/popup.js98function createPatchsetStatusElement(patchset) {
LOW_archive/mv2/extensions/buildbot/popup.js121function getLastFullPatchsetWithTryJobs(issue) {
LOW_archive/mv2/extensions/plugin_settings/domui/js/cr.js35 function enablePlatformSpecificCSSRules() {
LOW_archive/mv2/api/tabs/inspector/jstemplate_compiled.js460function domCreateDocumentFragment(doc) {
LOW…ve/mv2/api/preferences/allowThirdPartyCookies/popup.js114function setUseSeparateIncognitoSettings(value) {
LOW_archive/mv2/api/preferences/enableReferrer/popup.js114function setUseSeparateIncognitoSettings(value) {
LOW_archive/mv2/api/displaySource/tabCast/background.js51function captureTabAndStartSession(sink_id) {
LOW…chive/mv2/api/downloads/download_manager/background.js36function drawUnknownProgressSpinner(ctx) {
LOW_archive/mv2/api/cookies/manager.js153function scheduleReloadCookieTable() {
LOW…rchive/apps/samples/webgl-pointer-lock/js/three.min.js15597 function materialNeedsSmoothNormals ( material ) {
LOW…rchive/apps/samples/webgl-pointer-lock/js/three.min.js15625 function bufferGuessVertexColorType ( material ) {
LOW…rchive/apps/samples/webgl-pointer-lock/js/three.min.js18752 function unrollImmediateBufferMaterial ( globject ) {
LOW…chive/apps/samples/dart/dart/clock.dart.precompiled.js6796 function getUnknownTagGenericBrowser(object, tag) {
LOW…chive/apps/samples/dart/dart/clock.dart.precompiled.js8300 function SecurityPolicyViolationEvent() {
LOW…chive/apps/samples/dart/dart/clock.dart.precompiled.js8912 function FEComponentTransferElement() {
LOW…chive/apps/samples/dart/dart/clock.dart.precompiled.js9146 function FESpecularLightingElement() {
LOW…chive/apps/samples/dart/dart/clock.dart.precompiled.js9746 function OfflineAudioCompletionEvent() {
LOW…chive/apps/samples/dart/dart/clock.dart.precompiled.js10635 function EfficientLengthMappedIterable(_iterable, _f) {
LOW…chive/apps/samples/dart/dart/clock.dart.precompiled.js11690 function ConcurrentModificationError(modifiedObject) {
LOW…chive/apps/samples/dart/dart/clock.dart.precompiled.js11709 function CyclicInitializationError(variableName) {
LOW…ive/apps/samples/webview-samples/user-agent/browser.js375 function findBoxObscuresActiveMatch(findBoxRect, matchRect) {
LOW…bview-samples/multi-tab-browser/find_box_controller.js114 function containerElementObscuresActiveMatch(findBoxRect, matchRect) {
LOW…bview-samples/multi-tab-browser/find_box_controller.js137 function setWebviewFindUpdateHandler() {
LOW…rchive/apps/samples/webview-samples/browser/browser.js267function findBoxObscuresActiveMatch(findBoxRect, matchRect) {
LOW_archive/apps/samples/diff/js/filesystem.js111function registerMenulistitemClicks() {
LOW_archive/apps/samples/diff/lib/diff_match_patch_test.js161 function assertLinesToCharsResultEquals(a, b) {
LOW_archive/apps/samples/diff/lib/diff_match_patch_test.js277function testDiffCleanupSemanticLossless() {
LOW_archive/apps/samples/diff/lib/diff_match_patch_test.js378function testDiffCleanupEfficiency() {
LOW_archive/apps/samples/gdrive/js/app.js71 function successCallbackWithFsCaching(resp, status, headers, config) {
LOW_archive/apps/samples/text-editor/editor.js75function replaceDocContentsFromString(string) {
LOW_archive/apps/samples/text-editor/editor.js79function replaceDocContentsFromFile(file) {
LOW_archive/apps/samples/text-editor/editor.js89function replaceDocContentsFromFileEntry() {
LOW…/apps/samples/text-editor/lib/ace/edit_session_test.js377 function computeAndAssert(line, assertEqual, wrapLimit, tabSize) {
LOW…e/apps/samples/text-editor/lib/ace/narcissus/parser.js70function pushDestructuringVarDecls(n, s) {
LOW_archive/apps/samples/window-state/window.js226function updateCurrentStateReadout() {
LOW_archive/apps/samples/weather/weather.js353function attemptAddCurrentLocation() {
LOW_archive/apps/samples/appsquare/main.js29 function fetchCheckinsWithLocation(opt_location) {
LOW_archive/apps/samples/window-options/window.js112function updateCurrentStateReadout() {
LOW_archive/apps/samples/image-edit/app.js222function getCropSquareHandlesInCanvasCoords() {
LOW_archive/apps/samples/clock/script.js356function getCurrentPosSuccessFunction(position) {
LOW_archive/apps/samples/clock/script.js375function getCurrentPosErrorFunction(error) {
LOW_archive/apps/samples/clock/tests/lib/prototype.js2443 function getContentFromAnonymousElement(tagName, html, force) {
LOW_archive/apps/samples/clock/tests/lib/prototype.js3251 function checkElementPrototypeDeficiency(tagName) {
LOW_archive/apps/samples/clock/tests/lib/prototype.js6413 function destroyRegistryForElement(element, uid) {
LOW_archive/apps/samples/clock/tests/lib/prototype.js6517 function stopObservingStandardEvent(element, eventName, responder) {
LOW_archive/apps/samples/clock/tests/lib/prototype.js6707 function isSimulatedMouseEnterLeaveEvent(eventName) {
2 more matches not shown…
AI Slop Vocabulary10 hits · 28 pts
SeverityFileLineSnippet
MEDIUM…/fontSettings/fontSettings Advanced/pending_changes.js14// Ported from MV2 samples. Some coding practices are non-standard in MV3, but the sample remains a robust demonstration
MEDIUM…-samples/fontSettings/fontSettings Advanced/options.js3// Ported from MV2 samples. Some coding practices are non-standard in MV3, but the sample remains a robust demonstration
MEDIUM…i-samples/fontSettings/fontSettings Advanced/slider.js14// Ported from MV2 samples. Some coding practices are non-standard in MV3, but the sample remains a robust demonstration
MEDIUMapi-samples/fontSettings/fontSettings Advanced/js/cr.js4// Ported from MV2 samples. Some coding practices are non-standard in MV3, but the sample remains a robust demonstration
MEDIUM…samples/fontSettings/fontSettings Advanced/js/cr/ui.js2// Ported from MV2 samples. Some coding practices are non-standard in MV3, but the sample remains a robust demonstration
MEDIUM…fontSettings/fontSettings Advanced/js/cr/ui/overlay.js2// Ported from MV2 samples. Some coding practices are non-standard in MV3, but the sample remains a robust demonstration
MEDIUMapi-samples/fontSettings/fontSettings Basic/popup.js1// Ported from MV2 samples. Some coding practices are non-standard in MV3, but the sample remains a robust demonstration
MEDIUM…-samples/sample.bookmarks/third-party/jquery-1.12.4.js10961// understands anonymous AMD modules. A named AMD is safest and most robust
MEDIUM…chive/apps/samples/mini-code-edit/cm/lib/codemirror.js33 '<pre class="CodeMirror-cursor">&#160;</pre>' + // Absolutely positioned blinky cursor
MEDIUM…chive/apps/samples/mini-code-edit/cm/lib/codemirror.js33 '<pre class="CodeMirror-cursor">&#160;</pre>' + // Absolutely positioned blinky cursor
Decorative Section Separators7 hits · 21 pts
SeverityFileLineSnippet
MEDIUM…samples/mini-code-edit/cm/mode/coffeescript/index.html40# --------------
MEDIUM…samples/mini-code-edit/cm/mode/coffeescript/index.html109# --------------------
MEDIUM…samples/mini-code-edit/cm/mode/coffeescript/index.html282# ---------------
MEDIUM…samples/mini-code-edit/cm/mode/coffeescript/index.html391# ------------------
MEDIUM…samples/mini-code-edit/cm/mode/coffeescript/index.html450# ----------------
MEDIUM…samples/mini-code-edit/cm/mode/coffeescript/index.html583# -----------------
MEDIUM…samples/mini-code-edit/cm/mode/coffeescript/index.html667# ---------------------
Fake / Example Data12 hits · 14 pts
SeverityFileLineSnippet
LOW…s/samples/webview-samples/local-resources/trusted.html8 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris quis
LOW…s/samples/webview-samples/local-resources/trusted.html8 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris quis
LOW…pps/samples/text-editor/lib/ace/token_iterator_test.js107 "Lorem ipsum dolor sit amet, consectetur adipisicing elit,",
LOW…pps/samples/text-editor/lib/ace/token_iterator_test.js107 "Lorem ipsum dolor sit amet, consectetur adipisicing elit,",
LOW…-editor/lib/ace/editor_highlight_selected_word_test.js52var lipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " +
LOW…-editor/lib/ace/editor_highlight_selected_word_test.js52var lipsum = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. " +
LOW…-editor/lib/ace/editor_highlight_selected_word_test.js62 "accumsan.Lorem ipsum dolor sit amet, consectetur adipiscing " +
LOW…-editor/lib/ace/editor_highlight_selected_word_test.js62 "accumsan.Lorem ipsum dolor sit amet, consectetur adipiscing " +
LOW…ive/apps/samples/mini-code-edit/cm/mode/rst/index.html405 Lorem ipsum [#f1]_ dolor sit amet ... [#f2]_
LOW…ive/apps/samples/mini-code-edit/cm/mode/rst/index.html405 Lorem ipsum [#f1]_ dolor sit amet ... [#f2]_
LOW…ive/apps/samples/mini-code-edit/cm/mode/rst/index.html423 Lorem ipsum [Ref]_ dolor sit amet.
LOW…ive/apps/samples/mini-code-edit/cm/mode/rst/index.html423 Lorem ipsum [Ref]_ dolor sit amet.
Cross-Language Confusion (JS/TS)2 hits · 10 pts
SeverityFileLineSnippet
HIGH…l-samples/cookbook.wasm-helloworld-print/background.js12 print();
HIGH…chive/apps/samples/dart/dart/clock.dart.precompiled.js6518 print(string);
Self-Referential Comments3 hits · 9 pts
SeverityFileLineSnippet
MEDIUM…samples/mini-code-edit/cm/mode/coffeescript/index.html92# Create a safe reference to the Underscore object for use below.
MEDIUM…samples/mini-code-edit/cm/mode/coffeescript/index.html393# Create a function bound to a given object (assigning `this`, and arguments,
MEDIUM…ve/apps/samples/mini-code-edit/cm/mode/ruby/index.html82# Create a string of the polynomial in sort-of-readable form.
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippet
HIGH…mples/sample.bookmarks/third-party/jquery-ui-1.12.1.js10941 // Format a name, short or long as requested
Unused Imports6 hits · 6 pts
SeverityFileLineSnippet
LOW…ps/samples/appengine-channelapi/appengine/chatactoe.py13
LOW…ps/samples/appengine-channelapi/appengine/chatactoe.py14
LOW…ps/samples/appengine-channelapi/appengine/chatactoe.py15
LOW…ps/samples/appengine-channelapi/appengine/chatactoe.py16
LOW…ps/samples/appengine-channelapi/appengine/chatactoe.py19
LOW…ps/samples/appengine-channelapi/appengine/chatactoe.py24
Overly Generic Function Names5 hits · 5 pts
SeverityFileLineSnippet
LOW_archive/apps/samples/web-store/js/zip/zip.js186 function getData(callback, onerror) {
LOW_archive/apps/samples/web-store/js/zip/zip.js295 function getData(callback, onerror) {
LOW_archive/apps/samples/web-store/js/zip/zip.js333 function getData(callback) {
LOW_archive/apps/samples/web-store/js/zip/zip.js366 function getData(callback) {
LOW_archive/apps/samples/web-store/js/zip/zip.js394 function getData(callback) {
Magic Placeholder Names1 hit · 5 pts
SeverityFileLineSnippet
HIGH_archive/apps/samples/gcm-notifications/register.js41 apiKey = "YOUR_API_KEY";
Verbosity Indicators2 hits · 3 pts
SeverityFileLineSnippet
LOW.repo/sample-list-generator/src/libs/api-detector.ts128 // So we need to check if the first two parts combined is a valid namespace.
LOW…mples/sample.bookmarks/third-party/jquery-ui-1.12.1.js14321 // IE sets focus asynchronously, so we need to check if focus
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippet
MEDIUM_archive/apps/samples/dojo/Markdown_1.0.1/Markdown.pl472 # Must come after _DoAnchors(), because you can use < and >
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippet
LOW…ve/apps/samples/mini-code-edit/cm/mode/ruby/index.html87 # Assign exponents to each term, making pairs of coeff and exponent,