]> git.lizzy.rs Git - rust.git/blob - tests/ui/cyclomatic_complexity.stderr
Auto merge of #3527 - phansch:update_readme2, r=matthiaskrgr
[rust.git] / tests / ui / cyclomatic_complexity.stderr
1 error: the function has a cyclomatic complexity of 28
2   --> $DIR/cyclomatic_complexity.rs:16:1
3    |
4 16 | / fn main() {
5 17 | |     if true {
6 18 | |         println!("a");
7 19 | |     }
8 ...  |
9 97 | |     }
10 98 | | }
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:101:1
18     |
19 101 | / fn kaboom() {
20 102 | |     let n = 0;
21 103 | |     'a: for i in 0..20 {
22 104 | |         'b: for j in i..20 {
23 ...   |
24 119 | |     }
25 120 | | }
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:147:1
32     |
33 147 | / fn lots_of_short_circuits() -> bool {
34 148 | |     true && false && true && false && true && false && true
35 149 | | }
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:152:1
42     |
43 152 | / fn lots_of_short_circuits2() -> bool {
44 153 | |     true || false || true || false || true || false || true
45 154 | | }
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:157:1
52     |
53 157 | / fn baa() {
54 158 | |     let x = || match 99 {
55 159 | |         0 => 0,
56 160 | |         1 => 1,
57 ...   |
58 171 | |     }
59 172 | | }
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:158:13
66     |
67 158 |       let x = || match 99 {
68     |  _____________^
69 159 | |         0 => 0,
70 160 | |         1 => 1,
71 161 | |         2 => 2,
72 ...   |
73 165 | |         _ => 42,
74 166 | |     };
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:175:1
81     |
82 175 | / fn bar() {
83 176 | |     match 99 {
84 177 | |         0 => println!("hi"),
85 178 | |         _ => println!("bye"),
86 179 | |     }
87 180 | | }
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:194:1
94     |
95 194 | / fn barr() {
96 195 | |     match 99 {
97 196 | |         0 => println!("hi"),
98 197 | |         1 => println!("bla"),
99 ...   |
100 200 | |     }
101 201 | | }
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:204:1
108     |
109 204 | / fn barr2() {
110 205 | |     match 99 {
111 206 | |         0 => println!("hi"),
112 207 | |         1 => println!("bla"),
113 ...   |
114 216 | |     }
115 217 | | }
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:220:1
122     |
123 220 | / fn barrr() {
124 221 | |     match 99 {
125 222 | |         0 => println!("hi"),
126 223 | |         1 => panic!("bla"),
127 ...   |
128 226 | |     }
129 227 | | }
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:230:1
136     |
137 230 | / fn barrr2() {
138 231 | |     match 99 {
139 232 | |         0 => println!("hi"),
140 233 | |         1 => panic!("bla"),
141 ...   |
142 242 | |     }
143 243 | | }
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:246:1
150     |
151 246 | / fn barrrr() {
152 247 | |     match 99 {
153 248 | |         0 => println!("hi"),
154 249 | |         1 => println!("bla"),
155 ...   |
156 252 | |     }
157 253 | | }
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:256:1
164     |
165 256 | / fn barrrr2() {
166 257 | |     match 99 {
167 258 | |         0 => println!("hi"),
168 259 | |         1 => println!("bla"),
169 ...   |
170 268 | |     }
171 269 | | }
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:272:1
178     |
179 272 | / fn cake() {
180 273 | |     if 4 == 5 {
181 274 | |         println!("yea");
182 275 | |     } else {
183 ...   |
184 278 | |     println!("whee");
185 279 | | }
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:283:1
192     |
193 283 | / pub fn read_file(input_path: &str) -> String {
194 284 | |     use std::fs::File;
195 285 | |     use std::io::{Read, Write};
196 286 | |     use std::path::Path;
197 ...   |
198 308 | |     }
199 309 | | }
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:314:1
206     |
207 314 | / fn void(void: Void) {
208 315 | |     if true {
209 316 | |         match void {
210 317 | |         }
211 318 | |     }
212 319 | | }
213     | |_^
214     |
215     = help: you could split it up into multiple smaller functions
216
217 error: the function has a cyclomatic complexity of 1
218    --> $DIR/cyclomatic_complexity.rs:328:1
219     |
220 328 | / fn try() -> Result<i32, &'static str> {
221 329 | |     match 5 {
222 330 | |         5 => Ok(5),
223 331 | |         _ => return Err("bla"),
224 332 | |     }
225 333 | | }
226     | |_^
227     |
228     = help: you could split it up into multiple smaller functions
229
230 error: the function has a cyclomatic complexity of 1
231    --> $DIR/cyclomatic_complexity.rs:336:1
232     |
233 336 | / fn try_again() -> Result<i32, &'static str> {
234 337 | |     let _ = try!(Ok(42));
235 338 | |     let _ = try!(Ok(43));
236 339 | |     let _ = try!(Ok(44));
237 ...   |
238 348 | |     }
239 349 | | }
240     | |_^
241     |
242     = help: you could split it up into multiple smaller functions
243
244 error: the function has a cyclomatic complexity of 1
245    --> $DIR/cyclomatic_complexity.rs:352:1
246     |
247 352 | / fn early() -> Result<i32, &'static str> {
248 353 | |     return Ok(5);
249 354 | |     return Ok(5);
250 355 | |     return Ok(5);
251 ...   |
252 361 | |     return Ok(5);
253 362 | | }
254     | |_^
255     |
256     = help: you could split it up into multiple smaller functions
257
258 error: the function has a cyclomatic complexity of 8
259    --> $DIR/cyclomatic_complexity.rs:366:1
260     |
261 366 | / fn early_ret() -> i32 {
262 367 | |     let a = if true { 42 } else { return 0; };
263 368 | |     let a = if a < 99 { 42 } else { return 0; };
264 369 | |     let a = if a < 99 { 42 } else { return 0; };
265 ...   |
266 382 | |     }
267 383 | | }
268     | |_^
269     |
270     = help: you could split it up into multiple smaller functions
271
272 error: aborting due to 20 previous errors
273