Commit 9e73c19
chore: enable CPD detection (pmd.cpd.min 100000 -> 100), de-dup and baseline
pmd.cpd.min was 100000, which effectively disabled PMD's copy/paste detector
(#1339). Lower it to PMD's default of 100 so CPD catches duplication going
forward.
At threshold 100 the reactor surfaces 9 pre-existing duplications (5 groups).
Two are genuinely extractable logic and are refactored away; the other three
are incidental or deliberately explicit and are baselined with // CPD-OFF
markers that each carry a per-site reason.
Refactored:
- check.ui ExtensionHelper guard chain: the identical isExtensionUpdateRequired
body in CheckValidatorExtensionHelper and CheckQuickfixExtensionHelper is
extracted to a shared isTargetClassExtensionUpdateRequired method on
AbstractCheckExtensionHelper (keyed on the existing getExtensionPointId() and
a new protected getTargetClassName() hook); the two helpers now delegate to
it. The base isExtensionUpdateRequired keeps its coarse extension-point check,
which the documentation helpers rely on via super; that subtree has no target
class, so it declares the getTargetClassName hook unsupported once in its
shared parent (AbstractCheckDocumentationExtensionHelper).
- xtext fingerprint featureIterable: the identical private helper in
AbstractFingerprintComputer and AbstractStreamingFingerprintComputer is
extracted to a shared package-private FingerprintFeatures utility.
Baselined (CPD-OFF, with reason):
- DispatchingCheckImpl: incidental token overlap (DI field + trace/try idiom),
not an extractable unit.
- ParameterListMatcherTest: explicit parameterized test cases, kept readable.
- AbstractValidationTest: test scaffolding; per-test clarity beats extraction.
Verified: check.ui and xtext compile; pmd:cpd-check is clean across the full
reactor at threshold 100.
Closes #1339
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent e882965 commit 9e73c19
12 files changed
Lines changed: 146 additions & 115 deletions
File tree
- com.avaloq.tools.ddk.check.runtime.core/src/com/avaloq/tools/ddk/check/runtime/issue
- com.avaloq.tools.ddk.check.ui/src/com/avaloq/tools/ddk/check/ui/builder/util
- com.avaloq.tools.ddk.typesystem.test/src/com/avaloq/tools/ddk/typesystem
- com.avaloq.tools.ddk.xtext.test.core/src/com/avaloq/tools/ddk/xtext/test/jupiter
- com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource
- ddk-parent
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| 128 | + | |
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
| |||
160 | 163 | | |
161 | 164 | | |
162 | 165 | | |
| 166 | + | |
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
| |||
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
47 | 61 | | |
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
150 | 185 | | |
151 | 186 | | |
152 | 187 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
| 163 | + | |
| 164 | + | |
164 | 165 | | |
165 | 166 | | |
166 | 167 | | |
| |||
Lines changed: 4 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
| 124 | + | |
124 | 125 | | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
| 129 | + | |
| 130 | + | |
139 | 131 | | |
140 | 132 | | |
141 | 133 | | |
Lines changed: 4 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
119 | 120 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
| 121 | + | |
| 122 | + | |
132 | 123 | | |
133 | 124 | | |
134 | 125 | | |
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
893 | 893 | | |
894 | 894 | | |
895 | 895 | | |
| 896 | + | |
896 | 897 | | |
897 | 898 | | |
898 | 899 | | |
| |||
946 | 947 | | |
947 | 948 | | |
948 | 949 | | |
| 950 | + | |
949 | 951 | | |
950 | 952 | | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
| 380 | + | |
380 | 381 | | |
381 | 382 | | |
382 | 383 | | |
| |||
398 | 399 | | |
399 | 400 | | |
400 | 401 | | |
| 402 | + | |
401 | 403 | | |
402 | 404 | | |
403 | 405 | | |
| |||
1002 | 1004 | | |
1003 | 1005 | | |
1004 | 1006 | | |
| 1007 | + | |
1005 | 1008 | | |
1006 | 1009 | | |
1007 | 1010 | | |
| |||
1012 | 1015 | | |
1013 | 1016 | | |
1014 | 1017 | | |
| 1018 | + | |
1015 | 1019 | | |
1016 | 1020 | | |
1017 | 1021 | | |
| |||
Lines changed: 3 additions & 44 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
24 | 22 | | |
25 | | - | |
26 | 23 | | |
27 | 24 | | |
28 | 25 | | |
29 | | - | |
30 | 26 | | |
31 | 27 | | |
32 | 28 | | |
| |||
209 | 205 | | |
210 | 206 | | |
211 | 207 | | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | 208 | | |
250 | 209 | | |
251 | 210 | | |
| |||
319 | 278 | | |
320 | 279 | | |
321 | 280 | | |
322 | | - | |
| 281 | + | |
323 | 282 | | |
324 | 283 | | |
325 | 284 | | |
| |||
370 | 329 | | |
371 | 330 | | |
372 | 331 | | |
373 | | - | |
| 332 | + | |
374 | 333 | | |
375 | 334 | | |
376 | 335 | | |
| |||
468 | 427 | | |
469 | 428 | | |
470 | 429 | | |
471 | | - | |
| 430 | + | |
472 | 431 | | |
473 | 432 | | |
474 | 433 | | |
| |||
Lines changed: 3 additions & 44 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | 16 | | |
19 | 17 | | |
20 | 18 | | |
21 | 19 | | |
22 | | - | |
23 | 20 | | |
24 | 21 | | |
25 | 22 | | |
26 | | - | |
27 | 23 | | |
28 | 24 | | |
29 | 25 | | |
| |||
133 | 129 | | |
134 | 130 | | |
135 | 131 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | 132 | | |
174 | 133 | | |
175 | 134 | | |
| |||
249 | 208 | | |
250 | 209 | | |
251 | 210 | | |
252 | | - | |
| 211 | + | |
253 | 212 | | |
254 | 213 | | |
255 | 214 | | |
| |||
306 | 265 | | |
307 | 266 | | |
308 | 267 | | |
309 | | - | |
| 268 | + | |
310 | 269 | | |
311 | 270 | | |
312 | 271 | | |
| |||
409 | 368 | | |
410 | 369 | | |
411 | 370 | | |
412 | | - | |
| 371 | + | |
413 | 372 | | |
414 | 373 | | |
415 | 374 | | |
| |||
0 commit comments