PMD is an excellent tool for code checking of Java programs. It can check whether the Java code contains unused variables, whether they contain empty fetch blocks, whether they contain unnecessary objects, and so on.
But in the course of use, you will find that there are a lot of error and warning in the PMD plugin, although PMD encourages programmers to improve them and write clean code, but it also creates a lot of annoying feelings. More importantly, you may have overlooked real errors and problems in Java code. Below we will check the code by configuring it in Eclipse only in the selected resource.
The first step is to select the problems tag in Eclipse.
The second step, in the top right corner of the Problems tab,
In the third step, in the popup dialog box, uncheck " Show all Items".
Fourth step, direct.
Fifth step, click on the "OK" button. Once set, the PMD error or warning will only appear in the Problems tab if you select the item, directory, or file.
Pmd-java Code checking tool configuration for error and warning