Repository Analysis

rui314/mold

mold: A Modern Linker 🦠

2.9 Likely human-written View on GitHub
2.9
Adjusted Score
2.9
Raw Score
100%
Time Factor
2026-05-20
Last Push
16,537
Stars
C++
Language
498,781
Lines of Code
1990
Files
1412
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 8MEDIUM 60LOW 1344

Pattern Findings

1412 matches across 12 categories. Click a row to expand file-level details.

Over-Commented Block1282 hits · 1172 pts
SeverityFileLineSnippet
LOWCMakeLists.txt1# You can customize a build by specifying CMake options. An option may be
LOWCMakeLists.txt21# Specifies the build type. The default is `Release`, which is the right
LOWCMakeLists.txt321# Almost all functions are template in mold which take a target type
LOWdist.sh1#!/bin/bash
LOWdist.sh21# The mold executable created by this script is statically linked to
LOWdist.sh81 # Debian 9 (Stretch) released in June 2017.
LOWtest/lto-archive4.sh1#!/bin/bash
LOWlib/lib.h1#pragma once
LOWlib/lib.h21#include <sstream>
LOWlib/lib.h341}
LOWlib/gentoo-test.sh1#!/bin/bash
LOWlib/integers.h1// This file defines integral types for file input/output. We need to use
LOWlib/integers.h21// Note that in C/C++, memcpy is a portable and efficient way to access
LOWthird-party/blake3/Cargo.toml21# The Wasm SIMD implementation does not participate in dynamic feature detection,
LOWthird-party/blake3/Cargo.toml41rayon = ["dep:rayon-core"]
LOWthird-party/blake3/Cargo.toml61# The following features are mainly intended for testing and benchmarking, and
LOWthird-party/blake3/Cargo.toml81# BLAKE3_CI environment variable, which instructs build.rs to error out rather
LOWthird-party/blake3/b3sum/src/main.rs21
LOWthird-party/blake3/b3sum/src/main.rs61 ///
LOWthird-party/blake3/b3sum/src/main.rs281
LOWthird-party/blake3/reference_impl/reference_impl.rs1//! This is the reference implementation of BLAKE3. It is used for testing and
LOWthird-party/blake3/c/blake3.h1#ifndef BLAKE3_H
LOWthird-party/blake3/c/blake3.h21# define BLAKE3_API __attribute__((visibility("default")))
LOWthird-party/blake3/c/blake3_dispatch.c1#include <stdbool.h>
LOWthird-party/blake3/c/blake3_dispatch.c21#if !defined(BLAKE3_ATOMICS)
LOWthird-party/blake3/c/main.c1/*
LOWthird-party/blake3/c/blake3.c261// wouldn't be able to implement extendable output.) Note that this function is
LOWthird-party/blake3/c/blake3.c281 // With more than simd_degree chunks, we need to recurse. Start by dividing
LOWthird-party/blake3/c/blake3.c361 // The following loop never executes when MAX_SIMD_DEGREE_OR_2 is 2, because
LOWthird-party/blake3/c/blake3.c441// If the user gives us 64 KiB, we want to parallelize over all 64 KiB at once
LOWthird-party/blake3/c/blake3.c501 uint8_t chunk_cv[32];
LOWthird-party/blake3/c/blake3.c521 // Because we might need to break up the input to form powers of 2, or to
LOWthird-party/blake3/c/blake3_impl.h1#ifndef BLAKE3_IMPL_H
LOWthird-party/blake3/c/blake3_impl.h21 ROOT = 1 << 3,
LOWthird-party/blake3/c/blake3_impl.h41#if (defined(__x86_64__) || defined(_M_X64)) && !defined(_M_ARM64EC)
LOWthird-party/blake3/c/blake3_impl.h61#if !defined(BLAKE3_USE_NEON)
LOWthird-party/blake3/src/join.rs1//! The multi-threading abstractions used by `Hasher::update_with_join`.
LOWthird-party/blake3/src/test.rs701 assert_eq!(_result.to_string(), "invalid hex character: 'Z'");
LOWthird-party/blake3/src/io.rs21 }
LOWthird-party/blake3/src/io.rs41// some raw pointer reads from it. Those reads should be volatile if you don't want the compiler to
LOWthird-party/blake3/src/lib.rs1//! The official Rust implementation of the [BLAKE3] cryptographic hash
LOWthird-party/blake3/src/lib.rs21//! let mut output = [0; 1000];
LOWthird-party/blake3/src/lib.rs41//! will not be portable to other machines.
LOWthird-party/blake3/src/lib.rs61//! [`serde::Deserialize`](https://docs.rs/serde/latest/serde/trait.Deserialize.html)
LOWthird-party/blake3/src/lib.rs81//! [`Hasher::update_rayon`]: struct.Hasher.html#method.update_rayon
LOWthird-party/blake3/src/lib.rs101/// Undocumented and unstable, for benchmarks only.
LOWthird-party/blake3/src/lib.rs221/// `[u8; 32]`. However, byte arrays and slices don't provide constant-time
LOWthird-party/blake3/src/lib.rs621 flags.zeroize();
LOWthird-party/blake3/src/lib.rs761//
LOWthird-party/blake3/src/lib.rs901/// let hash = blake3::hash(b"foo");
LOWthird-party/blake3/src/lib.rs921/// replace an HMAC instance. In that use case, the constant-time equality
LOWthird-party/blake3/src/lib.rs941/// This function is always single-threaded. For multithreading support, see
LOWthird-party/blake3/src/lib.rs961///
LOWthird-party/blake3/src/lib.rs981/// # let key1 = key;
LOWthird-party/blake3/src/lib.rs1021 platform,
LOWthird-party/blake3/src/lib.rs1041/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
LOWthird-party/blake3/src/lib.rs1121
LOWthird-party/blake3/src/lib.rs1161 //
LOWthird-party/blake3/src/lib.rs1181 // compress_subtree_to_parent_node(). That function always returns the top
LOWthird-party/blake3/src/lib.rs1241 // the largest whole subtree we can, with the full benefits of SIMD and
1222 more matches not shown…
Decorative Section Separators31 hits · 98 pts
SeverityFileLineSnippet
MEDIUMthird-party/tbb/CMakeLists.txt77# ---------------------------------------------------------------------------------------------------------
MEDIUMthird-party/tbb/CMakeLists.txt99# ---------------------------------------------------------------------------------------------------------
MEDIUMthird-party/tbb/CMakeLists.txt104# ---------------------------------------------------------------------------------------------------------
MEDIUMthird-party/tbb/CMakeLists.txt163# -------------------------------------------------------------------
MEDIUMthird-party/tbb/CMakeLists.txt218# -------------------------------------------------------------------
MEDIUMthird-party/tbb/CMakeLists.txt220# -------------------------------------------------------------------
MEDIUMthird-party/tbb/CMakeLists.txt229# -------------------------------------------------------------------
MEDIUMthird-party/tbb/CMakeLists.txt290 # -------------------------------------------------------------------
MEDIUMthird-party/tbb/CMakeLists.txt320 # -------------------------------------------------------------------
MEDIUMthird-party/tbb/test/CMakeLists.txt645 # ----------------------------------------------------------------------------------------
MEDIUMthird-party/tbb/test/CMakeLists.txt680 # ------------------------------------------------------------------------------------------
MEDIUMthird-party/mimalloc/CMakeLists.txt94# -----------------------------------------------------------------------------
MEDIUMthird-party/mimalloc/CMakeLists.txt96# -----------------------------------------------------------------------------
MEDIUMthird-party/mimalloc/CMakeLists.txt153# -----------------------------------------------------------------------------
MEDIUMthird-party/mimalloc/CMakeLists.txt155# -----------------------------------------------------------------------------
MEDIUMthird-party/mimalloc/CMakeLists.txt504# -----------------------------------------------------------------------------
MEDIUMthird-party/mimalloc/CMakeLists.txt506# -----------------------------------------------------------------------------
MEDIUMthird-party/mimalloc/CMakeLists.txt567# -----------------------------------------------------------------------------
MEDIUMthird-party/mimalloc/CMakeLists.txt569# -----------------------------------------------------------------------------
MEDIUMthird-party/mimalloc/CMakeLists.txt697# -----------------------------------------------------------------------------
MEDIUMthird-party/mimalloc/CMakeLists.txt699# -----------------------------------------------------------------------------
MEDIUMthird-party/mimalloc/CMakeLists.txt741# -----------------------------------------------------------------------------
MEDIUMthird-party/mimalloc/CMakeLists.txt743# -----------------------------------------------------------------------------
MEDIUMthird-party/mimalloc/azure-pipelines.yml168# ----------------------------------------------------------
MEDIUMthird-party/mimalloc/azure-pipelines.yml170# ----------------------------------------------------------
MEDIUMthird-party/zlib/CMakeLists.txt88#============================================================================
MEDIUMthird-party/zlib/CMakeLists.txt90#============================================================================
MEDIUMthird-party/zlib/CMakeLists.txt197#============================================================================
MEDIUMthird-party/zlib/CMakeLists.txt199#============================================================================
MEDIUMthird-party/zstd/tests/gzip/init.sh19# =========================
MEDIUMthird-party/zstd/tests/gzip/init.sh40# ====================================
Self-Referential Comments15 hits · 45 pts
SeverityFileLineSnippet
MEDIUMdist.sh68# Create a Podman image.
MEDIUMtest/shuffle-sections.sh11# Create a lot of sections to lower the probability that
MEDIUMtest/shuffle-sections-seed.sh11# Create a lot of sections to lower the probability that
MEDIUMtest/lto-unclaimed.sh7# Create a fake LLVM bitcode file
MEDIUMlib/gentoo-test.sh23# Create a Podman image
MEDIUMthird-party/zlib/os400/make.sh164# Create the OS/400 library if it does not exist.
MEDIUMthird-party/zlib/os400/make.sh172# Create the DOCS source file if it does not exist.
MEDIUMthird-party/zlib/os400/make.sh194# Create the OS/400 source program file for the C header files.
MEDIUMthird-party/zlib/os400/make.sh205# Create the IFS directory for the C header files.
MEDIUMthird-party/zstd/tests/gzip/init.cfg1# This file is sourced by init.sh, *before* its initialization.
MEDIUMthird-party/zstd/tests/gzip/init.sh136# The following code attempts to find a shell with support for these features.
MEDIUMthird-party/zstd/tests/gzip/init.sh451 # Create an alias, FOO, for each FOO.exe in this directory.
MEDIUMthird-party/zstd/tests/gzip/init.sh495# Create a temporary directory, much like mktemp -d does.
MEDIUMthird-party/zstd/tests/gzip/help-version.sh147# Create a file in the current directory, not in $TMPDIR.
MEDIUMthird-party/zstd/tests/gzip/test-driver.sh26# This file is maintained in Automake, please report
Cross-File Repetition6 hits · 30 pts
SeverityFileLineSnippet
HIGHthird-party/tbb/python/tbb/pool.py0used to identify which results we're waiting for. will always be called before the jobs get submitted to the work queue,
HIGHthird-party/tbb/python/tbb/pool.py0used to identify which results we're waiting for. will always be called before the jobs get submitted to the work queue,
HIGHthird-party/tbb/python/tbb/pool.py0used to identify which results we're waiting for. will always be called before the jobs get submitted to the work queue,
HIGHthird-party/tbb/python/tbb/pool.py0called by the applyresult object (already registered via register_result()) that it is now ready (ie. the job's result i
HIGHthird-party/tbb/python/tbb/pool.py0called by the applyresult object (already registered via register_result()) that it is now ready (ie. the job's result i
HIGHthird-party/tbb/python/tbb/pool.py0called by the applyresult object (already registered via register_result()) that it is now ready (ie. the job's result i
Excessive Try-Catch Wrapping20 hits · 26 pts
SeverityFileLineSnippet
LOWthird-party/tbb/python/tbb/__init__.py233 except Exception as e:
MEDIUMthird-party/tbb/python/tbb/__init__.py228def init_sem_name():
LOWthird-party/zstd/tests/DEPRECATED-test-zstd-speed.py74 except Exception:
LOWthird-party/zstd/tests/DEPRECATED-test-zstd-speed.py370 except Exception as e:
MEDIUMthird-party/zstd/tests/DEPRECATED-test-zstd-speed.py71def does_command_exist(command):
LOWthird-party/zstd/tests/fuzz/fuzz.py397 except Exception as e:
LOWthird-party/zstd/tests/fuzz/fuzz.py583 except Exception as e:
LOWthird-party/zstd/tests/fuzz/fuzz.py636 except Exception as e:
LOWthird-party/zstd/tests/fuzz/fuzz.py660 except Exception as e:
LOWthird-party/zstd/tests/fuzz/fuzz.py739 except Exception as e:
LOWthird-party/zstd/tests/fuzz/fuzz.py814 except Exception as e:
LOWthird-party/zstd/tests/fuzz/fuzz.py839 except Exception as e:
MEDIUMthird-party/zstd/tests/fuzz/fuzz.py905 print("Error: No such command {} (pass -h for help)".format(command))
MEDIUMthird-party/zstd/tests/fuzz/fuzz.py394def build(args):
MEDIUMthird-party/zstd/tests/fuzz/fuzz.py580def libfuzzer_cmd(args):
MEDIUMthird-party/zstd/tests/fuzz/fuzz.py633def afl(args):
MEDIUMthird-party/zstd/tests/fuzz/fuzz.py651def regression(args):
MEDIUMthird-party/zstd/tests/fuzz/fuzz.py736def gen(args):
MEDIUMthird-party/zstd/tests/fuzz/fuzz.py807def minimize(args):
MEDIUMthird-party/zstd/tests/fuzz/fuzz.py833def zip_cmd(args):
Fake / Example Data16 hits · 23 pts
SeverityFileLineSnippet
LOWthird-party/zstd/tests/loremOut.h12 * Generate @size bytes of compressible data using lorem ipsum generator into
LOWthird-party/zstd/tests/fullbench.c932 * if @compressibility < 0.0, use Lorem Ipsum generator
LOWthird-party/zstd/tests/loremOut.c12 * Generates a stream of Lorem ipsum paragraphs to stdout,
LOW…ty/zstd/contrib/seekable_format/tests/seekable_tests.c272 { char const inBuffer[] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididu
LOW…ty/zstd/contrib/seekable_format/tests/seekable_tests.c272 { char const inBuffer[] = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididu
LOWthird-party/zstd/programs/lorem.h11/* lorem ipsum generator */
LOWthird-party/zstd/programs/lorem.h17 * Generate @size bytes of compressible data using lorem ipsum generator
LOWthird-party/zstd/programs/benchzstd.h128 * if @compressibility < 0.0, uses the lorem ipsum generator
LOWthird-party/zstd/programs/README.md133If no file is provided, the benchmark will use a procedurally generated "lorem ipsum" content.
LOWthird-party/zstd/programs/zstd.1.md674When no `FILE` is provided, the benchmark will use a procedurally generated `lorem ipsum` text.
LOWthird-party/zstd/programs/benchzstd.c1015 name = "Lorem ipsum";
LOWthird-party/zstd/programs/lorem.c13 * This is a very simple lorem ipsum generator
LOWthird-party/zstd/programs/lorem.c20 * The resulting compression / ratio curve of the lorem ipsum generator
LOWthird-party/zstd/programs/lorem.c25 * The compression ratio achievable on the generated lorem ipsum
LOWthird-party/zstd/programs/lorem.c240/* It's "common" for lorem ipsum generators to start with the same first
LOWthird-party/zstd/programs/zstdcli.c872 double compressibility = -1.0; /* lorem ipsum generator */
Unused Imports14 hits · 14 pts
SeverityFileLineSnippet
LOWthird-party/tbb/python/setup.py20
LOWthird-party/tbb/python/TBB.py16
LOWthird-party/tbb/python/TBB.py17
LOWthird-party/tbb/python/TBB.py17
LOWthird-party/tbb/python/tbb/__init__.py32
LOWthird-party/tbb/python/tbb/__init__.py34
LOWthird-party/tbb/python/tbb/test.py49
LOWthird-party/tbb/python/tbb/test.py50
LOWthird-party/tbb/python/tbb/pool.py70
LOWthird-party/zstd/tests/check_size.py13
LOWthird-party/zstd/tests/test-zstd-versions.py19
LOWthird-party/zstd/tests/DEPRECATED-test-zstd-speed.py20
LOWthird-party/zstd/tests/test-license.py13
LOW…rd-party/zstd/contrib/freestanding_lib/freestanding.py13
Deep Nesting14 hits · 14 pts
SeverityFileLineSnippet
LOWthird-party/tbb/python/tbb/__init__.py248
LOWthird-party/tbb/python/tbb/pool.py506
LOWthird-party/tbb/python/tbb/pool.py599
LOWthird-party/zstd/tests/automated_benchmarking.py260
LOWthird-party/zstd/tests/test-license.py136
LOWthird-party/zstd/tests/fuzz/fuzz.py736
LOWthird-party/zstd/tests/cli-tests/run.py132
LOWthird-party/zstd/tests/cli-tests/run.py583
LOW…rd-party/zstd/contrib/freestanding_lib/freestanding.py115
LOW…rd-party/zstd/contrib/freestanding_lib/freestanding.py149
LOW…rd-party/zstd/contrib/freestanding_lib/freestanding.py261
LOW…rd-party/zstd/contrib/freestanding_lib/freestanding.py523
LOW…rd-party/zstd/contrib/freestanding_lib/freestanding.py573
LOW…rd-party/zstd/contrib/freestanding_lib/freestanding.py614
AI Slop Vocabulary4 hits · 12 pts
SeverityFileLineSnippet
MEDIUMthird-party/tbb/test/tbb/test_openmp.cpp138 // For the purpose of testing, assume that OpenMP and TBB should utilize the same # of threads.
MEDIUMthird-party/tbb/src/tbb/task_stream.h42//! Essentially, this is just a pair of a queue and a mutex to protect the queue.
MEDIUMthird-party/tbb/src/tbb/task_dispatcher.cpp115 // into. Therefore, no need to utilize mandatory concurrency here.
MEDIUMthird-party/mimalloc/src/prim/osx/alloc-override-zone.c402// it seems less robust than using interpose.
Cross-Language Confusion2 hits · 8 pts
SeverityFileLineSnippet
HIGHthird-party/zstd/tests/automated_benchmarking.py103 os.system("cd ../ && make -j && cd tests")
HIGH…rd-party/zstd/contrib/freestanding_lib/freestanding.py55 Handles && and ||.
Hyper-Verbose Identifiers6 hits · 6 pts
SeverityFileLineSnippet
LOWthird-party/tbb/python/tbb/test.py92 def prepare_timeout_exception():
LOWthird-party/zstd/tests/automated_benchmarking.py73def get_builds_for_latest_hash():
LOWthird-party/zstd/tests/automated_benchmarking.py145def benchmark_dictionary_single(executable, filenames_directory, dictionary_filename, level, iterations):
LOWthird-party/zstd/tests/automated_benchmarking.py172def parse_regressions_and_labels(old_cspeed, new_cspeed, old_dspeed, new_dspeed, baseline_build, test_build):
LOWthird-party/zstd/tests/automated_benchmarking.py221def get_regressions_dictionary(baseline_build, test_build, filenames_directory, dictionary_filename, levels, iterations)
LOWthird-party/zstd/tests/DEPRECATED-test-zstd-speed.py92def send_email_with_attachments(branch, commit, last_commit, args, text, results_files,
Redundant / Tautological Comments2 hits · 3 pts
SeverityFileLineSnippet
LOWtest/arch-x86_64-z-rewrite-endbr3.sh7# Check if Intel SDE CPU emulator is available
LOWthird-party/zlib/os400/make.sh66# Set LINK to "YES" if the module has been compiled.