This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree 2 files changed +20
-2
lines changed 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -454,15 +454,17 @@ mod issue9300 {
454
454
}
455
455
}
456
456
457
- #[ clippy:: cognitive_complexity = "2 " ]
457
+ #[ clippy:: cognitive_complexity = "1 " ]
458
458
mod issue14422 {
459
459
fn foo ( ) {
460
+ //~^ cognitive_complexity
460
461
for _ in 0 ..10 {
461
462
println ! ( "hello there" ) ;
462
463
}
463
464
}
464
465
465
466
fn bar ( ) {
467
+ //~^ cognitive_complexity
466
468
for _ in 0 ..10 {
467
469
println ! ( "hello there" ) ;
468
470
}
Original file line number Diff line number Diff line change @@ -160,5 +160,21 @@ LL | pub async fn async_method() {
160
160
|
161
161
= help: you could split it up into multiple smaller functions
162
162
163
- error: aborting due to 20 previous errors
163
+ error: the function has a cognitive complexity of (2/1)
164
+ --> tests/ui/cognitive_complexity.rs:459:8
165
+ |
166
+ LL | fn foo() {
167
+ | ^^^
168
+ |
169
+ = help: you could split it up into multiple smaller functions
170
+
171
+ error: the function has a cognitive complexity of (2/1)
172
+ --> tests/ui/cognitive_complexity.rs:466:8
173
+ |
174
+ LL | fn bar() {
175
+ | ^^^
176
+ |
177
+ = help: you could split it up into multiple smaller functions
178
+
179
+ error: aborting due to 22 previous errors
164
180
You can’t perform that action at this time.
0 commit comments