rust-clippy/tests/ui/cyclomatic_complexity.stderr
2018-12-10 08:22:07 +01:00

272 lines
6.7 KiB
Text

error: the function has a cyclomatic complexity of 28
--> $DIR/cyclomatic_complexity.rs:15:1
|
15 | / fn main() {
16 | | if true {
17 | | println!("a");
18 | | }
... |
96 | | }
97 | | }
| |_^
|
= note: `-D clippy::cyclomatic-complexity` implied by `-D warnings`
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 7
--> $DIR/cyclomatic_complexity.rs:100:1
|
100 | / fn kaboom() {
101 | | let n = 0;
102 | | 'a: for i in 0..20 {
103 | | 'b: for j in i..20 {
... |
118 | | }
119 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
--> $DIR/cyclomatic_complexity.rs:146:1
|
146 | / fn lots_of_short_circuits() -> bool {
147 | | true && false && true && false && true && false && true
148 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
--> $DIR/cyclomatic_complexity.rs:151:1
|
151 | / fn lots_of_short_circuits2() -> bool {
152 | | true || false || true || false || true || false || true
153 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:156:1
|
156 | / fn baa() {
157 | | let x = || match 99 {
158 | | 0 => 0,
159 | | 1 => 1,
... |
170 | | }
171 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:157:13
|
157 | let x = || match 99 {
| _____________^
158 | | 0 => 0,
159 | | 1 => 1,
160 | | 2 => 2,
... |
164 | | _ => 42,
165 | | };
| |_____^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:174:1
|
174 | / fn bar() {
175 | | match 99 {
176 | | 0 => println!("hi"),
177 | | _ => println!("bye"),
178 | | }
179 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:193:1
|
193 | / fn barr() {
194 | | match 99 {
195 | | 0 => println!("hi"),
196 | | 1 => println!("bla"),
... |
199 | | }
200 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 3
--> $DIR/cyclomatic_complexity.rs:203:1
|
203 | / fn barr2() {
204 | | match 99 {
205 | | 0 => println!("hi"),
206 | | 1 => println!("bla"),
... |
215 | | }
216 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:219:1
|
219 | / fn barrr() {
220 | | match 99 {
221 | | 0 => println!("hi"),
222 | | 1 => panic!("bla"),
... |
225 | | }
226 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 3
--> $DIR/cyclomatic_complexity.rs:229:1
|
229 | / fn barrr2() {
230 | | match 99 {
231 | | 0 => println!("hi"),
232 | | 1 => panic!("bla"),
... |
241 | | }
242 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:245:1
|
245 | / fn barrrr() {
246 | | match 99 {
247 | | 0 => println!("hi"),
248 | | 1 => println!("bla"),
... |
251 | | }
252 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 3
--> $DIR/cyclomatic_complexity.rs:255:1
|
255 | / fn barrrr2() {
256 | | match 99 {
257 | | 0 => println!("hi"),
258 | | 1 => println!("bla"),
... |
267 | | }
268 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
--> $DIR/cyclomatic_complexity.rs:271:1
|
271 | / fn cake() {
272 | | if 4 == 5 {
273 | | println!("yea");
274 | | } else {
... |
277 | | println!("whee");
278 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 4
--> $DIR/cyclomatic_complexity.rs:281:1
|
281 | / pub fn read_file(input_path: &str) -> String {
282 | | use std::fs::File;
283 | | use std::io::{Read, Write};
284 | | use std::path::Path;
... |
306 | | }
307 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
--> $DIR/cyclomatic_complexity.rs:312:1
|
312 | / fn void(void: Void) {
313 | | if true {
314 | | match void {}
315 | | }
316 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
--> $DIR/cyclomatic_complexity.rs:325:1
|
325 | / fn try() -> Result<i32, &'static str> {
326 | | match 5 {
327 | | 5 => Ok(5),
328 | | _ => return Err("bla"),
329 | | }
330 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
--> $DIR/cyclomatic_complexity.rs:333:1
|
333 | / fn try_again() -> Result<i32, &'static str> {
334 | | let _ = try!(Ok(42));
335 | | let _ = try!(Ok(43));
336 | | let _ = try!(Ok(44));
... |
345 | | }
346 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
--> $DIR/cyclomatic_complexity.rs:349:1
|
349 | / fn early() -> Result<i32, &'static str> {
350 | | return Ok(5);
351 | | return Ok(5);
352 | | return Ok(5);
... |
358 | | return Ok(5);
359 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 8
--> $DIR/cyclomatic_complexity.rs:363:1
|
363 | / fn early_ret() -> i32 {
364 | | let a = if true { 42 } else { return 0; };
365 | | let a = if a < 99 { 42 } else { return 0; };
366 | | let a = if a < 99 { 42 } else { return 0; };
... |
379 | | }
380 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: aborting due to 20 previous errors