Commit 43f21ab
[refactor] Reduce complexity of XQ4 coercion checks flagged by Codacy
Simplify DynamicTypeCheck.isXQ4ImplicitCast to a single boolean return, dropping
the xs:double/xs:float to xs:decimal cases already subsumed by the any-numeric to
any-numeric rule; collapse the boolean return in isXQ4Relabeling; and extract the
XQuery 4.0 coercion disjunct in Function.checkArgumentType into an
isXQ4CoercionAllowed helper so it no longer inflates that method's condition. No
behavior change; the full XQuery3Tests suite (including the XQ4 type-promotion
tests) still passes.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 50130c3 commit 43f21ab
2 files changed
Lines changed: 25 additions & 32 deletions
Lines changed: 13 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 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 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
243 | 228 | | |
244 | 229 | | |
245 | 230 | | |
| |||
255 | 240 | | |
256 | 241 | | |
257 | 242 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
264 | 246 | | |
265 | 247 | | |
266 | 248 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
312 | | - | |
| 312 | + | |
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
333 | 344 | | |
334 | 345 | | |
335 | 346 | | |
| |||
0 commit comments