]> git.lizzy.rs Git - rust.git/blob - tests/ui/cyclomatic_complexity.stderr
Auto merge of #3603 - xfix:random-state-lint, r=phansch
[rust.git] / tests / ui / cyclomatic_complexity.stderr
1 error: the function has a cyclomatic complexity of 28
2   --> $DIR/cyclomatic_complexity.rs:15:1
3    |
4 LL | / fn main() {
5 LL | |     if true {
6 LL | |         println!("a");
7 LL | |     }
8 ...  |
9 LL | |     }
10 LL | | }
11    | |_^
12    |
13    = note: `-D clippy::cyclomatic-complexity` implied by `-D warnings`
14    = help: you could split it up into multiple smaller functions
15
16 error: the function has a cyclomatic complexity of 7
17   --> $DIR/cyclomatic_complexity.rs:100:1
18    |
19 LL | / fn kaboom() {
20 LL | |     let n = 0;
21 LL | |     'a: for i in 0..20 {
22 LL | |         'b: for j in i..20 {
23 ...  |
24 LL | |     }
25 LL | | }
26    | |_^
27    |
28    = help: you could split it up into multiple smaller functions
29
30 error: the function has a cyclomatic complexity of 1
31   --> $DIR/cyclomatic_complexity.rs:146:1
32    |
33 LL | / fn lots_of_short_circuits() -> bool {
34 LL | |     true && false && true && false && true && false && true
35 LL | | }
36    | |_^
37    |
38    = help: you could split it up into multiple smaller functions
39
40 error: the function has a cyclomatic complexity of 1
41   --> $DIR/cyclomatic_complexity.rs:151:1
42    |
43 LL | / fn lots_of_short_circuits2() -> bool {
44 LL | |     true || false || true || false || true || false || true
45 LL | | }
46    | |_^
47    |
48    = help: you could split it up into multiple smaller functions
49
50 error: the function has a cyclomatic complexity of 2
51   --> $DIR/cyclomatic_complexity.rs:156:1
52    |
53 LL | / fn baa() {
54 LL | |     let x = || match 99 {
55 LL | |         0 => 0,
56 LL | |         1 => 1,
57 ...  |
58 LL | |     }
59 LL | | }
60    | |_^
61    |
62    = help: you could split it up into multiple smaller functions
63
64 error: the function has a cyclomatic complexity of 2
65   --> $DIR/cyclomatic_complexity.rs:157:13
66    |
67 LL |       let x = || match 99 {
68    |  _____________^
69 LL | |         0 => 0,
70 LL | |         1 => 1,
71 LL | |         2 => 2,
72 ...  |
73 LL | |         _ => 42,
74 LL | |     };
75    | |_____^
76    |
77    = help: you could split it up into multiple smaller functions
78
79 error: the function has a cyclomatic complexity of 2
80   --> $DIR/cyclomatic_complexity.rs:174:1
81    |
82 LL | / fn bar() {
83 LL | |     match 99 {
84 LL | |         0 => println!("hi"),
85 LL | |         _ => println!("bye"),
86 LL | |     }
87 LL | | }
88    | |_^
89    |
90    = help: you could split it up into multiple smaller functions
91
92 error: the function has a cyclomatic complexity of 2
93   --> $DIR/cyclomatic_complexity.rs:193:1
94    |
95 LL | / fn barr() {
96 LL | |     match 99 {
97 LL | |         0 => println!("hi"),
98 LL | |         1 => println!("bla"),
99 ...  |
100 LL | |     }
101 LL | | }
102    | |_^
103    |
104    = help: you could split it up into multiple smaller functions
105
106 error: the function has a cyclomatic complexity of 3
107   --> $DIR/cyclomatic_complexity.rs:203:1
108    |
109 LL | / fn barr2() {
110 LL | |     match 99 {
111 LL | |         0 => println!("hi"),
112 LL | |         1 => println!("bla"),
113 ...  |
114 LL | |     }
115 LL | | }
116    | |_^
117    |
118    = help: you could split it up into multiple smaller functions
119
120 error: the function has a cyclomatic complexity of 2
121   --> $DIR/cyclomatic_complexity.rs:219:1
122    |
123 LL | / fn barrr() {
124 LL | |     match 99 {
125 LL | |         0 => println!("hi"),
126 LL | |         1 => panic!("bla"),
127 ...  |
128 LL | |     }
129 LL | | }
130    | |_^
131    |
132    = help: you could split it up into multiple smaller functions
133
134 error: the function has a cyclomatic complexity of 3
135   --> $DIR/cyclomatic_complexity.rs:229:1
136    |
137 LL | / fn barrr2() {
138 LL | |     match 99 {
139 LL | |         0 => println!("hi"),
140 LL | |         1 => panic!("bla"),
141 ...  |
142 LL | |     }
143 LL | | }
144    | |_^
145    |
146    = help: you could split it up into multiple smaller functions
147
148 error: the function has a cyclomatic complexity of 2
149   --> $DIR/cyclomatic_complexity.rs:245:1
150    |
151 LL | / fn barrrr() {
152 LL | |     match 99 {
153 LL | |         0 => println!("hi"),
154 LL | |         1 => println!("bla"),
155 ...  |
156 LL | |     }
157 LL | | }
158    | |_^
159    |
160    = help: you could split it up into multiple smaller functions
161
162 error: the function has a cyclomatic complexity of 3
163   --> $DIR/cyclomatic_complexity.rs:255:1
164    |
165 LL | / fn barrrr2() {
166 LL | |     match 99 {
167 LL | |         0 => println!("hi"),
168 LL | |         1 => println!("bla"),
169 ...  |
170 LL | |     }
171 LL | | }
172    | |_^
173    |
174    = help: you could split it up into multiple smaller functions
175
176 error: the function has a cyclomatic complexity of 2
177   --> $DIR/cyclomatic_complexity.rs:271:1
178    |
179 LL | / fn cake() {
180 LL | |     if 4 == 5 {
181 LL | |         println!("yea");
182 LL | |     } else {
183 ...  |
184 LL | |     println!("whee");
185 LL | | }
186    | |_^
187    |
188    = help: you could split it up into multiple smaller functions
189
190 error: the function has a cyclomatic complexity of 4
191   --> $DIR/cyclomatic_complexity.rs:281:1
192    |
193 LL | / pub fn read_file(input_path: &str) -> String {
194 LL | |     use std::fs::File;
195 LL | |     use std::io::{Read, Write};
196 LL | |     use std::path::Path;
197 ...  |
198 LL | |     }
199 LL | | }
200    | |_^
201    |
202    = help: you could split it up into multiple smaller functions
203
204 error: the function has a cyclomatic complexity of 1
205   --> $DIR/cyclomatic_complexity.rs:312:1
206    |
207 LL | / fn void(void: Void) {
208 LL | |     if true {
209 LL | |         match void {}
210 LL | |     }
211 LL | | }
212    | |_^
213    |
214    = help: you could split it up into multiple smaller functions
215
216 error: the function has a cyclomatic complexity of 1
217   --> $DIR/cyclomatic_complexity.rs:325:1
218    |
219 LL | / fn try() -> Result<i32, &'static str> {
220 LL | |     match 5 {
221 LL | |         5 => Ok(5),
222 LL | |         _ => return Err("bla"),
223 LL | |     }
224 LL | | }
225    | |_^
226    |
227    = help: you could split it up into multiple smaller functions
228
229 error: the function has a cyclomatic complexity of 1
230   --> $DIR/cyclomatic_complexity.rs:333:1
231    |
232 LL | / fn try_again() -> Result<i32, &'static str> {
233 LL | |     let _ = try!(Ok(42));
234 LL | |     let _ = try!(Ok(43));
235 LL | |     let _ = try!(Ok(44));
236 ...  |
237 LL | |     }
238 LL | | }
239    | |_^
240    |
241    = help: you could split it up into multiple smaller functions
242
243 error: the function has a cyclomatic complexity of 1
244   --> $DIR/cyclomatic_complexity.rs:349:1
245    |
246 LL | / fn early() -> Result<i32, &'static str> {
247 LL | |     return Ok(5);
248 LL | |     return Ok(5);
249 LL | |     return Ok(5);
250 ...  |
251 LL | |     return Ok(5);
252 LL | | }
253    | |_^
254    |
255    = help: you could split it up into multiple smaller functions
256
257 error: the function has a cyclomatic complexity of 8
258   --> $DIR/cyclomatic_complexity.rs:363:1
259    |
260 LL | / fn early_ret() -> i32 {
261 LL | |     let a = if true { 42 } else { return 0; };
262 LL | |     let a = if a < 99 { 42 } else { return 0; };
263 LL | |     let a = if a < 99 { 42 } else { return 0; };
264 ...  |
265 LL | |     }
266 LL | | }
267    | |_^
268    |
269    = help: you could split it up into multiple smaller functions
270
271 error: aborting due to 20 previous errors
272