Repository Analysis

TheAlgorithms/Rust

All Algorithms implemented in Rust

7.7 Low AI signal View on GitHub
7.7
Adjusted Score
7.7
Raw Score
100%
Time Factor
2026-05-25
Last Push
25,807
Stars
Rust
Language
62,077
Lines of Code
439
Files
382
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 0MEDIUM 43LOW 339

Pattern Findings

382 matches across 4 categories. Click a row to expand file-level details.

Over-Commented Block325 hits · 320 pts
SeverityFileLineSnippet
LOWsrc/data_structures/segment_tree_recursive.rs81 ///
LOWsrc/data_structures/segment_tree_recursive.rs121 match (left_res, right_res) {
LOWsrc/data_structures/fenwick_tree.rs21 IndexOutOfBounds,
LOWsrc/data_structures/fenwick_tree.rs41 /// A new `FenwickTree` instance.
LOWsrc/data_structures/fenwick_tree.rs101
LOWsrc/data_structures/fenwick_tree.rs121 let left_query = if left == 0 {
LOWsrc/data_structures/fenwick_tree.rs161 /// desired value and the current value, then applying that difference using `update`.
LOWsrc/data_structures/fenwick_tree.rs181///
LOWsrc/data_structures/heap.rs1//! A generic heap data structure.
LOWsrc/data_structures/heap.rs21
LOWsrc/data_structures/heap.rs161 } else {
LOWsrc/data_structures/heap.rs221 ///
LOWsrc/data_structures/stack_using_singly_linked_list.rs101/// With the help of the ownership mechanism, the type `List` will be cleaned up automatically (dropped) after it goes o
LOWsrc/data_structures/trie.rs1//! This module provides a generic implementation of a Trie (prefix tree).
LOWsrc/data_structures/segment_tree.rs61 }
LOWsrc/data_structures/segment_tree.rs101 left /= 2;
LOWsrc/data_structures/range_minimum_query.rs1//! Range Minimum Query (RMQ) Implementation
LOWsrc/data_structures/range_minimum_query.rs21}
LOWsrc/data_structures/range_minimum_query.rs41 /// A `RangeMinimumQuery` instance that can be used to perform range minimum queries.
LOWsrc/data_structures/probabilistic/count_min_sketch.rs1use std::collections::hash_map::RandomState;
LOWsrc/data_structures/probabilistic/count_min_sketch.rs21 fn increment_by(&mut self, item: Self::Item, count: usize);
LOWsrc/data_structures/probabilistic/count_min_sketch.rs41/// <- WIDTH = 5 ->
LOWsrc/data_structures/probabilistic/count_min_sketch.rs61/// E hash2: [0, 1, 0, 0, 0]
LOWsrc/data_structures/probabilistic/bloom_filter.rs1use std::collections::hash_map::{DefaultHasher, RandomState};
LOWsrc/data_structures/probabilistic/bloom_filter.rs81
LOWsrc/bit_manipulation/swap_odd_even_bits.rs1/// Swaps odd and even bits in an integer.
LOWsrc/bit_manipulation/swap_odd_even_bits.rs21/// assert_eq!(swap_odd_even_bits(2), 1);
LOWsrc/bit_manipulation/find_unique_number.rs1/// Finds the unique number in a slice where every other element appears twice.
LOWsrc/bit_manipulation/n_bits_gray_code.rs1/// Custom error type for Gray code generation.
LOWsrc/bit_manipulation/reverse_bits.rs1//! This module provides a function to reverse the bits of a 32-bit unsigned integer.
LOWsrc/bit_manipulation/reverse_bits.rs21//! O(1) - Uses a constant amount of extra space
LOWsrc/bit_manipulation/reverse_bits.rs41/// A 32-bit unsigned integer with bits in reverse order
LOWsrc/bit_manipulation/binary_coded_decimal.rs1//! Binary Coded Decimal (BCD) conversion
LOWsrc/bit_manipulation/binary_coded_decimal.rs21///
LOWsrc/bit_manipulation/binary_coded_decimal.rs41///
LOWsrc/bit_manipulation/find_previous_power_of_two.rs1//! Previous Power of Two
LOWsrc/bit_manipulation/find_previous_power_of_two.rs21///
LOWsrc/bit_manipulation/find_previous_power_of_two.rs41/// assert_eq!(find_previous_power_of_two(8).unwrap(), 8);
LOWsrc/bit_manipulation/rightmost_set_bit.rs1/// Finds the index (position) of the rightmost set bit in a number.
LOWsrc/bit_manipulation/rightmost_set_bit.rs21///
LOWsrc/bit_manipulation/sum_of_two_integers.rs1//! This module provides a function to add two integers without using the `+` operator.
LOWsrc/bit_manipulation/find_missing_number.rs1/// Finds the missing number in a slice of consecutive integers.
LOWsrc/bit_manipulation/highest_set_bit.rs1//! This module provides a function to find the position of the most significant bit (MSB)
LOWsrc/bit_manipulation/counting_bits.rs1//! This module implements a function to count the number of set bits (1s)
LOWsrc/bit_manipulation/twos_complement.rs1//! Two's Complement Representation
LOWsrc/bit_manipulation/twos_complement.rs21/// A `Result` containing:
LOWsrc/bit_manipulation/binary_count_trailing_zeros.rs1/// Counts the number of trailing zeros in the binary representation of a number
LOWsrc/bit_manipulation/binary_count_trailing_zeros.rs21pub fn binary_count_trailing_zeros(num: u64) -> u32 {
LOWsrc/bit_manipulation/hamming_distance.rs1//! Hamming Distance
LOWsrc/bit_manipulation/hamming_distance.rs41///
LOWsrc/bit_manipulation/hamming_distance.rs61}
LOWsrc/bit_manipulation/binary_shifts.rs1//! Binary Shift Operations
LOWsrc/bit_manipulation/binary_shifts.rs21//!
LOWsrc/bit_manipulation/binary_shifts.rs41///
LOWsrc/bit_manipulation/binary_shifts.rs61 let zeros = "0".repeat(shift_amount as usize);
LOWsrc/bit_manipulation/binary_shifts.rs81///
LOWsrc/bit_manipulation/binary_shifts.rs101}
LOWsrc/bit_manipulation/binary_shifts.rs121/// ```
LOWsrc/bit_manipulation/binary_shifts.rs201/// # Arguments
LOWsrc/bit_manipulation/is_power_of_two.rs1//! Power of Two Check
265 more matches not shown…
Decorative Section Separators38 hits · 122 pts
SeverityFileLineSnippet
MEDIUMsrc/financial/depreciation.rs427// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs429// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs435 // ── Straight-line ────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs23// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs25// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs63// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs65// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs84// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs86// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs137// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs139// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs205// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs207// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs282// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs284// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs348// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs350// ─────────────────────────────────────────────────────────────
MEDIUMsrc/financial/depreciation.rs496 // ── Diminishing balance ──────────────────────────────────
MEDIUMsrc/financial/depreciation.rs537 // ── Units-of-production ──────────────────────────────────
MEDIUMsrc/financial/depreciation.rs577 // ── Sum-of-years' digits ─────────────────────────────────
MEDIUMsrc/financial/depreciation.rs637 // ── Double-declining balance ─────────────────────────────
MEDIUMsrc/machine_learning/optimization/adam.rs126 // ── Initialisation ────────────────────────────────────────────────────────
MEDIUMsrc/machine_learning/optimization/adam.rs206 // ── Step: standard Adam (weight_decay = 0.0) ──────────────────────────────
MEDIUMsrc/machine_learning/optimization/adam.rs266 // ── Step: AdamW (weight_decay > 0.0) ─────────────────────────────────────
MEDIUMsrc/machine_learning/optimization/adam.rs323 // ── Step: shared edge cases ───────────────────────────────────────────────
MEDIUMsrc/machine_learning/optimization/adam.rs332 // ── Convergence (slow; marked #[ignore]) ─────────────────────────────────
MEDIUMsrc/machine_learning/optimization/adam.rs332 // ── Convergence (slow; marked #[ignore]) ─────────────────────────────────
MEDIUMsrc/hashing/sha1.rs156 // ── NIST FIPS 180-4 / RFC 3174 test vectors ──────────────────────────────
MEDIUMsrc/hashing/sha2.rs25// ── SHA-256 / SHA-224 ────────────────────────────────────────────────────────
MEDIUMsrc/hashing/sha2.rs153// ── SHA-512 / SHA-384 / SHA-512/224 / SHA-512/256 ───────────────────────────
MEDIUMsrc/hashing/sha2.rs305// ── Tests ────────────────────────────────────────────────────────────────────
MEDIUMsrc/hashing/sha2.rs323 // ── Constant correctness ─────────────────────────────────────────────────
MEDIUMsrc/hashing/sha2.rs356 // ── SHA-256 (FIPS 180-4) ─────────────────────────────────────────────────
MEDIUMsrc/hashing/sha2.rs394 // ── SHA-224 (FIPS 180-4) ─────────────────────────────────────────────────
MEDIUMsrc/hashing/sha2.rs429 // ── SHA-512 (FIPS 180-4) ─────────────────────────────────────────────────
MEDIUMsrc/hashing/sha2.rs468 // ── SHA-384 (FIPS 180-4) ─────────────────────────────────────────────────
MEDIUMsrc/hashing/sha2.rs504 // ── SHA-512/256 (FIPS 180-4) ─────────────────────────────────────────────
MEDIUMsrc/hashing/sha2.rs530 // ── SHA-512/224 (FIPS 180-4) ─────────────────────────────────────────────
Fake / Example Data14 hits · 20 pts
SeverityFileLineSnippet
LOWsrc/general/huffman_encoding.rs351 "Lorem ipsum dolor sit amet, consectetur ",
LOWsrc/general/huffman_encoding.rs351 "Lorem ipsum dolor sit amet, consectetur ",
LOWsrc/general/huffman_encoding.rs355 "nullam vehicula. Interdum posuere lorem ipsum dolor. Elit eget ",
LOWsrc/ciphers/base64.rs250 test_e_d!(b"Lorem Ipsum sit dolor amet.");
LOWsrc/ciphers/vigenere.rs59 "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
LOWsrc/ciphers/vigenere.rs59 "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
LOWsrc/ciphers/vigenere.rs69 vigenere("1 Lorem ⏳ ipsum dolor sit amet Ѡ", "unicode"),
LOWsrc/ciphers/vigenere.rs77 vigenere("Lorem ipsum dolor sit amet", "😉 key!"),
LOWsrc/ciphers/vigenere.rs77 vigenere("Lorem ipsum dolor sit amet", "😉 key!"),
LOWsrc/ciphers/vigenere.rs84 assert_eq!(vigenere("Lorem ipsum", ""), "Lorem ipsum");
LOWsrc/string/z_algorithm.rs185 "lorem ipsum dolor sit amet, consectetur ",
LOWsrc/string/z_algorithm.rs185 "lorem ipsum dolor sit amet, consectetur ",
LOWsrc/string/z_algorithm.rs194 "lorem ipsum dolor sit amet, consectetur ",
LOWsrc/string/z_algorithm.rs194 "lorem ipsum dolor sit amet, consectetur ",
AI Slop Vocabulary5 hits · 15 pts
SeverityFileLineSnippet
MEDIUMsrc/data_structures/probabilistic/bloom_filter.rs54/// Can we improve it? Certainly, in different ways.
MEDIUM…hine_learning/loss_function/mean_squared_error_loss.rs4//! robust loss function used in machine learning.
MEDIUM…ine_learning/loss_function/mean_absolute_error_loss.rs4//! robust loss function used in machine learning.
MEDIUMsrc/math/huber_loss.rs3//! The `huber_loss` function calculates the Huber loss, which is a robust loss function used in machine learning, parti
MEDIUMsrc/math/huber_loss.rs18//! This implementation takes two references to vectors of f64 values, `actual` and `predicted`, and a `delta` value. It