During a code review of a Java application you find unused variables and empty catch blocks. Which build task setting do you recommend to detect these quality 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
The correct answer is "In a Maven build task, select Run PMD." PMD (Programming Mecca for Developers) is a static analysis tool that identifies common programming flaws like unused variables, empty catch blocks, duplicate code, and overly complex expressions in Java, JavaScript, and other languages. Integrating PMD into a Maven build allows for automated detection of these quality issues during the build process. "In an Xcode build task, select Use xcpretty from Advanced" is incorrect because xcpretty is a formatter for Xcode build output, not a static analysis tool for code quality. "In a Gulp build task, specify a custom condition expression" and "In a Grunt build task, select Enabled from Control Options" are incorrect because Gulp and Grunt are JavaScript task runners, and while they can be configured to run static analysis tools, these options alone do not specify a tool capable of detecting the described Java code quality 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