2017-02-07 20:05:30 +00:00
|
|
|
error: the function has a cyclomatic complexity of 28
|
2018-12-10 05:27:19 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:15:1
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | / fn main() {
|
|
|
|
LL | | if true {
|
|
|
|
LL | | println!("a");
|
|
|
|
LL | | }
|
2017-04-10 13:36:07 +00:00
|
|
|
... |
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | | }
|
|
|
|
LL | | }
|
2017-04-23 13:25:22 +00:00
|
|
|
| |_^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
= note: `-D clippy::cyclomatic-complexity` implied by `-D warnings`
|
2017-02-07 20:05:30 +00:00
|
|
|
= help: you could split it up into multiple smaller functions
|
|
|
|
|
|
|
|
error: the function has a cyclomatic complexity of 7
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:100:1
|
|
|
|
|
|
|
|
|
LL | / fn kaboom() {
|
|
|
|
LL | | let n = 0;
|
|
|
|
LL | | 'a: for i in 0..20 {
|
|
|
|
LL | | 'b: for j in i..20 {
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: the function has a cyclomatic complexity of 1
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:146:1
|
|
|
|
|
|
|
|
|
LL | / fn lots_of_short_circuits() -> bool {
|
|
|
|
LL | | true && false && true && false && true && false && true
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: the function has a cyclomatic complexity of 1
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:151:1
|
|
|
|
|
|
|
|
|
LL | / fn lots_of_short_circuits2() -> bool {
|
|
|
|
LL | | true || false || true || false || true || false || true
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: the function has a cyclomatic complexity of 2
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:156:1
|
|
|
|
|
|
|
|
|
LL | / fn baa() {
|
|
|
|
LL | | let x = || match 99 {
|
|
|
|
LL | | 0 => 0,
|
|
|
|
LL | | 1 => 1,
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: the function has a cyclomatic complexity of 2
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:157:13
|
|
|
|
|
|
|
|
|
LL | let x = || match 99 {
|
|
|
|
| _____________^
|
|
|
|
LL | | 0 => 0,
|
|
|
|
LL | | 1 => 1,
|
|
|
|
LL | | 2 => 2,
|
|
|
|
... |
|
|
|
|
LL | | _ => 42,
|
|
|
|
LL | | };
|
|
|
|
| |_____^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: the function has a cyclomatic complexity of 2
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:174:1
|
|
|
|
|
|
|
|
|
LL | / fn bar() {
|
|
|
|
LL | | match 99 {
|
|
|
|
LL | | 0 => println!("hi"),
|
|
|
|
LL | | _ => println!("bye"),
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: the function has a cyclomatic complexity of 2
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:193:1
|
|
|
|
|
|
|
|
|
LL | / fn barr() {
|
|
|
|
LL | | match 99 {
|
|
|
|
LL | | 0 => println!("hi"),
|
|
|
|
LL | | 1 => println!("bla"),
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-06 16:18:06 +00:00
|
|
|
error: the function has a cyclomatic complexity of 3
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:203:1
|
|
|
|
|
|
|
|
|
LL | / fn barr2() {
|
|
|
|
LL | | match 99 {
|
|
|
|
LL | | 0 => println!("hi"),
|
|
|
|
LL | | 1 => println!("bla"),
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-06 16:18:06 +00:00
|
|
|
error: the function has a cyclomatic complexity of 2
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:219:1
|
|
|
|
|
|
|
|
|
LL | / fn barrr() {
|
|
|
|
LL | | match 99 {
|
|
|
|
LL | | 0 => println!("hi"),
|
|
|
|
LL | | 1 => panic!("bla"),
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-06 16:18:06 +00:00
|
|
|
error: the function has a cyclomatic complexity of 3
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:229:1
|
|
|
|
|
|
|
|
|
LL | / fn barrr2() {
|
|
|
|
LL | | match 99 {
|
|
|
|
LL | | 0 => println!("hi"),
|
|
|
|
LL | | 1 => panic!("bla"),
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-06 16:18:06 +00:00
|
|
|
error: the function has a cyclomatic complexity of 2
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:245:1
|
|
|
|
|
|
|
|
|
LL | / fn barrrr() {
|
|
|
|
LL | | match 99 {
|
|
|
|
LL | | 0 => println!("hi"),
|
|
|
|
LL | | 1 => println!("bla"),
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-06 16:18:06 +00:00
|
|
|
error: the function has a cyclomatic complexity of 3
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:255:1
|
|
|
|
|
|
|
|
|
LL | / fn barrrr2() {
|
|
|
|
LL | | match 99 {
|
|
|
|
LL | | 0 => println!("hi"),
|
|
|
|
LL | | 1 => println!("bla"),
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-06 16:18:06 +00:00
|
|
|
error: the function has a cyclomatic complexity of 2
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:271:1
|
|
|
|
|
|
|
|
|
LL | / fn cake() {
|
|
|
|
LL | | if 4 == 5 {
|
|
|
|
LL | | println!("yea");
|
|
|
|
LL | | } else {
|
|
|
|
... |
|
|
|
|
LL | | println!("whee");
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-10-06 16:18:06 +00:00
|
|
|
error: the function has a cyclomatic complexity of 4
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:281:1
|
|
|
|
|
|
|
|
|
LL | / pub fn read_file(input_path: &str) -> String {
|
|
|
|
LL | | use std::fs::File;
|
|
|
|
LL | | use std::io::{Read, Write};
|
|
|
|
LL | | use std::path::Path;
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: the function has a cyclomatic complexity of 1
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:312:1
|
|
|
|
|
|
|
|
|
LL | / fn void(void: Void) {
|
|
|
|
LL | | if true {
|
|
|
|
LL | | match void {}
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= 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 1
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:325:1
|
|
|
|
|
|
|
|
|
LL | / fn try() -> Result<i32, &'static str> {
|
|
|
|
LL | | match 5 {
|
|
|
|
LL | | 5 => Ok(5),
|
|
|
|
LL | | _ => return Err("bla"),
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: the function has a cyclomatic complexity of 1
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:333:1
|
|
|
|
|
|
|
|
|
LL | / fn try_again() -> Result<i32, &'static str> {
|
|
|
|
LL | | let _ = try!(Ok(42));
|
|
|
|
LL | | let _ = try!(Ok(43));
|
|
|
|
LL | | let _ = try!(Ok(44));
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: the function has a cyclomatic complexity of 1
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:349:1
|
|
|
|
|
|
|
|
|
LL | / fn early() -> Result<i32, &'static str> {
|
|
|
|
LL | | return Ok(5);
|
|
|
|
LL | | return Ok(5);
|
|
|
|
LL | | return Ok(5);
|
|
|
|
... |
|
|
|
|
LL | | return Ok(5);
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
error: the function has a cyclomatic complexity of 8
|
2018-12-27 15:57:55 +00:00
|
|
|
--> $DIR/cyclomatic_complexity.rs:363:1
|
|
|
|
|
|
|
|
|
LL | / fn early_ret() -> i32 {
|
|
|
|
LL | | let a = if true { 42 } else { return 0; };
|
|
|
|
LL | | let a = if a < 99 { 42 } else { return 0; };
|
|
|
|
LL | | let a = if a < 99 { 42 } else { return 0; };
|
|
|
|
... |
|
|
|
|
LL | | }
|
|
|
|
LL | | }
|
|
|
|
| |_^
|
|
|
|
|
|
|
|
|
= help: you could split it up into multiple smaller functions
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2018-01-16 16:06:27 +00:00
|
|
|
error: aborting due to 20 previous errors
|
|
|
|
|