Repository Analysis

rust-lang/cargo

The Rust package manager

1.8 Likely human-written View on GitHub
1.8
Adjusted Score
1.8
Raw Score
100%
Time Factor
2026-05-30
Last Push
15,039
Stars
Rust
Language
400,449
Lines of Code
1870
Files
677
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 1MEDIUM 38LOW 638

Pattern Findings

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

Over-Commented Block619 hits · 612 pts
SeverityFileLineSnippet
LOWdeny.toml1# This template contains all of the possible sections and their default values
LOWdeny.toml21# `target_family = "unix"` configuration, that only having windows targets in
LOWdeny.toml41#exclude = []
LOWdeny.toml61
LOWdeny.toml101 "ISC",
LOWdeny.toml121# The package spec the clarification applies to
LOWdeny.toml141# One or more private registries that you might publish crates to, if a crate
LOWdeny.toml161highlight = "all"
LOWdeny.toml181 #{ crate = "ansi_term@0.11.0", wrappers = ["this-crate-directly-depends-on-ansi_term"] },
LOWdeny.toml201# "webpki-roots",
LOWdeny.toml221# This section is considered when running `cargo deny check sources`.
LOWpublish.py1#!/usr/bin/env python3
LOWcredential/cargo-credential/src/error.rs1use serde::{Deserialize, Serialize};
LOWcredential/cargo-credential/src/error.rs21
LOWcredential/cargo-credential/src/lib.rs1//! Helper library for writing Cargo credential providers.
LOWcredential/cargo-credential/src/lib.rs21//! and an unsupported index URL is passed to the provider, it should respond with
LOWcredential/cargo-credential/src/lib.rs81pub struct CredentialRequest<'a> {
LOWcredential/cargo-credential/src/lib.rs141/// A record of what kind of operation is happening that we should generate a token for.
LOWcredential/cargo-credential/src/lib.rs201 /// Do not cache this result.
LOWcredential/cargo-credential/src/secret.rs1use std::fmt;
LOWcredential/cargo-credential/src/secret.rs21#[serde(transparent)]
LOWcrates/home/src/env.rs81}
LOWcrates/home/src/lib.rs1//! Canonical definitions of `home_dir`, `cargo_home`, and `rustup_home`.
LOWcrates/home/src/lib.rs21//! > crate may make major changes to its APIs or be deprecated without warning.
LOWcrates/home/src/lib.rs41/// Some(path) if !path.as_os_str().is_empty() => println!("{}", path.display()),
LOWcrates/home/src/lib.rs61/// by the `home_dir` function.
LOWcrates/home/src/lib.rs81/// For more details, see [`cargo_home`](fn.cargo_home.html).
LOWcrates/home/src/lib.rs101///
LOWcrates/cargo-test-support/src/cross_compile.rs1//! Support for cross-compile tests with the `--target` flag.
LOWcrates/cargo-test-support/src/cross_compile.rs61
LOWcrates/cargo-test-support/src/registry.rs1//! Interact with the [`TestRegistry`]
LOWcrates/cargo-test-support/src/registry.rs21//! .file("src/lib.rs", r#"
LOWcrates/cargo-test-support/src/registry.rs81/// request here. For example, `api/v1/crates/new` is the result of publishing a crate.
LOWcrates/cargo-test-support/src/registry.rs541/// `.cargo/config` file to ensure that dependencies will use these packages
LOWcrates/cargo-test-support/src/registry.rs1281 }
LOWcrates/cargo-test-support/src/registry.rs1361 /// ```toml
LOWcrates/cargo-test-support/src/lib.rs1//! # Cargo test support.
LOWcrates/cargo-test-support/src/lib.rs21//! use cargo_test_support::prelude::*;
LOWcrates/cargo-test-support/src/lib.rs221 self.src.parent().unwrap()
LOWcrates/cargo-test-support/src/lib.rs461 glob::glob(pattern.to_str().expect("failed to convert pattern to str"))
LOWcrates/cargo-test-support/src/lib.rs481 ///
LOWcrates/cargo-test-support/src/lib.rs601}
LOWcrates/cargo-test-support/src/lib.rs641 pub fn with_process_builder(mut self, p: ProcessBuilder) -> Execs {
LOWcrates/cargo-test-support/src/lib.rs661 /// However, `""` may be preferred for intentionally empty output so people don't accidentally
LOWcrates/cargo-test-support/src/lib.rs681 /// use cargo_test_support::str;
LOWcrates/cargo-test-support/src/lib.rs701 /// "#].is_json().against_jsonlines());
LOWcrates/cargo-test-support/src/lib.rs721 /// bless a change.
LOWcrates/cargo-test-support/src/lib.rs741 /// use cargo_test_support::execs;
LOWcrates/cargo-test-support/src/lib.rs781 /// Removes exit code check for the process.
LOWcrates/cargo-test-support/src/lib.rs801 pub fn with_stdout_contains<S: ToString>(&mut self, expected: S) -> &mut Self {
LOWcrates/cargo-test-support/src/lib.rs821 }
LOWcrates/cargo-test-support/src/lib.rs841 self.expect_stdout_not_contains.push(expected.to_string());
LOWcrates/cargo-test-support/src/lib.rs861 pub fn with_stderr_does_not_contain<S: ToString>(&mut self, expected: S) -> &mut Self {
LOWcrates/cargo-test-support/src/lib.rs881 ///
LOWcrates/cargo-test-support/src/lib.rs1421 // should hopefully not surprise us as we add cargo features over time and
LOWcrates/cargo-test-support/src/paths.rs401/// - `staticlib`
LOWcrates/cargo-test-support/src/paths.rs521/// This takes the test location (std::file!() should be passed) and the test name
LOWcrates/cargo-test-support/src/git.rs1//! # Git Testing Support
LOWcrates/cargo-test-support/src/git.rs21//! let p = project()
LOWcrates/cargo-test-support/src/compare.rs1//! Routines for comparing and diffing output.
559 more matches not shown…
Self-Referential Comments33 hits · 78 pts
SeverityFileLineSnippet
MEDIUMcrates/cargo-test-support/src/git.rs3//! ## Creating a git dependency
MEDIUMcrates/cargo-util/src/paths.rs807# This file is a cache directory tag created by cargo.
MEDIUMtests/testsuite/generate_lockfile.rs168 assert!(lock0.starts_with("# This file is automatically @generated by Cargo.\n# It is not intended for manual editin
MEDIUMtests/testsuite/generate_lockfile.rs177 assert!(lock2.starts_with("# This file is automatically @generated by Cargo.\r\n# It is not intended for manual edit
MEDIUMtests/testsuite/generate_lockfile.rs355# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/patch.rs2946# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/update.rs860 assert!(lockfile.starts_with("# This file is automatically @generated by Cargo.\n# It is not intended for manual edi
MEDIUMtests/testsuite/package.rs3655 let cargo_lock_contents = r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/package.rs3758 let cargo_lock_contents = r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/package.rs3874 let cargo_lock_contents = r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/package.rs5837# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/package.rs6408 r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/git.rs3411 r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/git.rs3478 r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/publish.rs1699# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/alt_registry.rs1928# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs22# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs174# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs408# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs434# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs474# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs532 r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs580 r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs657 r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs733 r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs794 r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs868 r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs970 r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs1066 r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs1150 r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs1169 r#"# This file is automatically @generated by Cargo.
MEDIUMtests/testsuite/lockfile_compat.rs1187 r#"# This file is automatically @generated by Cargo.
MEDIUMsrc/cargo/ops/lockfile.rs133 let marker_line = "# This file is automatically @generated by Cargo.";
AI Slop Vocabulary5 hits · 15 pts
SeverityFileLineSnippet
MEDIUMsrc/cargo/core/compiler/fingerprint/dep_info.rs571 // Buffer size is the recommended amount to fully leverage SIMD instructions on AVX-512 as per
MEDIUMsrc/cargo/core/compiler/job_queue/mod.rs1213 // faithful representation of what's happening. This is somewhat nuanced
MEDIUMsrc/cargo/util/graph.rs130 // Note that this implementation isn't the most robust per se, we'll
MEDIUMsrc/cargo/sources/path.rs832 // it with git-support to leverage ignored files and to avoid pulling in entire
MEDIUMsrc/cargo/sources/git/utils.rs774 // Essentially, if `attempts == 2` then in theory the only error was
Redundant / Tautological Comments8 hits · 12 pts
SeverityFileLineSnippet
LOWtests/testsuite/update.rs1653 # Check if formatting is preserved. Nothing here should change, due to dry-run.
LOWtests/testsuite/update.rs1663 # Check if formatting is preserved. Nothing here should change, due to dry-run.
LOWtests/testsuite/update.rs1750 # Check if formatting is preserved
LOWtests/testsuite/update.rs1762 # Check if formatting is preserved
LOWtests/testsuite/update.rs1930 # Check if formatting is preserved
LOWtests/testsuite/update.rs1946 # Check if formatting is preserved
LOWtests/testsuite/update.rs2131 # Check if formatting is preserved
LOW.github/workflows/main.yml54 # Check if all jobs that we depend on (in the needs array) were successful.
Fake / Example Data8 hits · 8 pts
SeverityFileLineSnippet
LOWcrates/cargo-test-support/src/git.rs163 t!(cfg.set_str("user.email", "foo@bar.com"));
LOWtests/testsuite/package.rs3728 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
LOWtests/testsuite/package.rs3728 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
LOWtests/testsuite/package.rs3844 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
LOWtests/testsuite/package.rs3844 Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
LOWtests/testsuite/git.rs2923 cfg.set_str("user.email", "foo@bar.com").unwrap();
LOWtests/testsuite/git_gc.rs48 cfg.set_str("user.email", "foo@bar.com").unwrap();
LOWtests/testsuite/git_gc.rs51 cfg.set_str("user.email", "foo@bar.com").unwrap();
Synthetic Comment Markers1 hit · 8 pts
SeverityFileLineSnippet
HIGHsrc/cargo/ops/cargo_update.rs138 // so their dependencies can be updated as requested
Verbosity Indicators2 hits · 3 pts
SeverityFileLineSnippet
LOWcrates/cargo-util/src/paths.rs545 // For Windows, we need to check if the file is a symlink to a directory
LOWsrc/cargo/util/context/mod.rs1625 /// The purpose of this function is to aid in the transition to using
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippet
LOWsrc/cargo/core/compiler/build_context/mod.rs42/// # How to use