File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,23 @@ use rustc_span::def_id::LocalDefId;
14
14
15
15
declare_clippy_lint ! {
16
16
/// ### What it does
17
- /// Checks for methods with high cognitive complexity .
17
+ /// We used to think it measured how hard a method is to understand .
18
18
///
19
19
/// ### Why is this bad?
20
- /// Methods of high cognitive complexity tend to be hard to
21
- /// both read and maintain. Also LLVM will tend to optimize small methods better.
20
+ /// Ideally, we would like to be able to measure how hard a function is
21
+ /// to understand given its context (what we call its Cognitive Complexity).
22
+ /// But that's not what this lint does. See "Known problems"
22
23
///
23
24
/// ### Known problems
24
- /// Sometimes it's hard to find a way to reduce the
25
- /// complexity.
25
+ /// The true Cognitive Complexity of a method is not something we can
26
+ /// calculate using modern technology. This lint has been left in the
27
+ /// `nursery` so as to not mislead users into using this lint as a
28
+ /// measurement tool.
29
+ ///
30
+ /// For more detailed information, see https://github.com/rust-lang/rust-clippy/issues/3793
26
31
///
27
32
/// ### Example
28
- /// You'll see it when you get the warning.
33
+ /// -
29
34
#[ clippy:: version = "1.35.0" ]
30
35
pub COGNITIVE_COMPLEXITY ,
31
36
nursery,
You can’t perform that action at this time.
0 commit comments