Repository Analysis

rust-lang/rust-clippy

A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/

4.7 Likely human-written View on GitHub
4.7
Adjusted Score
4.7
Raw Score
100%
Time Factor
2026-05-29
Last Push
13,219
Stars
Rust
Language
306,624
Lines of Code
2570
Files
1560
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 0MEDIUM 5LOW 1555

Pattern Findings

1560 matches across 6 categories. Click a row to expand file-level details.

Over-Commented Block1522 hits · 1354 pts
SeverityFileLineSnippet
LOWclippy_utils/src/consts.rs41 Char(char),
LOWclippy_utils/src/consts.rs1121/// If `expr` evaluates to an integer constant, return its value.
LOWclippy_utils/src/diagnostics.rs81///
LOWclippy_utils/src/diagnostics.rs101/// |
LOWclippy_utils/src/diagnostics.rs121/// For the `span_lint_and_help` function, the node that was passed into the `LintPass::check_*`
LOWclippy_utils/src/diagnostics.rs161
LOWclippy_utils/src/diagnostics.rs181/// If it doesn't, you likely need to use [`span_lint_hir_and_then`] instead.
LOWclippy_utils/src/diagnostics.rs221///
LOWclippy_utils/src/diagnostics.rs261 f(diag);
LOWclippy_utils/src/diagnostics.rs281///
LOWclippy_utils/src/diagnostics.rs301/// This is in contrast to [`span_lint_and_then`], which always emits the lint at the node that was
LOWclippy_utils/src/diagnostics.rs341
LOWclippy_utils/src/diagnostics.rs361/// If you're emitting the lint at the span of a different node than the one provided by the
LOWclippy_utils/src/visitors.rs501/// Runs the given function for each sub-expression producing the final value consumed by the parent
LOWclippy_utils/src/lib.rs141 let sess = rustc_lint::LintContext::sess(cx);
LOWclippy_utils/src/lib.rs441/// Use this if you want to find the `TraitRef` of the `Add` trait in this example:
LOWclippy_utils/src/lib.rs721/// * Yield/Return statements.
LOWclippy_utils/src/lib.rs1321 node,
LOWclippy_utils/src/lib.rs1461 }
LOWclippy_utils/src/lib.rs1841/// Checks if a function's body represents the identity function. Looks for bodies of the form:
LOWclippy_utils/src/lib.rs2121/// # struct S;
LOWclippy_utils/src/lib.rs2941}
LOWclippy_utils/src/lib.rs3061 fn push_break_target(&mut self, id: HirId) {
LOWclippy_utils/src/lib.rs3321 tcx.def_path_str(callee)
LOWclippy_utils/src/lib.rs3361 // result should be super::super::c::d::e::f
LOWclippy_utils/src/lib.rs3461}
LOWclippy_utils/src/lib.rs3621/// Checks if `expr` may be directly used as the return value of its enclosing body.
LOWclippy_utils/src/check_proc_macro.rs1//! This module handles checking if the span given is from a proc-macro or not.
LOWclippy_utils/src/paths.rs161pub static ONCE_CELL_SYNC_LAZY: PathLookup = type_path!(once_cell::sync::Lazy);
LOWclippy_utils/src/res.rs341
LOWclippy_utils/src/str_utils.rs61/// ```no_run
LOWclippy_utils/src/str_utils.rs121}
LOWclippy_utils/src/str_utils.rs181
LOWclippy_utils/src/source.rs141 f: impl for<'a> FnOnce(&'a SourceFile, &'a str, Range<usize>) -> Option<Range<usize>>,
LOWclippy_utils/src/source.rs401/// Extends the span to the beginning of the spans line, incl. whitespaces.
LOWclippy_utils/src/source.rs441// sources that the user has no control over.
LOWclippy_utils/src/source.rs521/// to convert a given `Span` to a `str`.
LOWclippy_utils/src/source.rs581}
LOWclippy_utils/src/source.rs601/// y;
LOWclippy_utils/src/source.rs701 )
LOWclippy_utils/src/source.rs721/// This will traverse through multiple macro calls. Given the following:
LOWclippy_utils/src/sugg.rs21
LOWclippy_utils/src/sugg.rs701 ///
LOWclippy_utils/src/sugg.rs721 ///
LOWclippy_utils/src/sugg.rs861 /// The `hir_id` of the closure argument being checked
LOWclippy_utils/src/sugg.rs961 let _ = write!(self.suggestion_start, "{start_snip}{ident_str_with_proj}");
LOWclippy_utils/src/hir_utils.rs41 Exact,
LOWclippy_utils/src/macros.rs161 .into_iter()
LOWclippy_utils/src/macros.rs241#[derive(Debug)]
LOWclippy_utils/src/ty/type_certainty/mod.rs1//! A heuristic to tell whether an expression's type can be determined purely from its
LOWclippy_lints_internal/src/produce_ice.rs1use rustc_ast::ast::NodeId;
LOWclippy_lints_internal/src/lint_without_lint_pass.rs21 ///
LOWclippy_lints_internal/src/lint_without_lint_pass.rs41 Warn,
LOW…ippy_lints_internal/src/repeated_is_diagnostic_item.rs21 /// compare the output with all the `Symbol`s.
LOW…ippy_lints_internal/src/repeated_is_diagnostic_item.rs41 /// ..
LOW…ippy_lints_internal/src/repeated_is_diagnostic_item.rs61 /// if cx.tcx.is_diagnostic_item(sym::Result, did) {
LOW…ippy_lints_internal/src/repeated_is_diagnostic_item.rs81 /// }
LOW…ippy_lints_internal/src/repeated_is_diagnostic_item.rs101 /// ..
LOW…ippy_lints_internal/src/collapsible_span_lint_calls.rs21 /// These usages of `span_lint_and_then` should be replaced with one of the
LOW…ippy_lints_internal/src/collapsible_span_lint_calls.rs41 /// });
1462 more matches not shown…
Fake / Example Data22 hits · 40 pts
SeverityFileLineSnippet
LOWtests/ui/sliced_string_as_bytes.rs25 let s = "Lorem ipsum";
LOWtests/ui/sliced_string_as_bytes.rs26 let string: String = "dolor sit amet".to_owned();
LOWtests/ui/too_long_first_doc_paragraph.rs16/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia
LOWtests/ui/too_long_first_doc_paragraph.rs16/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia
LOWtests/ui/too_long_first_doc_paragraph.rs23/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia
LOWtests/ui/too_long_first_doc_paragraph.rs23/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia
LOWtests/ui/too_long_first_doc_paragraph.rs29/// Lorem ipsum dolor sit amet, consectetur adipiscing elit.
LOWtests/ui/too_long_first_doc_paragraph.rs29/// Lorem ipsum dolor sit amet, consectetur adipiscing elit.
LOWtests/ui/too_long_first_doc_paragraph.rs40/// ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia
LOWtests/ui/too_long_first_doc_paragraph.rs50/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia
LOWtests/ui/too_long_first_doc_paragraph.rs50/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia
LOWtests/ui/too_long_first_doc_paragraph.rs59/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia
LOWtests/ui/too_long_first_doc_paragraph.rs59/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc turpis nunc, lacinia
LOWtests/ui/too_long_first_doc_paragraph.rs65/// Some function. This doc-string paragraph is too long. Lorem Ipsum is simply dummy text of the printing and typesetti
LOW…documented_unsafe_blocks/undocumented_unsafe_blocks.rs119 // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
LOW…documented_unsafe_blocks/undocumented_unsafe_blocks.rs119 // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
LOW…documented_unsafe_blocks/undocumented_unsafe_blocks.rs538 // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
LOW…documented_unsafe_blocks/undocumented_unsafe_blocks.rs538 // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
LOWtests/ui-toml/large_include_file/too_big.txt1Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq
LOWtests/ui-toml/large_include_file/too_big.txt1Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliq
LOWclippy_lints/src/methods/mod.rs3624 /// let s = "Lorem ipsum";
LOWclippy_lints/src/methods/mod.rs3629 /// let s = "Lorem ipsum";
AI Slop Vocabulary4 hits · 12 pts
SeverityFileLineSnippet
MEDIUMclippy_lints/src/same_length_and_capacity.rs65 /// // This time, leverage the previously saved capacity:
MEDIUMclippy_lints/src/large_stack_frames.rs197 // TODO: Is there a cleaner, robust way to ask this question?
MEDIUMclippy_lints/src/operators/mod.rs497 /// technically unnecessary. However, it will make the code more robust and doesn't have any
MEDIUMsrc/driver.rs157 // is there already. Certainly it can't hurt.
Redundant / Tautological Comments5 hits · 8 pts
SeverityFileLineSnippet
LOW.github/workflows/clippy_mq.yml214 # Check if all jobs that we depend on (in the needs array) were successful.
LOW.github/workflows/clippy_dev.yml60 # Check if all jobs that we depend on (in the needs array) were successful.
LOW.github/workflows/clippy_pr.yml83 # Check if all jobs that we depend on (in the needs array) were successful.
LOW.github/workflows/clippy_changelog.yml50 # Check if all jobs that we depend on (in the needs array) were successful.
LOW.github/workflows/remark.yml66 # Check if all jobs that we depend on (in the needs array) were successful.
Slop Phrases3 hits · 6 pts
SeverityFileLineSnippet
MEDIUMlintcheck/lintcheck_crates.toml6# For testing you can also add sources to git and local repos like this:
LOW.github/workflows/clippy_mq.yml33 # NOTE: If you modify this job, make sure you copy the changes to clippy.yml
LOW.github/workflows/clippy_pr.yml21 # NOTE: If you modify this job, make sure you copy the changes to clippy_mq.yml
Verbosity Indicators4 hits · 6 pts
SeverityFileLineSnippet
LOWclippy_lints/src/missing_inline.rs115 // note: we need to check if the trait is exported so we can't use
LOWclippy_lints/src/non_copy_const.rs457 // Normalized as we need to check if this is an array later.
LOWclippy_lints/src/non_copy_const.rs500 // Normalized as we need to check if this is an array later.
LOWclippy_lints/src/non_copy_const.rs639 // Normalized as we need to check if this is an array later.