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..
-
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
-
1Have 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 Answers
Eclipse provides it as Markers
. It will provide all your cases except violating custom naming conventions
.

- 16,024
- 8
- 58
- 85
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.

- 4,190
- 10
- 49
- 75
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.

- 1,769
- 2
- 22
- 33
-
1agreed! 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
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]

- 13,645
- 3
- 40
- 67
I use combination of three tools which supplement each other: PMD, Checkstyle and FindBugs.

- 3,379
- 17
- 17