]> git.lizzy.rs Git - rust.git/blob - tests/ui/cyclomatic_complexity.stderr
Add license header to Rust files
[rust.git] / tests / ui / cyclomatic_complexity.stderr
1 error: the function has a cyclomatic complexity of 28
2   --> $DIR/cyclomatic_complexity.rs:17:1
3    |
4 17 | / fn main() {
5 18 | |     if true {
6 19 | |         println!("a");
7 20 | |     }
8 ...  |
9 98 | |     }
10 99 | | }
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:102:1
18     |
19 102 | / fn kaboom() {
20 103 | |     let n = 0;
21 104 | |     'a: for i in 0..20 {
22 105 | |         'b: for j in i..20 {
23 ...   |
24 120 | |     }
25 121 | | }
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:148:1
32     |
33 148 | / fn lots_of_short_circuits() -> bool {
34 149 | |     true && false && true && false && true && false && true
35 150 | | }
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:153:1
42     |
43 153 | / fn lots_of_short_circuits2() -> bool {
44 154 | |     true || false || true || false || true || false || true
45 155 | | }
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:158:1
52     |
53 158 | / fn baa() {
54 159 | |     let x = || match 99 {
55 160 | |         0 => 0,
56 161 | |         1 => 1,
57 ...   |
58 172 | |     }
59 173 | | }
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:159:13
66     |
67 159 |       let x = || match 99 {
68     |  _____________^
69 160 | |         0 => 0,
70 161 | |         1 => 1,
71 162 | |         2 => 2,
72 ...   |
73 166 | |         _ => 42,
74 167 | |     };
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:176:1
81     |
82 176 | / fn bar() {
83 177 | |     match 99 {
84 178 | |         0 => println!("hi"),
85 179 | |         _ => println!("bye"),
86 180 | |     }
87 181 | | }
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:195:1
94     |
95 195 | / fn barr() {
96 196 | |     match 99 {
97 197 | |         0 => println!("hi"),
98 198 | |         1 => println!("bla"),
99 ...   |
100 201 | |     }
101 202 | | }
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:205:1
108     |
109 205 | / fn barr2() {
110 206 | |     match 99 {
111 207 | |         0 => println!("hi"),
112 208 | |         1 => println!("bla"),
113 ...   |
114 217 | |     }
115 218 | | }
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:221:1
122     |
123 221 | / fn barrr() {
124 222 | |     match 99 {
125 223 | |         0 => println!("hi"),
126 224 | |         1 => panic!("bla"),
127 ...   |
128 227 | |     }
129 228 | | }
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:231:1
136     |
137 231 | / fn barrr2() {
138 232 | |     match 99 {
139 233 | |         0 => println!("hi"),
140 234 | |         1 => panic!("bla"),
141 ...   |
142 243 | |     }
143 244 | | }
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:247:1
150     |
151 247 | / fn barrrr() {
152 248 | |     match 99 {
153 249 | |         0 => println!("hi"),
154 250 | |         1 => println!("bla"),
155 ...   |
156 253 | |     }
157 254 | | }
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:257:1
164     |
165 257 | / fn barrrr2() {
166 258 | |     match 99 {
167 259 | |         0 => println!("hi"),
168 260 | |         1 => println!("bla"),
169 ...   |
170 269 | |     }
171 270 | | }
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:273:1
178     |
179 273 | / fn cake() {
180 274 | |     if 4 == 5 {
181 275 | |         println!("yea");
182 276 | |     } else {
183 ...   |
184 279 | |     println!("whee");
185 280 | | }
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:284:1
192     |
193 284 | / pub fn read_file(input_path: &str) -> String {
194 285 | |     use std::fs::File;
195 286 | |     use std::io::{Read, Write};
196 287 | |     use std::path::Path;
197 ...   |
198 309 | |     }
199 310 | | }
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:315:1
206     |
207 315 | / fn void(void: Void) {
208 316 | |     if true {
209 317 | |         match void {
210 318 | |         }
211 319 | |     }
212 320 | | }
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:329:1
219     |
220 329 | / fn try() -> Result<i32, &'static str> {
221 330 | |     match 5 {
222 331 | |         5 => Ok(5),
223 332 | |         _ => return Err("bla"),
224 333 | |     }
225 334 | | }
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:337:1
232     |
233 337 | / fn try_again() -> Result<i32, &'static str> {
234 338 | |     let _ = try!(Ok(42));
235 339 | |     let _ = try!(Ok(43));
236 340 | |     let _ = try!(Ok(44));
237 ...   |
238 349 | |     }
239 350 | | }
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:353:1
246     |
247 353 | / fn early() -> Result<i32, &'static str> {
248 354 | |     return Ok(5);
249 355 | |     return Ok(5);
250 356 | |     return Ok(5);
251 ...   |
252 362 | |     return Ok(5);
253 363 | | }
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