PMD - Eclipse plugin - no testing against any rules

I use Eclipse Juno (Service Release 1) and installed the latest PMD plugin from http://sourceforge.net/projects/pmd/files/pmd-eclipse/update-site/ I can configure the plugin and choose which rules should be followed, but unfortunately no rules are checked. If I click the "Verify Code" button in the PMD submenu, a dialog box will appear with the inscription "Verify with 0 from xxx rules"

What needs to be configured and where to enable functionality? On the console, PMD is working fine.

+4
source share
3 answers
  • Preferences → PMD (please do not search for PMD in the search bar, then you cannot find the rule configuration that can be found by scrolling through each preference).
  • Select the required rules.
  • Click "Apply" and "OK" (it will rebuild the rules).
  • Now right click the code and select PMD-> code Check
+8
source

Check if PMD is enabled in the project properties.

+2
source

If you go to the Eclipse Preferences → PMD → Rule settings and uncheck the box and double-check all the checkboxes for the rules and click “Apply”, the Eclipse Rules Settings dialog box will appear. Do you want to make a complete overhaul? "

If yes, try using PMD to check this code

public class BadClass { public void badMethod() { try { String bad = ""; } catch (Exception e) { } } } 

This should display many PMD errors. If this is not the case, can you find the pmd-eclipse.log file in the Eclipse directory and publish its contents?

A screenshot of my PMD config

+1
source

All Articles