]> git.lizzy.rs Git - rust.git/blob - tests/ui/cyclomatic_complexity.stderr
Merge pull request #2984 from flip1995/single_char_pattern
[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: `-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    --> $DIR/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     = 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:138:1
32     |
33 138 | / fn lots_of_short_circuits() -> bool {
34 139 | |     true && false && true && false && true && false && true
35 140 | | }
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:143:1
42     |
43 143 | / fn lots_of_short_circuits2() -> bool {
44 144 | |     true || false || true || false || true || false || true
45 145 | | }
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:148:1
52     |
53 148 | / fn baa() {
54 149 | |     let x = || match 99 {
55 150 | |         0 => 0,
56 151 | |         1 => 1,
57 ...   |
58 162 | |     }
59 163 | | }
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:149:13
66     |
67 149 |       let x = || match 99 {
68     |  _____________^
69 150 | |         0 => 0,
70 151 | |         1 => 1,
71 152 | |         2 => 2,
72 ...   |
73 156 | |         _ => 42,
74 157 | |     };
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:166:1
81     |
82 166 | / fn bar() {
83 167 | |     match 99 {
84 168 | |         0 => println!("hi"),
85 169 | |         _ => println!("bye"),
86 170 | |     }
87 171 | | }
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:185:1
94     |
95 185 | / fn barr() {
96 186 | |     match 99 {
97 187 | |         0 => println!("hi"),
98 188 | |         1 => println!("bla"),
99 ...   |
100 191 | |     }
101 192 | | }
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:195:1
108     |
109 195 | / fn barr2() {
110 196 | |     match 99 {
111 197 | |         0 => println!("hi"),
112 198 | |         1 => println!("bla"),
113 ...   |
114 207 | |     }
115 208 | | }
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:211:1
122     |
123 211 | / fn barrr() {
124 212 | |     match 99 {
125 213 | |         0 => println!("hi"),
126 214 | |         1 => panic!("bla"),
127 ...   |
128 217 | |     }
129 218 | | }
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:221:1
136     |
137 221 | / fn barrr2() {
138 222 | |     match 99 {
139 223 | |         0 => println!("hi"),
140 224 | |         1 => panic!("bla"),
141 ...   |
142 233 | |     }
143 234 | | }
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:237:1
150     |
151 237 | / fn barrrr() {
152 238 | |     match 99 {
153 239 | |         0 => println!("hi"),
154 240 | |         1 => println!("bla"),
155 ...   |
156 243 | |     }
157 244 | | }
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:247:1
164     |
165 247 | / fn barrrr2() {
166 248 | |     match 99 {
167 249 | |         0 => println!("hi"),
168 250 | |         1 => println!("bla"),
169 ...   |
170 259 | |     }
171 260 | | }
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:263:1
178     |
179 263 | / fn cake() {
180 264 | |     if 4 == 5 {
181 265 | |         println!("yea");
182 266 | |     } else {
183 ...   |
184 269 | |     println!("whee");
185 270 | | }
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:274:1
192     |
193 274 | / pub fn read_file(input_path: &str) -> String {
194 275 | |     use std::fs::File;
195 276 | |     use std::io::{Read, Write};
196 277 | |     use std::path::Path;
197 ...   |
198 299 | |     }
199 300 | | }
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:305:1
206     |
207 305 | / fn void(void: Void) {
208 306 | |     if true {
209 307 | |         match void {
210 308 | |         }
211 309 | |     }
212 310 | | }
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:319:1
219     |
220 319 | / fn try() -> Result<i32, &'static str> {
221 320 | |     match 5 {
222 321 | |         5 => Ok(5),
223 322 | |         _ => return Err("bla"),
224 323 | |     }
225 324 | | }
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:327:1
232     |
233 327 | / fn try_again() -> Result<i32, &'static str> {
234 328 | |     let _ = try!(Ok(42));
235 329 | |     let _ = try!(Ok(43));
236 330 | |     let _ = try!(Ok(44));
237 ...   |
238 339 | |     }
239 340 | | }
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:343:1
246     |
247 343 | / fn early() -> Result<i32, &'static str> {
248 344 | |     return Ok(5);
249 345 | |     return Ok(5);
250 346 | |     return Ok(5);
251 ...   |
252 352 | |     return Ok(5);
253 353 | | }
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:356:1
260     |
261 356 | / fn early_ret() -> i32 {
262 357 | |     let a = if true { 42 } else { return 0; };
263 358 | |     let a = if a < 99 { 42 } else { return 0; };
264 359 | |     let a = if a < 99 { 42 } else { return 0; };
265 ...   |
266 372 | |     }
267 373 | | }
268     | |_^
269     |
270     = help: you could split it up into multiple smaller functions
271
272 error: aborting due to 20 previous errors
273