Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Interview: PMD Code Analyzer for NetBeans IDE

DZone's Guide to

Interview: PMD Code Analyzer for NetBeans IDE

· Java Zone
Free Resource

The single app analytics solutions to take your web and mobile apps to the next level.  Try today!  Brought to you in partnership with CA Technologies

Gianluca Costa is a software developer from Italy. Creating software is both his job and passion. His favorite areas of interest in the IT sector are software engineering, programming languages, and build infrastructures.

He's also the author of EasyPmd, a NetBeans plugin that can be downloaded here:

http://plugins.netbeans.org/plugin/52534/easypmd-4

Hi Gianluca. What is EasyPmd?

EasyPmd is a plugin that integrates the PMD code analyzer into NetBeans IDE.

In other words, it scans source files for violations of style rules that the developer has chosen to apply and reports the results both in the Action items window and in the code editor itself, so as to provide complete and updated monitoring.



(Click the image above to enlarge it.)

How is EasyPmd different to FindBugs and other similar tools?


EasyPmd enables developers to employ PMD within NetBeans IDE, which means that, for example, acquired knowledge such as custom rules and rule sets created for PMD in other contexts, such as Ant and Maven, can be easily reused in the visual environment of the IDE.

Furthermore, anyone interested in PMD can quickly try it out in NetBeans IDE using EasyPmd.

That said, the choice of tools mainly depends on the developer's personal preferences and on their business requirements.

Can you name some specific EasyPmd features that you are especially happy or proud of?

Apart from the basic idea around which EasyPmd revolves, that is, the centralized reporting of PMD violations and the glyphs shown next to code editor lines causing such violations, I'd say that my favourite features are:
  • Visual customization of rulesets and of the related classpath. EasyPmd enables you to add rulesets by letting you choose among the predefined ones provided by PMD, as well as to add your own rulesets. In this case, the management of the required classpath is greatly simplified by the visual user interface.
  • Regex-based scanning. One can tell EasyPmd which files to include into or exclude from scanning, on the basis of regular expressions. A predefined set of regexes, covering the most common cases, is provided, both as examples and to simplify the task.
  • Profiles. Developers can create as many profiles as they want, and every profile contains a fully-customized set of all the plugin options that can be changed just by switching to another profile.
  • Flexibility. EasyPmd's options let you configure both the underlying PMD engine and the plugin itself, for example, how violations are reported.


  • Speed and reliability. EasyPmd is fast, as it's based on a 2-level cache (both in memory and on disk), and it's becoming more and more robust, release after release.
How does one get started with EasyPmd?

EasyPmd should appear in the Available Plugins list in the NetBeans Plugin Manager in NetBeans IDE 7.4.



Furthermore, I have published a Getting Started Tutorial, currently in English and French, to explain in detail how to install EasyPmd and how to get started with it.

http://gianlucacosta.info/software/easypmd/?tab=tabs-videos

The videos above are shown in the videos section of EasyPmd's home page.

Finally, for those wishing to employ custom rulesets, I have updated the article " Writing custom rulesets for EasyPmd", which explains how to create a new ruleset and how to plug it into EasyPmd 4.

CA App Experience Analytics, a whole new level of visibility. Learn more. Brought to you in partnership with CA Technologies.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}