File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,25 @@ use rustc_span::def_id::LocalDefId;
1414
1515declare_clippy_lint ! {
1616 /// ### 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 .
1818 ///
1919 /// ### 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"
2223 ///
2324 /// ### 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.
2629 ///
27- /// ### Example
28- /// You'll see it when you get the warning.
30+ /// For more detailed information, see [rust-clippy#3793](https://github.com/rust-lang/rust-clippy/issues/3793)
31+ ///
32+ /// ### Lints to consider instead of this
33+ ///
34+ /// * [`excessive_nesting`](https://rust-lang.github.io/rust-clippy/master/index.html#excessive_nesting)
35+ /// * [`too_many_lines`](https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines)
2936 #[ clippy:: version = "1.35.0" ]
3037 pub COGNITIVE_COMPLEXITY ,
3138 nursery,
You can’t perform that action at this time.
0 commit comments