During a code review you find many issues such as unused variables and empty catch blocks. Which build task configuration should you recommend to detect these issues?
Choose an answer
Tap an option to check your answer.
Correct answer: In a Maven build task, select Run PMD..
Why this is the answer
PMD is a static analysis tool that identifies common programming flaws like unused variables, empty catch blocks, duplicate code, and potential bugs. Integrating PMD into a Maven build task allows for automated code quality checks during the build process, ensuring these issues are caught early. While Checkstyle (often used with Gradle) focuses more on coding style and conventions, and xcpretty (for Xcode) is a formatter for build output, PMD specifically targets code quality and potential errors. Grunt is a JavaScript task runner and doesn't inherently offer a direct equivalent for this type of static analysis without additional plugins. Therefore, running PMD within a Maven build is the most direct and effective way to detect the described issues.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed