]> git.lizzy.rs Git - rust.git/blob - tests/ui/cyclomatic_complexity.stderr
rustup and compile-fail -> ui test move
[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() { //~ERROR the function has a cyclomatic complexity of 28
5    | ^
6    |
7 note: lint level defined here
8   --> $DIR/cyclomatic_complexity.rs:4:9
9    |
10 4  | #![deny(cyclomatic_complexity)]
11    |         ^^^^^^^^^^^^^^^^^^^^^
12    = help: you could split it up into multiple smaller functions
13
14 error: the function has a cyclomatic complexity of 7
15    --> $DIR/cyclomatic_complexity.rs:92:1
16     |
17 92  | fn kaboom() {  //~ ERROR: the function has a cyclomatic complexity of 7
18     | ^
19     |
20     = help: you could split it up into multiple smaller functions
21
22 error: the function has a cyclomatic complexity of 1
23    --> $DIR/cyclomatic_complexity.rs:138:1
24     |
25 138 |   fn lots_of_short_circuits() -> bool { //~ ERROR: the function has a cyclomatic complexity of 1
26     |  _^ starting here...
27 139 | |     true && false && true && false && true && false && true
28 140 | | }
29     | |_^ ...ending here
30     |
31     = help: you could split it up into multiple smaller functions
32
33 error: the function has a cyclomatic complexity of 1
34    --> $DIR/cyclomatic_complexity.rs:143:1
35     |
36 143 |   fn lots_of_short_circuits2() -> bool { //~ ERROR: the function has a cyclomatic complexity of 1
37     |  _^ starting here...
38 144 | |     true || false || true || false || true || false || true
39 145 | | }
40     | |_^ ...ending here
41     |
42     = help: you could split it up into multiple smaller functions
43
44 error: the function has a cyclomatic complexity of 2
45    --> $DIR/cyclomatic_complexity.rs:148:1
46     |
47 148 | fn baa() { //~ ERROR: the function has a cyclomatic complexity of 2
48     | ^
49     |
50     = help: you could split it up into multiple smaller functions
51
52 error: the function has a cyclomatic complexity of 2
53    --> $DIR/cyclomatic_complexity.rs:149:13
54     |
55 149 |       let x = || match 99 { //~ ERROR: the function has a cyclomatic complexity of 2
56     |  _____________^ starting here...
57 150 | |         0 => 0,
58 151 | |         1 => 1,
59 152 | |         2 => 2,
60 153 | |         4 => 4,
61 154 | |         6 => 6,
62 155 | |         9 => 9,
63 156 | |         _ => 42,
64 157 | |     };
65     | |_____^ ...ending here
66     |
67     = help: you could split it up into multiple smaller functions
68
69 error: the function has a cyclomatic complexity of 2
70    --> $DIR/cyclomatic_complexity.rs:166:1
71     |
72 166 |   fn bar() { //~ ERROR: the function has a cyclomatic complexity of 2
73     |  _^ starting here...
74 167 | |     match 99 {
75 168 | |         0 => println!("hi"),
76 169 | |         _ => println!("bye"),
77 170 | |     }
78 171 | | }
79     | |_^ ...ending here
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:185:1
85     |
86 185 |   fn barr() { //~ ERROR: the function has a cyclomatic complexity of 2
87     |  _^ starting here...
88 186 | |     match 99 {
89 187 | |         0 => println!("hi"),
90 188 | |         1 => println!("bla"),
91 189 | |         2 | 3 => println!("blub"),
92 190 | |         _ => println!("bye"),
93 191 | |     }
94 192 | | }
95     | |_^ ...ending here
96     |
97     = help: you could split it up into multiple smaller functions
98
99 error: the function has a cyclomatic complexity of 3
100    --> $DIR/cyclomatic_complexity.rs:195:1
101     |
102 195 | fn barr2() { //~ ERROR: the function has a cyclomatic complexity of 3
103     | ^
104     |
105     = help: you could split it up into multiple smaller functions
106
107 error: the function has a cyclomatic complexity of 2
108    --> $DIR/cyclomatic_complexity.rs:211:1
109     |
110 211 |   fn barrr() { //~ ERROR: the function has a cyclomatic complexity of 2
111     |  _^ starting here...
112 212 | |     match 99 {
113 213 | |         0 => println!("hi"),
114 214 | |         1 => panic!("bla"),
115 215 | |         2 | 3 => println!("blub"),
116 216 | |         _ => println!("bye"),
117 217 | |     }
118 218 | | }
119     | |_^ ...ending here
120     |
121     = help: you could split it up into multiple smaller functions
122
123 error: the function has a cyclomatic complexity of 3
124    --> $DIR/cyclomatic_complexity.rs:221:1
125     |
126 221 | fn barrr2() { //~ ERROR: the function has a cyclomatic complexity of 3
127     | ^
128     |
129     = help: you could split it up into multiple smaller functions
130
131 error: the function has a cyclomatic complexity of 2
132    --> $DIR/cyclomatic_complexity.rs:237:1
133     |
134 237 |   fn barrrr() { //~ ERROR: the function has a cyclomatic complexity of 2
135     |  _^ starting here...
136 238 | |     match 99 {
137 239 | |         0 => println!("hi"),
138 240 | |         1 => println!("bla"),
139 241 | |         2 | 3 => panic!("blub"),
140 242 | |         _ => println!("bye"),
141 243 | |     }
142 244 | | }
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:247:1
149     |
150 247 | fn barrrr2() { //~ ERROR: the function has a cyclomatic complexity of 3
151     | ^
152     |
153     = help: you could split it up into multiple smaller functions
154
155 error: the function has a cyclomatic complexity of 2
156    --> $DIR/cyclomatic_complexity.rs:263:1
157     |
158 263 |   fn cake() { //~ ERROR: the function has a cyclomatic complexity of 2
159     |  _^ starting here...
160 264 | |     if 4 == 5 {
161 265 | |         println!("yea");
162 266 | |     } else {
163 267 | |         panic!("meh");
164 268 | |     }
165 269 | |     println!("whee");
166 270 | | }
167     | |_^ ...ending here
168     |
169     = help: you could split it up into multiple smaller functions
170
171 error: the function has a cyclomatic complexity of 4
172    --> $DIR/cyclomatic_complexity.rs:274:1
173     |
174 274 | pub fn read_file(input_path: &str) -> String { //~ ERROR: the function has a cyclomatic complexity of 4
175     | ^
176     |
177     = help: you could split it up into multiple smaller functions
178
179 error: the function has a cyclomatic complexity of 1
180    --> $DIR/cyclomatic_complexity.rs:305:1
181     |
182 305 |   fn void(void: Void) { //~ ERROR: the function has a cyclomatic complexity of 1
183     |  _^ starting here...
184 306 | |     if true {
185 307 | |         match void {
186 308 | |         }
187 309 | |     }
188 310 | | }
189     | |_^ ...ending here
190     |
191     = help: you could split it up into multiple smaller functions
192
193 error: the function has a cyclomatic complexity of 1
194    --> $DIR/cyclomatic_complexity.rs:319:1
195     |
196 319 |   fn try() -> Result<i32, &'static str> { //~ ERROR: cyclomatic complexity of 1
197     |  _^ starting here...
198 320 | |     match 5 {
199 321 | |         5 => Ok(5),
200 322 | |         _ => return Err("bla"),
201 323 | |     }
202 324 | | }
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 1
208    --> $DIR/cyclomatic_complexity.rs:327:1
209     |
210 327 | fn try_again() -> Result<i32, &'static str> { //~ ERROR: cyclomatic complexity of 1
211     | ^
212     |
213     = help: you could split it up into multiple smaller functions
214
215 error: the function has a cyclomatic complexity of 1
216    --> $DIR/cyclomatic_complexity.rs:343:1
217     |
218 343 | fn early() -> Result<i32, &'static str> { //~ ERROR: cyclomatic complexity of 1
219     | ^
220     |
221     = help: you could split it up into multiple smaller functions
222
223 error: the function has a cyclomatic complexity of 8
224    --> $DIR/cyclomatic_complexity.rs:356:1
225     |
226 356 | fn early_ret() -> i32 { //~ ERROR: cyclomatic complexity of 8
227     | ^
228     |
229     = help: you could split it up into multiple smaller functions
230
231 error: aborting due to 20 previous errors
232