rust-clippy/tests/ui/cyclomatic_complexity.stderr

273 lines
6.7 KiB
Text
Raw Normal View History

error: the function has a cyclomatic complexity of 28
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:15:1
|
2018-12-10 05:27:19 +00:00
15 | / fn main() {
16 | | if true {
17 | | println!("a");
18 | | }
... |
2018-12-10 05:27:19 +00:00
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
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:100:1
|
2018-12-10 05:27:19 +00:00
100 | / fn kaboom() {
101 | | let n = 0;
102 | | 'a: for i in 0..20 {
103 | | 'b: for j in i..20 {
... |
2018-12-10 05:27:19 +00:00
118 | | }
119 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:146:1
|
2018-12-10 05:27:19 +00:00
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
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:151:1
|
2018-12-10 05:27:19 +00:00
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
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:156:1
|
2018-12-10 05:27:19 +00:00
156 | / fn baa() {
157 | | let x = || match 99 {
158 | | 0 => 0,
159 | | 1 => 1,
... |
2018-12-10 05:27:19 +00:00
170 | | }
171 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:157:13
|
2018-12-10 05:27:19 +00:00
157 | let x = || match 99 {
| _____________^
2018-12-10 05:27:19 +00:00
158 | | 0 => 0,
159 | | 1 => 1,
160 | | 2 => 2,
... |
2018-12-10 05:27:19 +00:00
164 | | _ => 42,
165 | | };
| |_____^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 2
2018-12-10 05:27:19 +00:00
--> $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
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:193:1
|
2018-12-10 05:27:19 +00:00
193 | / fn barr() {
194 | | match 99 {
195 | | 0 => println!("hi"),
196 | | 1 => println!("bla"),
... |
2018-12-10 05:27:19 +00:00
199 | | }
200 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
2018-10-06 16:18:06 +00:00
error: the function has a cyclomatic complexity of 3
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:203:1
|
2018-12-10 05:27:19 +00:00
203 | / fn barr2() {
204 | | match 99 {
205 | | 0 => println!("hi"),
206 | | 1 => println!("bla"),
... |
2018-12-10 05:27:19 +00:00
215 | | }
216 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
2018-10-06 16:18:06 +00:00
error: the function has a cyclomatic complexity of 2
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:219:1
|
2018-12-10 05:27:19 +00:00
219 | / fn barrr() {
220 | | match 99 {
221 | | 0 => println!("hi"),
222 | | 1 => panic!("bla"),
... |
2018-12-10 05:27:19 +00:00
225 | | }
226 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
2018-10-06 16:18:06 +00:00
error: the function has a cyclomatic complexity of 3
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:229:1
|
2018-12-10 05:27:19 +00:00
229 | / fn barrr2() {
230 | | match 99 {
231 | | 0 => println!("hi"),
232 | | 1 => panic!("bla"),
... |
2018-12-10 05:27:19 +00:00
241 | | }
242 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
2018-10-06 16:18:06 +00:00
error: the function has a cyclomatic complexity of 2
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:245:1
|
2018-12-10 05:27:19 +00:00
245 | / fn barrrr() {
246 | | match 99 {
247 | | 0 => println!("hi"),
248 | | 1 => println!("bla"),
... |
2018-12-10 05:27:19 +00:00
251 | | }
252 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
2018-10-06 16:18:06 +00:00
error: the function has a cyclomatic complexity of 3
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:255:1
|
2018-12-10 05:27:19 +00:00
255 | / fn barrrr2() {
256 | | match 99 {
257 | | 0 => println!("hi"),
258 | | 1 => println!("bla"),
... |
2018-12-10 05:27:19 +00:00
267 | | }
268 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
2018-10-06 16:18:06 +00:00
error: the function has a cyclomatic complexity of 2
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:271:1
|
2018-12-10 05:27:19 +00:00
271 | / fn cake() {
272 | | if 4 == 5 {
273 | | println!("yea");
274 | | } else {
... |
2018-12-10 05:27:19 +00:00
277 | | println!("whee");
278 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
2018-10-06 16:18:06 +00:00
error: the function has a cyclomatic complexity of 4
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:281:1
|
2018-12-10 05:27:19 +00:00
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;
2018-10-06 16:18:06 +00:00
... |
2018-12-10 05:27:19 +00:00
306 | | }
307 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:312:1
|
312 | / fn void(void: Void) {
313 | | if true {
314 | | match void {}
315 | | }
316 | | }
2018-10-06 16:18:06 +00:00
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
2018-12-10 05:27:19 +00:00
--> $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
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:333:1
|
2018-12-10 05:27:19 +00:00
333 | / fn try_again() -> Result<i32, &'static str> {
334 | | let _ = try!(Ok(42));
335 | | let _ = try!(Ok(43));
336 | | let _ = try!(Ok(44));
... |
2018-12-10 05:27:19 +00:00
345 | | }
346 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 1
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:349:1
|
2018-12-10 05:27:19 +00:00
349 | / fn early() -> Result<i32, &'static str> {
350 | | return Ok(5);
351 | | return Ok(5);
352 | | return Ok(5);
... |
2018-12-10 05:27:19 +00:00
358 | | return Ok(5);
359 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
error: the function has a cyclomatic complexity of 8
2018-12-10 05:27:19 +00:00
--> $DIR/cyclomatic_complexity.rs:363:1
|
2018-12-10 05:27:19 +00:00
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; };
... |
2018-12-10 05:27:19 +00:00
379 | | }
380 | | }
| |_^
|
= help: you could split it up into multiple smaller functions
2018-01-16 16:06:27 +00:00
error: aborting due to 20 previous errors