5

Can anybody point me to Netbeans plugins that help do better code? I hope to find some plugins that do Java code review and search for:

  • bug patters
  • duplicate code
  • and other types of vulnerabilities.

Thanks!

lpinto.eu
  • 2,077
  • 4
  • 21
  • 45

4 Answers4

1

Install EasyPMD from the plugin portal. http://plugins.netbeans.org/plugin/33246/easypmd-2-1

Alan Burlison
  • 1,022
  • 1
  • 9
  • 16
1

How about Findbugs.

Never used it with Netbeans (only with HudsonBuilder), but some Google results state that there is a plugin for NB.

Matt Handy
  • 29,855
  • 2
  • 89
  • 112
  • I'm not sure how up-to-date the FindBugs plugin is, it certainly doesn't appear in the standard list of plugins provided by the NB plugin portal whereas EasyPMD does, which is why I suggested it :-) – Alan Burlison Sep 15 '11 at 14:14
1

Several of the PMD and Findbugs rules (suggested by others) are already part of the regular "Hints" of Netbeans. By enabling more than the standard set of hints, you can already get some good "programming advices" without having to install anything.

(But they are by no means a complete replacement for PMD or Findbugs)

0

There is an article about integrating plugins you could try to follow that (I haven't yet), but from my experience sadly in IDE tools never work as well as the commandline versions.

I would recommend you instead use Maven as your build tool and add the Cobertura, FindBugs, PMD, and CheckStyle plugins that will produce reports whenever you compile your code. Not as handy, but you will still get good feedback.

Also, this means that they will be equally available for people working on your code base with other IDEs. If you use a continuous integration server like Jenkins and it will create a report using any tool you'd like whenever you check-in code.

And this is speaking as someone who prefers NetBeans over Eclipse.

Sled
  • 18,541
  • 27
  • 119
  • 168
  • added link and a comment about **why** you might not want to take that approach, which is just different then posting "use tool X", but you are entitled to vote as you see fit. – Sled Sep 15 '11 at 14:12
  • Even so using the findbugs stand alone program and including the source will still give you more instant information then using Maven to get back reports. – Lyrion Sep 15 '11 at 14:18
  • Maven is imho the best way to integrate that information into your workflow. Especially with Jenkins where you can see reports for the number of warnings over time etc. – Sled Sep 15 '11 at 14:19
  • The linked article, really is a good reference, and is the most complete resource of all the answers, since refers 4 "quality code" plugins, all in one bundle. – lpinto.eu Sep 22 '11 at 21:57