]> git.lizzy.rs Git - rust.git/blob - clippy_tests/examples/cyclomatic_complexity.stderr
Fix the test suite after cargo update
[rust.git] / clippy_tests / examples / cyclomatic_complexity.stderr
1 error: the function has a cyclomatic complexity of 28
2   --> cyclomatic_complexity.rs:7:1
3    |
4 7  | / fn main() {
5 8  | |     if true {
6 9  | |         println!("a");
7 10 | |     }
8 ...  |
9 88 | |     }
10 89 | | }
11    | |_^
12    |
13    = note: `-D 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    --> cyclomatic_complexity.rs:92:1
18     |
19 92  | / fn kaboom() {
20 93  | |     let n = 0;
21 94  | |     'a: for i in 0..20 {
22 95  | |         'b: for j in i..20 {
23 ...   |
24 110 | |     }
25 111 | | }
26     | |_^
27     |
28     = note: `-D cyclomatic-complexity` implied by `-D warnings`
29     = help: you could split it up into multiple smaller functions
30
31 error: the function has a cyclomatic complexity of 1
32    --> cyclomatic_complexity.rs:138:1
33     |
34 138 | / fn lots_of_short_circuits() -> bool {
35 139 | |     true && false && true && false && true && false && true
36 140 | | }
37     | |_^
38     |
39     = note: `-D cyclomatic-complexity` implied by `-D warnings`
40     = help: you could split it up into multiple smaller functions
41
42 error: the function has a cyclomatic complexity of 1
43    --> cyclomatic_complexity.rs:143:1
44     |
45 143 | / fn lots_of_short_circuits2() -> bool {
46 144 | |     true || false || true || false || true || false || true
47 145 | | }
48     | |_^
49     |
50     = note: `-D cyclomatic-complexity` implied by `-D warnings`
51     = help: you could split it up into multiple smaller functions
52
53 error: the function has a cyclomatic complexity of 2
54    --> cyclomatic_complexity.rs:148:1
55     |
56 148 | / fn baa() {
57 149 | |     let x = || match 99 {
58 150 | |         0 => 0,
59 151 | |         1 => 1,
60 ...   |
61 162 | |     }
62 163 | | }
63     | |_^
64     |
65     = note: `-D cyclomatic-complexity` implied by `-D warnings`
66     = help: you could split it up into multiple smaller functions
67
68 error: the function has a cyclomatic complexity of 2
69    --> cyclomatic_complexity.rs:149:13
70     |
71 149 |       let x = || match 99 {
72     |  _____________^
73 150 | |         0 => 0,
74 151 | |         1 => 1,
75 152 | |         2 => 2,
76 ...   |
77 156 | |         _ => 42,
78 157 | |     };
79     | |_____^
80     |
81     = note: `-D cyclomatic-complexity` implied by `-D warnings`
82     = help: you could split it up into multiple smaller functions
83
84 error: the function has a cyclomatic complexity of 2
85    --> cyclomatic_complexity.rs:166:1
86     |
87 166 | / fn bar() {
88 167 | |     match 99 {
89 168 | |         0 => println!("hi"),
90 169 | |         _ => println!("bye"),
91 170 | |     }
92 171 | | }
93     | |_^
94     |
95     = note: `-D cyclomatic-complexity` implied by `-D warnings`
96     = help: you could split it up into multiple smaller functions
97
98 error: the function has a cyclomatic complexity of 2
99    --> cyclomatic_complexity.rs:185:1
100     |
101 185 | / fn barr() {
102 186 | |     match 99 {
103 187 | |         0 => println!("hi"),
104 188 | |         1 => println!("bla"),
105 ...   |
106 191 | |     }
107 192 | | }
108     | |_^
109     |
110     = note: `-D cyclomatic-complexity` implied by `-D warnings`
111     = help: you could split it up into multiple smaller functions
112
113 error: the function has a cyclomatic complexity of 3
114    --> cyclomatic_complexity.rs:195:1
115     |
116 195 | / fn barr2() {
117 196 | |     match 99 {
118 197 | |         0 => println!("hi"),
119 198 | |         1 => println!("bla"),
120 ...   |
121 207 | |     }
122 208 | | }
123     | |_^
124     |
125     = note: `-D cyclomatic-complexity` implied by `-D warnings`
126     = help: you could split it up into multiple smaller functions
127
128 error: the function has a cyclomatic complexity of 2
129    --> cyclomatic_complexity.rs:211:1
130     |
131 211 | / fn barrr() {
132 212 | |     match 99 {
133 213 | |         0 => println!("hi"),
134 214 | |         1 => panic!("bla"),
135 ...   |
136 217 | |     }
137 218 | | }
138     | |_^
139     |
140     = note: `-D cyclomatic-complexity` implied by `-D warnings`
141     = help: you could split it up into multiple smaller functions
142
143 error: the function has a cyclomatic complexity of 3
144    --> cyclomatic_complexity.rs:221:1
145     |
146 221 | / fn barrr2() {
147 222 | |     match 99 {
148 223 | |         0 => println!("hi"),
149 224 | |         1 => panic!("bla"),
150 ...   |
151 233 | |     }
152 234 | | }
153     | |_^
154     |
155     = note: `-D cyclomatic-complexity` implied by `-D warnings`
156     = help: you could split it up into multiple smaller functions
157
158 error: the function has a cyclomatic complexity of 2
159    --> cyclomatic_complexity.rs:237:1
160     |
161 237 | / fn barrrr() {
162 238 | |     match 99 {
163 239 | |         0 => println!("hi"),
164 240 | |         1 => println!("bla"),
165 ...   |
166 243 | |     }
167 244 | | }
168     | |_^
169     |
170     = note: `-D cyclomatic-complexity` implied by `-D warnings`
171     = help: you could split it up into multiple smaller functions
172
173 error: the function has a cyclomatic complexity of 3
174    --> cyclomatic_complexity.rs:247:1
175     |
176 247 | / fn barrrr2() {
177 248 | |     match 99 {
178 249 | |         0 => println!("hi"),
179 250 | |         1 => println!("bla"),
180 ...   |
181 259 | |     }
182 260 | | }
183     | |_^
184     |
185     = note: `-D cyclomatic-complexity` implied by `-D warnings`
186     = help: you could split it up into multiple smaller functions
187
188 error: the function has a cyclomatic complexity of 2
189    --> cyclomatic_complexity.rs:263:1
190     |
191 263 | / fn cake() {
192 264 | |     if 4 == 5 {
193 265 | |         println!("yea");
194 266 | |     } else {
195 ...   |
196 269 | |     println!("whee");
197 270 | | }
198     | |_^
199     |
200     = note: `-D cyclomatic-complexity` implied by `-D warnings`
201     = help: you could split it up into multiple smaller functions
202
203 error: the function has a cyclomatic complexity of 4
204    --> cyclomatic_complexity.rs:274:1
205     |
206 274 | / pub fn read_file(input_path: &str) -> String {
207 275 | |     use std::fs::File;
208 276 | |     use std::io::{Read, Write};
209 277 | |     use std::path::Path;
210 ...   |
211 299 | |     }
212 300 | | }
213     | |_^
214     |
215     = note: `-D cyclomatic-complexity` implied by `-D warnings`
216     = help: you could split it up into multiple smaller functions
217
218 error: the function has a cyclomatic complexity of 1
219    --> cyclomatic_complexity.rs:305:1
220     |
221 305 | / fn void(void: Void) {
222 306 | |     if true {
223 307 | |         match void {
224 308 | |         }
225 309 | |     }
226 310 | | }
227     | |_^
228     |
229     = note: `-D cyclomatic-complexity` implied by `-D warnings`
230     = help: you could split it up into multiple smaller functions
231
232 error: the function has a cyclomatic complexity of 1
233    --> cyclomatic_complexity.rs:319:1
234     |
235 319 | / fn try() -> Result<i32, &'static str> {
236 320 | |     match 5 {
237 321 | |         5 => Ok(5),
238 322 | |         _ => return Err("bla"),
239 323 | |     }
240 324 | | }
241     | |_^
242     |
243     = note: `-D cyclomatic-complexity` implied by `-D warnings`
244     = help: you could split it up into multiple smaller functions
245
246 error: the function has a cyclomatic complexity of 1
247    --> cyclomatic_complexity.rs:327:1
248     |
249 327 | / fn try_again() -> Result<i32, &'static str> {
250 328 | |     let _ = try!(Ok(42));
251 329 | |     let _ = try!(Ok(43));
252 330 | |     let _ = try!(Ok(44));
253 ...   |
254 339 | |     }
255 340 | | }
256     | |_^
257     |
258     = note: `-D cyclomatic-complexity` implied by `-D warnings`
259     = help: you could split it up into multiple smaller functions
260
261 error: the function has a cyclomatic complexity of 1
262    --> cyclomatic_complexity.rs:343:1
263     |
264 343 | / fn early() -> Result<i32, &'static str> {
265 344 | |     return Ok(5);
266 345 | |     return Ok(5);
267 346 | |     return Ok(5);
268 ...   |
269 352 | |     return Ok(5);
270 353 | | }
271     | |_^
272     |
273     = note: `-D cyclomatic-complexity` implied by `-D warnings`
274     = help: you could split it up into multiple smaller functions
275
276 error: the function has a cyclomatic complexity of 8
277    --> cyclomatic_complexity.rs:356:1
278     |
279 356 | / fn early_ret() -> i32 {
280 357 | |     let a = if true { 42 } else { return 0; };
281 358 | |     let a = if a < 99 { 42 } else { return 0; };
282 359 | |     let a = if a < 99 { 42 } else { return 0; };
283 ...   |
284 372 | |     }
285 373 | | }
286     | |_^
287     |
288     = note: `-D cyclomatic-complexity` implied by `-D warnings`
289     = help: you could split it up into multiple smaller functions
290
291 error: aborting due to previous error(s)
292
293
294 To learn more, run the command again with --verbose.