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