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