#lint #clippy #io #style #projects #positive #suppressed

noisy-clippy

How often is each Clippy lint suppressed on crates.io

1 unstable release

0.0.0 Sep 13, 2021

#24 in #positive

MIT/Apache

2KB

How often is each Clippy lint suppressed on crates.io

Clippy's most severe flaw in my experience has been low-signal lints that are enabled by default, aren't worth resolving and commonly need to be suppressed.

I use Clippy across a large number of my Rust projects, so I already get good visibility into which lints are misguided, buggy, or have unacceptably low true positive rate on real world code. One of my hobbies apparently is deleting such lints from Clippy or downgrading them out of the set of enabled-by-default lints (opt-out lints) to the pedantic or restriction (opt-in) groups instead.

This repo contains a script for analyzing suppressed lints on a bigger corpus: all of crates.io. For every Clippy lint, the program counts how many times it is suppressed globally (at module scope) or locally (on one single place the lint is triggered).

In the table below, I would recommend paying attention to the style and perf lints. Highly suppressed style lints indicate that the community has consciously decided that Clippy's opinion on style is wrong. Highly suppressed perf lints indicate that the community does not consider it valuable to make their code more obtuse for the sake of questionable alleged performance. I think it would be wise to delete or downgrade many of these.


Results (updated February 2023)

