/[eiffelstudio]/trunk/eweasel/tests/codeanalysis029/test.e
ViewVC logotype

Contents of /trunk/eweasel/tests/codeanalysis029/test.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 101630 - (show annotations)
Thu Apr 5 16:26:25 2018 UTC (17 months, 2 weeks ago) by alexk
File size: 4731 byte(s)
Added an example for CA017 (empty compound in conditional instruction).
1 class TEST
2
3 create
4 make
5
6 feature {NONE} -- Testing
7
8 make
9 -- Run test.
10 do
11 -- Single branch without else.
12 if out = "" then
13 do_nothing
14 end
15 if out = "" then -- CA017: the whole instruction can be removed.
16 end
17
18 -- Single branch with else.
19 if out = "" then
20 do_nothing
21 else
22 do_nothing
23 end
24 if out = "" then -- CA017: invert condition.
25 else
26 do_nothing
27 end
28 if out = "" then
29 do_nothing
30 else -- CA017
31 end
32 if out = "" then -- CA017: the whole instruction can be removed.
33 else
34 end
35
36 -- Two branches without else.
37 if out = "" then
38 do_nothing
39 elseif out ~ "" then
40 do_nothing
41 end
42 if out = "" then
43 elseif out ~ "" then
44 do_nothing
45 end
46 if out = "" then
47 do_nothing
48 elseif out ~ "" then -- CA017
49 end
50 if out = "" then -- CA017: the whole instruction can be removed.
51 elseif out ~ "" then
52 end
53
54 -- Two branches with else.
55 if out = "" then
56 do_nothing
57 elseif out ~ "" then
58 do_nothing
59 else
60 do_nothing
61 end
62 if out = "" then
63 elseif out ~ "" then
64 do_nothing
65 else
66 do_nothing
67 end
68 if out = "" then
69 do_nothing
70 elseif out ~ "" then -- CA017: invert condition.
71 else
72 do_nothing
73 end
74 if out = "" then
75 do_nothing
76 elseif out ~ "" then
77 do_nothing
78 else -- CA017
79 end
80 if out = "" then
81 elseif out ~ "" then -- CA017: invert condition.
82 else
83 do_nothing
84 end
85 if out = "" then
86 elseif out ~ "" then
87 do_nothing
88 else -- CA017
89 end
90 if out = "" then
91 do_nothing
92 elseif out ~ "" then -- CA017
93 else -- CA017
94 end
95 if out = "" then -- CA017: the whole instruction can be removed.
96 elseif out ~ "" then
97 else
98 end
99
100 -- Multiple branches without else.
101 if out = "" then
102 do_nothing
103 elseif out ~ "" then
104 do_nothing
105 elseif out < "" then
106 do_nothing
107 end
108 if out = "" then
109 elseif out ~ "" then
110 do_nothing
111 elseif out < "" then
112 do_nothing
113 end
114 if out = "" then
115 do_nothing
116 elseif out ~ "" then
117 elseif out < "" then
118 do_nothing
119 end
120 if out = "" then
121 do_nothing
122 elseif out ~ "" then
123 do_nothing
124 elseif out < "" then -- CA017
125 end
126 if out = "" then
127 elseif out ~ "" then
128 elseif out < "" then
129 do_nothing
130 end
131 if out = "" then
132 elseif out ~ "" then
133 do_nothing
134 elseif out < "" then -- CA017
135 end
136 if out = "" then
137 do_nothing
138 elseif out ~ "" then
139 elseif out < "" then -- CA017
140 end
141 if out = "" then -- CA017: the whole instruction can be removed.
142 elseif out ~ "" then
143 elseif out < "" then
144 end
145
146 -- Multiple branches with else.
147 if out = "" then
148 do_nothing
149 elseif out ~ "" then
150 do_nothing
151 elseif out < "" then
152 do_nothing
153 else
154 do_nothing
155 end
156 if out = "" then
157 elseif out ~ "" then
158 do_nothing
159 elseif out < "" then
160 do_nothing
161 else
162 do_nothing
163 end
164 if out = "" then
165 do_nothing
166 elseif out ~ "" then
167 elseif out < "" then
168 do_nothing
169 else
170 do_nothing
171 end
172 if out = "" then
173 do_nothing
174 elseif out ~ "" then
175 do_nothing
176 elseif out < "" then -- CA017: invert condition.
177 else
178 do_nothing
179 end
180 if out = "" then
181 do_nothing
182 elseif out ~ "" then
183 do_nothing
184 elseif out < "" then
185 do_nothing
186 else -- CA017
187 end
188 if out = "" then
189 elseif out ~ "" then
190 elseif out < "" then
191 do_nothing
192 else
193 do_nothing
194 end
195 if out = "" then
196 elseif out ~ "" then
197 do_nothing
198 elseif out < "" then -- CA017: invert condition.
199 else
200 do_nothing
201 end
202 if out = "" then
203 elseif out ~ "" then
204 do_nothing
205 elseif out < "" then
206 do_nothing
207 else -- CA017
208 end
209 if out = "" then
210 do_nothing
211 elseif out ~ "" then
212 elseif out < "" then -- CA017: invert condition.
213 else
214 do_nothing
215 end
216 if out = "" then
217 do_nothing
218 elseif out ~ "" then
219 elseif out < "" then
220 do_nothing
221 else -- CA017
222 end
223 if out = "" then
224 do_nothing
225 elseif out ~ "" then
226 do_nothing
227 elseif out < "" then -- CA017
228 else -- CA017
229 end
230 if out = "" then
231 elseif out ~ "" then
232 elseif out < "" then -- CA017: invert condition.
233 else
234 do_nothing
235 end
236 if out = "" then
237 elseif out ~ "" then
238 elseif out < "" then
239 do_nothing
240 else -- CA017
241 end
242 if out = "" then
243 elseif out ~ "" then
244 do_nothing
245 elseif out < "" then -- CA017
246 else -- CA017
247 end
248 if out = "" then
249 do_nothing
250 elseif out ~ "" then
251 elseif out < "" then -- CA017
252 else -- CA017
253 end
254 if out = "" then -- CA017: the whole instruction can be removed.
255 elseif out ~ "" then
256 elseif out < "" then
257 else
258 end
259 end
260
261 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23