peter-toth commented on code in PR #857:
URL: 
https://github.com/apache/spark-kubernetes-operator/pull/857#discussion_r4063652776


##########
spark-operator/src/main/java/org/apache/spark/k8s/operator/kueue/KueueWorkloadUtils.java:
##########
@@ -60,6 +60,7 @@
 
 /** Utilities to create, check and release Kueue Workloads. */
 @Slf4j
+@SuppressWarnings("PMD.GodClass")

Review Comment:
   **Finding 8.** #858 makes this annotation a build failure rather than a 
leftover, because `config/pmd/ruleset.xml` excludes a long list of design rules 
but **not** `UnnecessaryWarningSuppression`.
   
   That is why #858 has to remove the two annotations it touches — and it 
cannot reach this one, since `KueueWorkloadUtils` only grows it here. `git 
merge-tree` says the two PRs merge cleanly, so nothing warns about it.
   
   I materialised the merge (this head, plus #858's `ruleset.xml` and its two 
annotation removals) and ran `./gradlew :spark-operator:pmdMain`:
   
   ```
   KueueWorkloadUtils.java:63:  UnnecessaryWarningSuppression:  Unnecessary 
@SuppressWarnings annotation
      > 1 PMD rule violations were found.
   BUILD FAILED
   ```
   
   Both orders break, symmetrically. If #858 lands first, this PR's PMD gate 
fails on rebase. If this one lands first, #858's does, since its diff has no 
hunk for this file.
   
   The cheapest resolution is to land #858 first and drop the annotation from 
this PR on the rebase — the rule is gone, so nothing needs suppressing and 
nothing needs relocating. If you would rather keep this PR's order, then #858 
needs a third hunk for this file.
   
   For the record, since the suppression reads as forced: without it the class 
reports `GodClass: Possible God Class (WMC=47, ATFD=78, TCC=7.692%)`, and 47 is 
exactly PMD's threshold, so `retryAfterRequestFailure` is the single unit that 
crosses it. I did try moving that method into a small `KueueAdmissionFailures` 
class in the same package — PMD then passes with no suppression anywhere, and 
the rest of the gate and all 333 tests pass. Not worth doing now that the rule 
is being excluded, but it means the choice was never "suppress or fail".
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to