check
Run static analysis on the Java project — detects configured tools (Checkstyle, SpotBugs, PMD) and reports findings
/java-core:check
Run static analysis and code quality checks on the project.
Instructions
-
Detect configured tools by scanning
pom.xmlorbuild.gradlefor:- Checkstyle (
maven-checkstyle-plugin/checkstyleplugin) - SpotBugs (
spotbugs-maven-plugin/com.github.spotbugs) - PMD (
maven-pmd-plugin/pmdplugin) - SonarQube (
sonar-maven-plugin/sonarqubeplugin)
- Checkstyle (
-
Run available tools:
- Maven:
mvn checkstyle:check,mvn spotbugs:check,mvn pmd:check - Gradle:
./gradlew checkstyleMain,./gradlew spotbugsMain,./gradlew pmdMain
- Maven:
-
If no tools configured:
- Run a manual review of the current file or recent changes using
/java-core:java-review - Suggest adding Checkstyle to
pom.xmlorbuild.gradle
- Run a manual review of the current file or recent changes using
-
Report findings grouped by severity:
- CRITICAL / HIGH: Show file:line, rule name, and description
- MEDIUM / LOW: Summarize counts by category
-
If findings exceed 10 items, show the top 10 by severity and summarize the rest.