local global lint name category
4181 979 too_many_arguments complexity
2888 1149 type_complexity complexity
3878 98 unnecessary_wraps complexity pedantic
3421 30 needless_borrow style
3104 63 useless_conversion complexity
1103 955 upper_case_acronyms style
1257 798 large_enum_variant perf
1882 75 let_and_return style
726 872 module_name_repetitions pedantic
1160 347 cast_possible_truncation pedantic
912 471 wrong_self_convention style
288 970 all unknown
792 379 many_single_char_names style pedantic
265 894 redundant_clone perf
365 793 module_inception style
567 421 should_implement_trait style
734 205 cognitive_complexity complexity nursery
650 272 too_many_lines pedantic
352 562 unreadable_literal style pedantic
624 226 float_cmp correctness pedantic
604 243 cast_sign_loss pedantic
522 317 new_without_default style
626 198 needless_pass_by_value style pedantic
311 467 derive_partial_eq_without_eq style nursery
517 248 unwrap_used restriction
675 86 cast_ptr_alignment correctness pedantic
365 383 missing_safety_doc style
374 323 ptr_arg style
563 116 len_without_is_empty style
534 123 trivially_copy_pass_by_ref perf pedantic
72 549 let_unit_value style
389 207 missing_panics_doc pedantic
70 517 needless_return style
241 342 integer_arithmetic restriction
460 117 needless_range_loop style
488 84 new_ret_no_self style
130 436 missing_errors_doc pedantic
479 83 collapsible_if style
455 88 enum_variant_names style
384 156 cast_precision_loss pedantic
435 103 missing_const_for_fn nursery
320 189 cast_possible_wrap pedantic
102 371 must_use_candidate pedantic
315 144 identity_op complexity
31 403 disallowed_names style
175 250 similar_names pedantic
387 33 nonminimal_bool complexity
302 112 redundant_closure style
35 372 vec_init_then_push perf
44 354 needless_doctest_main style
297 90 from_over_into style
356 29 bool_comparison complexity
152 233 cast_lossless pedantic
363 19 redundant_pattern_matching style
368 14 unnecessary_lazy_evaluations style
311 67 suspicious_arithmetic_impl suspicious
251 122 single_match style
268 103 needless_lifetimes complexity
178 188 use_self nursery
338 8 comparison_to_empty style
323 18 needless_collect perf nursery
97 226 wildcard_imports pedantic
267 55 unused_self pedantic
80 239 doc_markdown pedantic
236 64 indexing_slicing restriction
206 86 match_same_arms pedantic
228 56 eq_op correctness
198 77 comparison_chain style
143 127 excessive_precision style
118 148 approx_constant correctness
259 6 mut_from_ref correctness
218 35 derived_hash_with_manual_eq correctness
125 126 option_if_let_else pedantic nursery
184 65 not_unsafe_ptr_arg_deref correctness
177 71 expect_used restriction
164 78 struct_excessive_bools pedantic
186 37 ptr_offset_with_cast complexity
115 100 match_like_matches_macro style
160 54 clone_on_copy complexity
173 41 if_same_then_else correctness
149 57 unnecessary_cast complexity
86 117 inline_always pedantic
153 47 exhaustive_structs restriction
150 45 result_unit_err style
128 65 op_ref style
80 107 missing_docs_in_private_items restriction
168 14 derivable_impls complexity
83 97 shadow_unrelated restriction
101 78 collapsible_else_if style
155 23 borrowed_box complexity
37 135 non_ascii_literal pedantic restriction
55 116 manual_range_contains style
0 171 multiple_crate_versions cargo
80 90 bool_assert_comparison style
127 42 assertions_on_constants style
111 58 panic restriction
137 31 declare_interior_mutable_const correctness style
75 91 unit_arg complexity
123 42 as_conversions restriction
123 41 mutex_atomic perf restriction
80 81 non_send_fields_in_send_ty nursery
122 35 exhaustive_enums restriction
27 129 default_trait_access pedantic
47 108 unused_unit style
126 28 match_single_binding complexity
86 65 result_large_err perf
104 42 never_loop correctness
69 74 field_reassign_with_default style
62 80 used_underscore_binding pedantic
60 80 enum_glob_use pedantic
37 95 single_match_else pedantic
75 57 unusual_byte_groupings style
37 94 assign_op_pattern style
11 120 tabs_in_doc_comments style
35 94 print_stdout restriction
80 47 undocumented_unsafe_blocks restriction
29 95 redundant_field_names style
71 52 missing_inline_in_public_items restriction
99 24 mutable_key_type suspicious
42 81 redundant_pub_crate nursery
93 30 reversed_empty_ranges correctness
32 90 items_after_statements pedantic
109 12 map_entry perf
72 48 or_fun_call nursery
72 47 transmute_ptr_to_ptr pedantic
108 9 uninit_assumed_init correctness
67 48 suspicious_op_assign_impl suspicious
56 59 type_repetition_in_bounds nursery
109 6 uninit_vec correctness
79 34 blocks_in_if_conditions style
32 72 if_not_else pedantic
0 104 implicit_return restriction
65 37 implicit_hasher style pedantic
65 37 zero_prefixed_literal complexity
18 82 redundant_static_lifetimes style
72 25 empty_loop suspicious
12 84 unseparated_literal_suffix restriction
55 37 manual_map style
74 17 option_option complexity pedantic
62 29 range_plus_one complexity pedantic
81 10 while_let_on_iterator style
86 4 no_effect complexity
33 56 pedantic unknown
25 62 match_bool style pedantic
46 41 needless_update complexity
78 8 erasing_op correctness
59 27 inconsistent_digit_grouping style
33 52 useless_transmute complexity
68 14 branches_sharing_code complexity nursery
41 41 significant_drop_in_scrutinee suspicious nursery
75 6 same_item_push style
65 15 boxed_local perf
50 29 vec_box complexity
6 72 uninlined_format_args pedantic
50 26 deprecated_cfg_attr complexity
69 6 suspicious_operation_groupings style nursery
65 10 unnecessary_unwrap complexity
27 46 borrow_interior_mutable_const correctness style
27 45 len_zero style
55 14 question_mark style
41 28 wildcard_enum_match_arm restriction
61 7 absurd_extreme_comparisons correctness
34 33 extra_unused_lifetimes complexity
27 40 unknown_clippy_lints unknown
52 15 unnecessary_operation complexity
35 29 fallible_impl_from nursery
47 17 mixed_read_write_in_expression suspicious restriction
41 23 unused_async pedantic
47 16 rc_buffer perf restriction
61 1 cast_ref_to_mut correctness
29 33 suspicious_else_formatting suspicious
21 40 float_arithmetic restriction
48 13 match_wild_err_arm style pedantic
47 14 mut_mut pedantic
22 39 single_char_pattern perf
0 60 blanket_clippy_restriction_lints suspicious
18 42 redundant_closure_call complexity
16 44 shadow_reuse restriction
39 20 integer_division pedantic restriction
25 33 semicolon_if_nothing_returned pedantic
17 40 return_self_not_must_use pedantic
31 24 inherent_to_string style
26 29 write_with_newline style
51 3 useless_attribute correctness
19 34 print_stderr restriction
37 15 unit_cmp correctness
36 15 complexity unknown
37 13 wildcard_in_or_patterns complexity
41 8 cmp_owned perf
2 47 dbg_macro restriction
28 21 match_wildcard_for_single_variants pedantic
8 41 single_component_path_imports style
22 26 bool_to_int_with_if pedantic
28 20 manual_non_exhaustive style
1 47 nonstandard_macro_braces style nursery
34 13 needless_bool complexity
41 6 only_used_in_recursion complexity
36 10 clone_double_ref correctness
29 17 future_not_send nursery
27 19 map_err_ignore restriction
13 33 string_lit_as_bytes style nursery
34 12 trivial_regex style nursery
23 23 unreachable restriction
16 29 let_underscore_drop unknown
25 20 useless_let_if_seq style nursery
42 2 derive_ord_xor_partial_ord correctness
39 5 redundant_allocation perf
43 0 manual_flatten complexity
33 10 partialeq_ne_impl complexity
22 21 redundant_closure_for_method_calls pedantic
6 36 else_if_without_else restriction
34 8 trait_duplication_in_bounds nursery
13 29 unnested_or_patterns complexity pedantic
34 8 vtable_address_comparisons correctness
15 26 pattern_type_mismatch restriction
12 29 suboptimal_flops nursery
20 20 assertions_on_result_states style restriction
26 14 iter_nth_zero style
5 35 redundant_else pedantic
23 16 needless_late_init style
15 23 manual_assert pedantic
25 13 neg_cmp_op_on_partial_ord complexity
13 25 panic_in_result_fn restriction
3 35 precedence complexity
12 26 unneeded_field_pattern restriction
24 13 deref_addrof complexity
17 20 ptr_as_ptr pedantic
16 21 use_debug restriction
29 8 while_let_loop complexity
11 25 pub_enum_variant_names deprecated
33 3 unnecessary_to_owned perf
25 10 map_clone style
18 16 empty_enum pedantic
11 23 option_map_unit_fn complexity
31 3 ref_option_ref pedantic
18 15 manual_strip complexity
23 10 unused_io_amount correctness
5 27 style unknown
19 13 unimplemented restriction
31 0 drop_bounds unknown
8 23 expl_impl_clone_on_copy pedantic
18 13 int_plus_one complexity
18 13 just_underscores_and_digits style
10 21 toplevel_ref_arg style
26 4 collapsible_match style
23 7 explicit_counter_loop complexity
28 2 needless_option_as_deref complexity
29 1 neg_multiply style
28 2 stable_sort_primitive pedantic
22 7 await_holding_lock correctness suspicious
25 4 box_collection perf
18 11 expect_fun_call perf
27 2 into_iter_on_ref style
9 20 try_err style restriction
21 8 unsafe_derive_deserialize pedantic
0 28 cargo_common_metadata cargo
18 10 drop_copy correctness
15 13 forget_copy correctness
21 7 format_push_string perf restriction
14 13 filter_map deprecated
26 1 format_in_format_args perf
8 19 match_ref_pats style
12 15 nursery unknown
16 10 explicit_auto_deref complexity
21 5 mem_forget restriction
14 12 print_literal style
11 15 useless_format complexity
8 17 checked_conversions pedantic
2 23 clone_on_ref_ptr restriction
14 11 manual_async_fn style
13 11 borrow_as_ptr pedantic
0 24 default_numeric_fallback restriction
11 13 needless_question_mark complexity
16 8 redundant_slicing complexity
4 20 renamed_and_removed_lints unknown
21 3 self_named_constructors style
13 11 suspicious_map suspicious
20 4 unwrap_in_result restriction
4 19 await_holding_refcell_ref correctness suspicious
11 12 restriction unknown
3 19 map_unwrap_or pedantic
22 0 needless_continue pedantic
9 13 no_effect_underscore_binding pedantic
12 10 transmute_ptr_to_ref complexity
6 15 from_iter_instead_of_collect pedantic
3 18 match_on_vec_items pedantic
3 18 shadow_same restriction
14 7 unnecessary_mut_passed style
2 18 inconsistent_struct_constructor pedantic
20 0 let_underscore_future suspicious
5 15 std_instead_of_core restriction
15 4 manual_swap complexity
1 18 mod_module_files restriction
4 15 verbose_bit_mask style pedantic
13 5 arithmetic_side_effects restriction
13 5 diverging_sub_expression complexity
11 7 exit restriction
18 0 inherent_to_string_shadow_display correctness
11 7 option_as_ref_deref complexity
15 2 case_sensitive_file_extension_comparisons pedantic
14 3 drop_ref correctness
11 6 from_str_radix_10 style
10 7 iter_not_returning_iterator pedantic
16 1 match_overlapping_arm style
4 13 single_char_lifetime_names restriction
10 6 double_parens complexity
3 13 forget_non_drop suspicious
6 10 multiple_inherent_impl restriction
0 16 pub_use restriction
3 12 borrow_deref_ref complexity
12 3 explicit_deref_methods pedantic
9 6 todo restriction
11 4 write_literal style
12 3 zero_sized_map_values pedantic
10 4 manual_filter_map complexity
12 2 useless_vec perf
8 6 zero_ptr style
13 0 async_yields_async correctness
9 4 box_default perf
12 1 crate_in_macro_def suspicious
7 6 drop_non_drop suspicious
2 11 explicit_iter_loop pedantic
6 7 get_first style
8 5 manual_clamp complexity nursery
13 0 manual_split_once complexity
0 13 separated_literal_suffix restriction
11 2 single_element_loop complexity
7 5 iter_cloned_collect style
8 4 manual_memcpy perf
12 0 modulo_one correctness
11 0 arithmetic unknown
10 1 string_slice restriction
5 5 cargo unknown
10 0 filter_next complexity
9 1 fn_address_comparisons correctness
9 1 forget_ref correctness
2 8 mem_replace_with_default style
7 3 perf unknown
7 3 transmute_float_to_int complexity
9 1 unnecessary_filter_map complexity
10 0 unnecessary_sort_by complexity
0 10 wildcard_dependencies cargo
8 1 bind_instead_of_map complexity
6 3 cmp_null style
8 1 debug_assert_with_mut_call nursery
1 8 decimal_literal_representation restriction
4 5 enum_clike_unportable_variant correctness
8 1 explicit_write complexity
5 4 fn_params_excessive_bools pedantic
7 2 for_loops_over_fallibles unknown
4 5 mismatching_type_param_order pedantic
7 2 overly_complex_bool_expr correctness
0 9 self_named_module_files restriction
8 1 size_of_in_element_count correctness
8 1 transmute_undefined_repr correctness nursery
7 2 while_immutable_condition correctness
8 0 disallowed_methods style
4 4 disallowed_types style
8 0 fn_to_numeric_cast style
4 4 manual_unwrap_or complexity
7 1 missing_trait_methods restriction
8 0 needless_match complexity
8 0 read_zero_byte_vec correctness
8 0 unsound_collection_transmute correctness
4 3 clippy unknown
5 2 copy_iterator pedantic
4 3 double_neg style
2 5 if_then_panic unknown
7 0 infallible_destructuring_match style
3 4 let_underscore_must_use restriction
7 0 mut_range_bound suspicious
0 7 negative_feature_names cargo
0 7 redundant_feature_names cargo
1 6 unicode_not_nfc pedantic
5 1 bad_bit_mask correctness
6 0 fn_to_numeric_cast_with_truncation style
3 3 iter_with_drain perf nursery
5 1 linkedlist pedantic
1 5 map_flatten complexity
5 1 map_identity complexity
6 0 mem_discriminant_non_enum unknown
4 2 print_in_format_impl suspicious
5 1 result_map_unit_fn complexity
2 4 to_string_in_format_args perf
2 3 doc_link_with_quotes pedantic
2 3 double_must_use style
2 3 empty_line_after_outer_attr nursery
1 4 equatable_if_let nursery
4 1 get_unwrap restriction
4 1 ifs_same_cond correctness
4 1 into_iter_on_array unknown
4 1 iter_overeager_cloned perf
2 3 manual_find complexity
0 5 manual_let_else pedantic
5 0 match_result_ok style
3 2 match_str_case_mismatch correctness
5 0 maybe_infinite_iter pedantic
0 5 modulo_arithmetic restriction
4 1 mut_mutex_lock style
5 0 naive_bytecount pedantic
0 5 needless_arbitrary_self_type complexity
3 2 panicking_unwrap correctness
1 4 possible_missing_comma correctness
0 5 std_instead_of_alloc restriction
5 0 zero_divided_by_zero complexity
4 0 cmp_nan correctness
2 2 duplicate_mod suspicious
0 4 find_map deprecated
4 0 for_kv_map style
2 2 inefficient_to_string perf pedantic
2 2 invalid_regex correctness
3 1 iter_count complexity
4 0 manual_filter complexity
0 4 mismatched_target_os correctness
4 0 misnamed_getters suspicious
2 2 needless_for_each pedantic
3 1 octal_escapes suspicious
2 2 range_minus_one pedantic
3 1 recursive_format_impl correctness
2 2 search_is_some complexity
4 0 short_circuit_statement complexity
3 1 single_char_add_str style
0 4 string_to_string restriction
3 1 transmute_int_to_char complexity
3 1 unnecessary_fold style
3 1 unused_peekable nursery
3 0 cast_slice_from_raw_parts suspicious
1 2 cloned_instead_of_copied pedantic
1 2 crosspointer_transmute complexity
3 0 deprecated unknown
0 3 deprecated_semver correctness
0 3 float_cmp_const restriction
3 0 implicit_saturating_sub style
0 3 init_numbered_fields style
2 1 invisible_characters correctness
3 0 iter_skip_next style
2 1 mistyped_literal_suffixes correctness
2 1 print_with_newline style
2 1 same_functions_in_if_condition pedantic
2 1 skip_while_next complexity
0 3 string_add restriction
3 0 transmute_bytes_to_str complexity
3 0 unnecessary_safety_doc style restriction
0 3 unsafe_removed_from_name style
3 0 useless_asref complexity
0 2 alloc_instead_of_core restriction
1 1 builtin_type_shadow style
2 0 char_lit_as_u8 complexity
1 1 collapsible_str_replace perf
1 1 empty_structs_with_brackets restriction
0 2 explicit_into_iter_loop pedantic
2 0 float_equality_without_abs suspicious
2 0 if_let_redundant_pattern_matching deprecated
2 0 if_then_some_else_none restriction
2 0 invalid_null_ptr_usage correctness
1 1 is_digit_ascii_radix style
2 0 large_stack_arrays pedantic
2 0 let_underscore_lock correctness
2 0 manual_bits style
1 1 match_as_ref complexity
0 2 mixed_case_hex_literals style
2 0 needless_splitn complexity
0 2 non_upper_case_globals unknown
2 0 ok_expect style
2 0 option_env_unwrap correctness
2 0 out_of_bounds_indexing correctness
1 1 redundant_pattern style
0 2 slow_vector_initialization perf
2 0 string_extend_chars style
0 2 transmute_int_to_bool complexity
1 1 transmute_int_to_float complexity
2 0 transmuting_null correctness
2 0 unit_return_expecting_ord correctness
0 2 unwrap_or_else_default style
0 1 almost_swapped correctness
1 0 as_conversion unknown
1 0 as_ptr_cast_mut nursery
1 0 cast_abs_to_unsigned suspicious
1 0 cast_slice_different_sizes correctness
0 1 clippy_complexity unknown
1 0 double_comparisons complexity
1 0 extend_from_slice deprecated
1 0 extend_with_drain perf
1 0 filetype_is_file restriction
1 0 filter_map_identity complexity
1 0 fn_null_check correctness
1 0 implicit_clone pedantic
1 0 infinite_iter correctness
0 1 inline_asm_x86_intel_syntax restriction
1 0 inline_fn_without_body correctness
1 0 inspect_for_each complexity
1 0 invalid_ref unknown
1 0 invalid_utf8_in_unchecked correctness
1 0 iter_nth perf
0 1 large_digit_groups style pedantic
1 0 main_recursion style
1 0 manual_find_map complexity
0 1 manual_saturating_arithmetic style
1 0 manual_string_new pedantic
1 0 mem_replace_option_with_none style
1 0 min_max correctness
0 1 misrefactored_assign_op suspicious
0 1 missing_docs unknown
0 1 must_use_unit style
0 1 needless_borrowed_reference complexity
0 1 non_octal_unix_permissions correctness
1 0 obfuscated_if_else style
1 0 option_map_or_none style
1 0 panic_params unknown
0 1 ptr_eq style
0 1 regex_macro deprecated
0 1 self_assignment correctness
1 0 suspicious unknown
1 0 swap_ptr_to_ref suspicious
0 1 transmute_num_to_bytes complexity
1 0 transmutes_expressible_as_ptr_casts complexity
1 0 unit_hash correctness
0 1 unused_doc_comment unknown
0 1 unused_parens unknown
0 1 unused_results unknown
1 0 verbose_file_reads restriction
1 0 warnings unknown
0 1 writeln_empty_string style

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps