Repository Analysis

electron/electron

:electron: Build cross-platform desktop apps with JavaScript, HTML, and CSS

2.0 Likely human-written View on GitHub
2.0
Adjusted Score
2.0
Raw Score
100%
Time Factor
2026-05-30
Last Push
121,471
Stars
C++
Language
200,992
Lines of Code
1356
Files
347
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 4HIGH 1MEDIUM 4LOW 338

Pattern Findings

347 matches across 11 categories. Click a row to expand file-level details.

Over-Commented Block249 hits · 249 pts
SeverityFileLineSnippet
LOWshell/renderer/service_worker_data.h1// Copyright (c) 2025 Salesforce, Inc.
LOWshell/renderer/renderer_client_base.h1// Copyright (c) 2017 GitHub, Inc.
LOWshell/renderer/electron_api_service_impl.h1// Copyright (c) 2019 Slack Technologies, Inc.
LOWshell/renderer/electron_autofill_agent.h1// Copyright (c) 2017 GitHub, Inc.
LOWshell/renderer/electron_smooth_round_rect.h1// Copyright (c) 2024 Salesforce, Inc.
LOWshell/renderer/api/electron_api_spell_check_client.h1// Copyright (c) 2014 GitHub, Inc.
LOWshell/renderer/api/electron_api_spell_check_client.h81 // (e.g. "word:word").
LOWshell/app/electron_crash_reporter_client.h1// Copyright 2013 The Chromium Authors. All rights reserved.
LOWshell/app/uv_stdio_fix.h1// Copyright (c) 2022 Slack Technologies, Inc.
LOWshell/app/electron_library_main.mm1// Copyright (c) 2013 GitHub, Inc.
LOWshell/app/electron_main_delegate_mac.mm1// Copyright (c) 2014 GitHub, Inc.
LOWshell/browser/file_select_helper.h1// Copyright (c) 2021 Microsoft. All rights reserved.
LOWshell/browser/electron_browser_client.h1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/electron_browser_main_parts.h1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/electron_browser_main_parts_mac.mm1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/browser_observer.h1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/native_window_mac.h1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/electron_permission_manager.h1// Copyright (c) 2016 GitHub, Inc.
LOWshell/browser/web_contents_permission_helper.h1// Copyright (c) 2016 GitHub, Inc.
LOWshell/browser/feature_list_mac.mm1// Copyright (c) 2024 Salesforce, Inc.
LOWshell/browser/web_view_guest_delegate.h1// Copyright (c) 2015 GitHub, Inc.
LOWshell/browser/file_select_helper_mac.mm1// Copyright 2014 The Chromium Authors. All rights reserved.
LOWshell/browser/browser_process_impl.h1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
LOWshell/browser/web_contents_preferences.h1// Copyright (c) 2015 GitHub, Inc.
LOWshell/browser/electron_api_ipc_handler_impl.h1// Copyright (c) 2022 Slack Technologies, Inc.
LOWshell/browser/native_window.h1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/relauncher.h1// Copyright (c) 2016 GitHub, Inc.
LOWshell/browser/relauncher.h21// start a relauncher process, giving it the "writer" side of a pipe that it
LOWshell/browser/relauncher.h41
LOWshell/browser/relauncher.h61// process, and allows additional arguments to be supplied to the relauncher
LOWshell/browser/native_window_mac.mm1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/native_window_mac.mm21#include "content/public/browser/browser_accessibility_state.h"
LOWshell/browser/native_window_mac.mm41#include "skia/ext/skia_utils_mac.h"
LOWshell/browser/native_window_mac.mm121// hit-test-transparent except where one of its descendants covers the
LOWshell/browser/native_window_mac.mm581 //
LOWshell/browser/renderer_startup_data.h1// Copyright (c) 2026 Anthropic, PBC.
LOWshell/browser/native_window_views.h1// Copyright (c) 2014 GitHub, Inc.
LOWshell/browser/electron_child_process_host_flags.h1// Copyright (c) 2026 Microsoft GmbH. All rights reserved.
LOWshell/browser/browser.h1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/browser_mac.mm1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/browser_mac.mm21#include "electron/mas.h"
LOW…l/browser/electron_web_contents_utility_handler_impl.h1// Copyright (c) 2022 Slack Technologies, Inc.
LOWshell/browser/electron_browser_context.h1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/zoom_level_delegate.h1// Copyright 2014 The Chromium Authors. All rights reserved.
LOWshell/browser/electron_api_sw_ipc_handler_impl.h1// Copyright (c) 2025 Salesforce, Inc.
LOWshell/browser/web_contents_zoom_controller.h1// Copyright (c) 2017 GitHub, Inc.
LOWshell/browser/web_contents_zoom_controller.h21// Manages the zoom changes of WebContents.
LOWshell/browser/microtasks_runner.h1// Copyright (c) 2018 GitHub, Inc.
LOWshell/browser/auto_updater_mac.mm1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/native_window_observer.h1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/preload_code_cache.h1// Copyright (c) 2026 Anthropic, PBC.
LOWshell/browser/preload_code_cache.h21// Stale or corrupt blobs are not detected here. V8's CachedData validation
LOWshell/browser/certificate_manager_model.h1// Copyright (c) 2012 The Chromium Authors. All rights reserved.
LOWshell/browser/event_emitter_mixin.h1// Copyright (c) 2019 Slack Technologies, Inc.
LOWshell/browser/web_contents_zoom_observer.h1// Copyright (c) 2023 Microsoft, GmbH
LOWshell/browser/electron_autofill_driver.h1// Copyright (c) 2019 GitHub, Inc.
LOWshell/browser/ui/file_dialog.h1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/ui/file_dialog_mac.mm1// Copyright (c) 2013 GitHub, Inc.
LOWshell/browser/ui/tray_icon_cocoa.mm1// Copyright (c) 2014 GitHub, Inc.
LOWshell/browser/ui/message_box.h1// Copyright (c) 2013 GitHub, Inc.
189 more matches not shown…
Hallucination Indicators4 hits · 40 pts
SeverityFileLineSnippet
CRITICALspec/api-session-spec.ts89 expect(cookie).to.exist.and.to.have.property('value', value);
CRITICALspec/spellchecker-spec.ts111 expect(contextMenuParams.dictionarySuggestions).to.have.length.of.at.least(1);
CRITICALspec/spellchecker-spec.ts126 expect(contextMenuParams.dictionarySuggestions).to.have.length.of.at.least(1);
CRITICALspec/api-net-spec.ts1217 expect(httpVersion).to.be.a('string').and.to.have.lengthOf.at.least(1);
Hyper-Verbose Identifiers37 hits · 38 pts
SeverityFileLineSnippet
LOWspec/asar-spec.ts136async function expectToThrowErrorWithCode(_func: Function, _code: string) {
LOWspec/asar-spec.ts153 async function expectToThrowErrorWithCode (func, code) {
LOWspec/api-service-worker-main-spec.ts81 async function unregisterAllServiceWorkers() {
LOWspec/webview-spec.ts48async function loadWebViewAndWaitForEvent(
LOWspec/webview-spec.ts63async function loadWebViewAndWaitForMessage(w: WebContents, attributes: Record<string, string>): Promise<string> {
LOWspec/index.js76function isDescendantOfCurrentProcess(pid) {
LOWspec/index.js94async function killOrphanedElectronProcesses(suiteName) {
LOWspec/lib/xdg-helpers.ts20export function getXdgDataDirsWithFallback(xdgDataHome: string, xdgDataDirs = process.env.XDG_DATA_DIRS) {
LOWspec/lib/xdg-helpers.ts65function spawnProtocolLookupWithXdgMock(
LOWspec/lib/xdg-helpers.ts116export async function spawnProtocolNameWithXdgMock(
LOWspec/lib/xdg-helpers.ts128export function spawnProtocolInfoWithXdgMock(
LOWspec/lib/artifacts.ts25export async function createArtifactWithRandomId(makeFileName: (id: string) => string, data: Buffer): Promise<string> {
LOWspec/lib/warning-helpers.ts54export async function expectDeprecationMessages(func: () => any, ...expected: ExpectedWarningMessage[]) {
LOWspec/lib/msix-helpers.ts41export async function registerExecutableWithIdentity(executablePath: string): Promise<void> {
LOWspec/lib/msix-helpers.ts75export async function unregisterExecutableWithIdentity(): Promise<void> {
LOWspec/lib/spec-helpers.ts326export function isTestingBindingAvailable() {
LOWscript/spec-runner.js382async function runMainProcessElectronTests() {
LOWscript/run-clang-format.py106def run_clang_format_diff_wrapper(args, file_name):
LOWscript/release/release.ts393async function verifyDraftGitHubReleaseAssets(release: MinimalRelease) {
LOWscript/release/release.ts467async function validateFileHashesAgainstShaSumMapping(
LOWscript/release/release.ts482async function verifyShasumsForRemoteFiles(remoteFilesToHash: HashableFile[], filesAreNodeJSArtifacts = false) {
LOWscript/release/uploaders/upload.py194def get_electron_build_version():
LOWscript/lib/git.py255def munge_subject_to_filename(subject):
LOWscript/lib/util.py188def get_buildtools_executable(name):
LOWscript/lib/util.py208def get_chromium_buildtools_path_value():
LOWscript/lib/utils.js162function getChromiumVersionFromDEPS(depsContent) {
LOWlib/sandboxed_renderer/preload.ts28export function createPreloadProcessObject(): NodeJS.Process {
LOWlib/sandboxed_renderer/preload.ts98export function executeSandboxedPreloadScripts(
LOWlib/browser/parse-features-string.ts71export function parseCommaSeparatedKeyValue(source: string) {
LOWlib/browser/parse-features-string.ts83export function parseWebViewWebPreferences(preferences: string) {
LOWlib/browser/api/shared-texture.ts30function scheduleCheckManagedSharedTextures() {
LOWlib/browser/api/shared-texture.ts36function unscheduleCheckManagedSharedTextures() {
LOWlib/browser/api/shared-texture.ts43function checkManagedSharedTextures() {
LOWlib/browser/api/shared-texture.ts73function wrapperReleaseFromRenderer(id: string, frameTreeNodeId: number) {
LOWlib/browser/api/menu-item-roles.ts385export function shouldOverrideCheckStatus(role: RoleId) {
LOWlib/browser/api/menu-item-roles.ts394export function shouldRegisterAccelerator(role: RoleId) {
LOWlib/browser/api/dialog.ts325export function showCertificateTrustDialog(
Verbosity Indicators18 hits · 35 pts
SeverityFileLineSnippet
LOWspec/api-shared-texture-spec.ts69 // Step 1: Input source of shared texture handle.
LOWspec/api-shared-texture-spec.ts77 // Step 2: Import as SharedTextureImported
LOWspec/api-shared-texture-spec.ts80 // Step 3: Prepare for transfer to another process (win's renderer)
LOWspec/api-shared-texture-spec.ts86 // Step 4: Send the shared texture to the renderer process (goto preload.js)
LOWspec/api-shared-texture-spec.ts91 // Step 12: Release the shared texture resources at main process
LOWspec/api-shared-texture-spec.ts97 // Step 13: Release the imported shared texture
LOWspec/api-shared-texture-spec.ts99 // Step 14: Release the shared texture once GPU is done
LOWspec/api-shared-texture-spec.ts103 // Step 15: Slightly timeout and capture the node screenshot
LOWspec/api-shared-texture-spec.ts105 // Step 16: Compare the captured image with the target image
LOWspec/api-shared-texture-spec.ts113 // Step 17: Resize the target image to match the captured image size, in case dpr != 1
LOWspec/api-shared-texture-spec.ts116 // Step 18: nativeImage have error comparing pixel data when color space is different,
LOWspec/api-shared-texture-spec.ts127 // Step 22: Verify the result from renderer process
LOWspec/api-shared-texture-spec.ts190 // Step 1: Input source of shared texture handle.
LOWspec/api-shared-texture-spec.ts199 // Step 2: Import as SharedTextureImported
LOWspec/api-shared-texture-spec.ts230 // Step 3: Transfer to another process (win's renderer)
LOWspec/api-shared-texture-spec.ts236 // Step 4: Release the imported and wait for signal to release the source
LOWscript/spec-runner.js288 // Step 3: Rerun each failed test individually
LOWscript/spec-runner.js325 // Step 4: Summary
Excessive Try-Catch Wrapping17 hits · 20 pts
SeverityFileLineSnippet
LOWscript/apply_all_patches.py56 except Exception as e: # pylint: disable=broad-except
LOWscript/get-git-version.py31except Exception:
LOWscript/run-clang-format.py112 except Exception as e:
MEDIUMscript/run-clang-format.py106def run_clang_format_diff_wrapper(args, file_name):
LOWscript/patches-mtime-cache.py138 except Exception:
LOWscript/patches-mtime-cache.py145 except Exception:
LOWscript/patches-mtime-cache.py163 except Exception:
LOWscript/release/uploaders/upload-index-json.py45 except Exception as e:
LOWscript/release/uploaders/upload-node-checksums.py78 except Exception:
LOWscript/release/uploaders/upload.py211 except Exception:
LOWscript/release/uploaders/upload-symbols.py84 except Exception as e:
MEDIUMscript/release/uploaders/upload-symbols.py85 print(f"An error occurred while adding '{pdb}' to SymStore: {str(e)}")
LOWscript/lib/native_tests.py262 except Exception as exception:
MEDIUMscript/lib/native_tests.py264 print(f"An error occurred while running '{self.binary_path}':",
LOWscript/node/generate_node_headers.py25 except Exception as e:
LOWscript/zip_manifests/check-zip-manifest.py27 except Exception as e:
LOWscript/zip_manifests/check-zip-manifest.py34 except Exception as e:
Deep Nesting12 hits · 12 pts
SeverityFileLineSnippet
LOWscript/verify-mksnapshot.py18
LOWscript/zip-symbols.py16
LOWscript/run-clang-format.py36
LOWscript/run-clang-format.py52
LOWscript/run-clang-format.py161
LOWscript/run-clang-format.py200
LOWscript/patches-mtime-cache.py84
LOWscript/release/uploaders/upload.py48
LOWscript/release/uploaders/upload-symbols.py39
LOWscript/lib/git.py62
LOWscript/lib/git.py299
LOWscript/lib/util.py69
Synthetic Comment Markers1 hit · 5 pts
SeverityFileLineSnippet
HIGHCONTRIBUTING.md71If you use AI tools in any way to contribute to our project, please read our [AI Tool Policy](https://github.com/electro
Fake / Example Data5 hits · 5 pts
SeverityFileLineSnippet
LOWspec/api-app-spec.ts410 fs.writeFileSync(file, 'Lorem Ipsum');
LOWdocs/tutorial/recent-documents.md42fs.writeFile(fileName, 'Lorem Ipsum', () => {
LOWdocs/tutorial/tutorial-2-first-app.md100 "author": "Jane Doe",
LOWdocs/tutorial/tutorial-2-first-app.md160 "author": "Jane Doe",
LOWdocs/fiddles/features/recent-documents/main.js15fs.writeFile(fileName, 'Lorem Ipsum', () => {
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippet
MEDIUM.devcontainer/on-create-command.sh11# Create the persisted buildtools config folder
Redundant / Tautological Comments2 hits · 3 pts
SeverityFileLineSnippet
LOWscript/lib/git.py55 # Check if we're in the root folder already.
LOW.github/workflows/rerun-apply-patches.yml71 # Check if the workflow is currently in progress
Unused Imports1 hit · 1 pts
SeverityFileLineSnippet
LOWscript/run-clang-format.py11