SONARJAVA-6711 USER-2405 Fix S3252 false positive for Quarkus Panache entity static methods - #5866
SONARJAVA-6711 USER-2405 Fix S3252 false positive for Quarkus Panache entity static methods#5866romainbrenguier wants to merge 1 commit into
Conversation
Panache uses bytecode generation to create static method implementations in entity subclasses, so accessing them via the derived type is the intended usage pattern. Skip the issue when the static member's owner is a Panache entity base class. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CI failed: The CI build failed due to an infrastructure outage (HTTP 503 Service Unavailable) when the SonarQube scanner attempted to query the server version.Overview1 log failure was analyzed across 1 job. The failure was entirely caused by an external infrastructure glitch where the SonarQube analysis server returned a 503 error. FailuresSonarQube Server Unavailable (confidence: high)
Summary
Code Review 👍 Approved with suggestions 0 resolved / 1 findingsFixes S3252 false positives for Quarkus Panache entity static methods by skipping checks on Panache entity base classes. Consider narrowing the isPanacheEntityBase scope so it doesn't suppress warnings for user-defined static members. 💡 Quality: Panache suppression broader than bytecode-generated methodsReply with isPanacheEntityBase(staticType) suppresses S3252 for any static member whose declaring type is a Panache entity base subtype — not only the framework-generated methods (listAll/count/etc.). A user-declared static method inherited from a Panache-derived class and accessed via a further subclass would also be silently skipped, introducing a false negative. This is acceptable for the fix but consider narrowing to the known Panache base classes themselves (e.g. checking the exact owner FQN) if tighter scoping is desired. 🤖 Prompt for agentsTip Comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
Panache uses bytecode generation to create static method implementations in entity subclasses, so accessing them via the derived type is the intended usage pattern. Skip the issue when the static member's owner is a Panache entity base class.
Part of