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