6

I am looking for eclipse/netbeans plugin or a tool, which analysis java project, and give us a report of unused imports, unused variables, unused methods, violating custom naming conventions, etc..

Nageswaran
  • 7,481
  • 14
  • 55
  • 74
  • Have you tried searching on stackoverflow? – Kai Sep 12 '12 at 12:52
  • @Surendhar For eclipse please have findbug pluging with you. Its really useful. – amod Sep 12 '12 at 13:01
  • 1
    Have a look a similar question is asked here. http://stackoverflow.com/questions/7321282/which-is-the-best-tool-for-finding-bugs-in-the-java-code – amod Sep 12 '12 at 13:04

8 Answers8

4

Eclipse provides it as Markers. It will provide all your cases except violating custom naming conventions.

enter image description here

Nandkumar Tekale
  • 16,024
  • 8
  • 58
  • 85
3

Findbugs works well as Eclipse plugin, and is easily customizable.

If you're looking for something bigger, or you work in a continous integration environment, I'd go for Sonar.

mrod
  • 772
  • 1
  • 6
  • 20
2

FindBugs is probably one of the most prominent ones and well worth a try.

For naming conventions etc, I'd suggest you have a look at CheckStyle.

amod
  • 4,190
  • 10
  • 49
  • 75
2

Netbeans 7.2 has a new Inspect feature: goto Source|Inspect from the menu. It certainly has most of the tests for mentioned in your question.

Steve
  • 1,769
  • 2
  • 22
  • 33
  • 1
    agreed! In combination with findbugs plugin its very usefull and capable of doing many common modification (like fixing imports) all over a project with some clicks. – ollo Sep 12 '12 at 12:56
2

... in addition look at sonar. It's been quiet the eye opener when I first discovered it.

vector
  • 7,334
  • 8
  • 52
  • 80
2

For the little things like naming conventions and imports, I agree with the other answers that PMD is a pretty good choice.

[shameless plug] This may be overkill, but there's a tool called "Codefacts" that the company that I work at developed, which will analyze your code from a git or svn repository. It runs metrics and stuff to assess code quality. It might fit into your "etc.."

I can't recall all of the metrics it uses, but some of them are things like comment/code ratio, documentation coverage, checking if a lot of your methods/classes are too long, and a bunch more. Codefacts can be downloaded here [/shameless plug]

Dylan
  • 13,645
  • 3
  • 40
  • 67
1

I use combination of three tools which supplement each other: PMD, Checkstyle and FindBugs.

korifey
  • 3,379
  • 17
  • 17
0

Try Checkstyle (my preference) or PMD.

Krzysztof Jabłoński
  • 1,890
  • 1
  • 20
  • 29