Compatible with  IntelliJ IDEA
96 166
A plugin to run static analysis using PMD in intelliJ.

Download plugin

Recent change notes

Updated to support PMD 5.5.1

General usage instructions

PMD Plugin integrates PMD ( to intelliJ. It supports all the pre defined rulesets as well as custom rulesets. The user can run pmd on a single or set of files/folders and see the results in intelliJ. To run the predefined rulesets, go to Tools -> PMD -> PreDefined menu. PMD supports custom ruleset file, to configure goto settings -> PMD and add the rule set files that are required.
I get an error when I try to configure the plugin to use my ruleset: "The selected file is not a valid PMD ruleset: Couldn't find the class Can't find resource 'rulesets/ecmascript/basic.xml' for rule 'AssignmentOperand'. Make sure the resource is a valid file or URL and is on the CLASSPATH." then it lists my classpath. " Then it lists my classpath. I validated my ruleset with the xsd and it is valid. What should I add to my classpath or is this a bug?
Do you plan to add real-time scanning?
The plugin is updated to work with Idea 13. Please report any issues at instead of using the comments.
I guess it's about time to update the plugin :) Just ran it on IDEA 13, and that's what I got: java.lang.NullPointerException at com.intellij.plugins.bodhi.pmd.PMDProjectComponent.setupToolWindow( at com.intellij.plugins.bodhi.pmd.PMDInvoker.runPMD( at com.intellij.plugins.bodhi.pmd.PMDProjectComponent$1.actionPerformed( at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware( at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$ at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext( at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext( at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed( at javax.swing.AbstractButton.fireActionPerformed( at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed( at com.intellij.ui.plaf.beg.BegMenuItemUI.a( at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300( at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(
Hi again,

In the window with the PMD-results, I can see the description of the PMD-finding but I need the name if I want to place a @SuppressWarning on it. Now I have to google the description to find the name.

Maybe the name can be showed next to the description or as a tooltip?

Thank you for this plugin. It works fine but I have a few points (I have 11.0.1 Ultimate):
- Is ti possible to assign a hotkey to a custom ruleset?
- If I mark a violation in the PMD-Toolwindow, I can doubleclick to get to the sourcefile. However Enter or F4 does not take me there (I prefer to use the keyboard). As workaround I can set \"Autoscroll to source\" but that setting seems not persisted

Sorry for the delay - Updated Now to work with Idea 10+
Has not been updated for a long time - always fails with an Exception. Never managed to run it on IntelliJ 10.
Same exception here with IntelliJ IDEA 10.5.1
Great plugin! It's quite easy to use, and I haven't encountered any errors in it.
i have the same exception even after updating to idea 10.0.2
i have the same exception even after updating to idea 10.0.2
Looking for an update to avoid the null pointer on IDEA 10.1.

I use this tool as part of my daily workflow. Come on JetBrains, stop breaking plugins with new releases!!

Where the is author?
same exception here, IDEA 10.0.1
IntelliJ 10.0.1

Install plugin and restart IntelliJ

at com.intellij.plugins.bodhi.pmd.OpenApiAdapter.runMethod(
at com.intellij.plugins.bodhi.pmd.OpenApiAdapter.createCollapseAllAction(
at com.intellij.plugins.bodhi.pmd.PMDResultPanel.createActions(
at com.intellij.plugins.bodhi.pmd.PMDResultPanel.(
at com.intellij.plugins.bodhi.pmd.PMDProjectComponent.projectOpened(
at com.intellij.openapi.project.impl.ProjectImpl.c(
at com.intellij.openapi.project.impl.ProjectImpl.access$200(
at com.intellij.openapi.project.impl.ProjectImpl$MyProjectManagerListener.projectOpened(
at com.intellij.openapi.project.impl.ProjectManagerImpl$2.projectOpened(
at com.intellij.openapi.project.impl.ProjectManagerImpl.d(
at com.intellij.openapi.project.impl.ProjectManagerImpl.openProject(
at com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOpenProject(
at com.intellij.openapi.project.impl.ProjectManagerImpl.loadAndOpenProject(
at com.intellij.ide.impl.ProjectUtil.openProject(
at com.intellij.ide.RecentProjectsManager.doOpenProject(
at com.intellij.ide.RecentProjectsManagerBase$MyAppLifecycleListener.appStarting(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(
at com.intellij.util.messages.impl.MessageBusImpl.access$000(
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(
at $Proxy34.appStarting(Unknown Source)
at com.intellij.idea.IdeaApplication.b(
at com.intellij.idea.IdeaApplication.access$400(
at com.intellij.idea.IdeaApplication$IdeStarter$
at com.intellij.openapi.application.impl.LaterInvocator$
at java.awt.event.InvocationEvent.dispatch(
at java.awt.EventQueue.dispatchEvent(
at com.intellij.ide.IdeEventQueue.e(
at com.intellij.ide.IdeEventQueue._dispatchEvent(
at com.intellij.ide.IdeEventQueue.b(
at com.intellij.ide.IdeEventQueue.dispatchEvent(
at java.awt.EventDispatchThread.pumpOneEventForFilters(
at java.awt.EventDispatchThread.pumpEventsForFilter(
at java.awt.EventDispatchThread.pumpEventsForHierarchy(
at java.awt.EventDispatchThread.pumpEvents(
at java.awt.EventDispatchThread.pumpEvents(
Please  sign in  to leave a comment.