Recently i'm looking about the best tool set to do code inspection. My IDE is Intellij 15.0 and i know there is a good inspection capabilities there but when i look over the internet i didn't found good comparison between Intellij build-in inspection code and those three. Can someone that tried them all can give some best practice what to use? is Intellij cover all of them?
I know findbugs run in binary level but still let it stay in the comparison.
PMD, FindBugs and Checkstyle, are the most popular open-source code analyzers, they are extensively used in Java development to improve the codebase and identify potential vulnerabilities along with design flaws; every tool has its feature, purpose and strength, targeting a specific type of coding rules.
Code inspections In IntelliJ IDEA, there is a set of code inspections that detect and correct abnormal code in your project before you compile it. The IDE can find and highlight various problems, locate dead code, find probable bugs, spelling problems, and improve the overall code structure.
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.
IntelliJ IDEA allows you to inspect variables in a dedicated dialog. This is useful when you need to keep track of some variable (or the object whose reference it holds) and at the same time be able to navigate between frames and threads. Right-click a variable on the Variables tab and select Inspect.
In Checkstyle project itself, we use all of these tools: Checkstyle, PMD, FindBugs and IntelliJ IDEA inspections.
Here are my observations:
IntelliJ IDEA inspections are a great tool, as they contain lots of unique and reliable rules. And it's not only Java - you can out of the box detect problems in XML, Properties, SQL, Spring, HTML, CSS, etc. They require a lot of configuration and picking a right rule set though. Enabling all rules would report hundreds of thousands violations on every larger project. And it's hard to embed these inspections in Maven or Gradle build so that project is self-validating.
My recommendation is to make use of all of these tools, as each of them contains at least a dozen (sometimes dozen of dozens) of useful checks that are not available anywhere else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With