-
Notifications
You must be signed in to change notification settings - Fork 11
Static Analyze
For use pmd static analyzer in pom.xml added maven-pmd-plugin and use rulesets. This plugin add goal pmd:check and run it when maven execute build. Result of checks you can see in {project_base_dir}/{module_dir}/target/site/pmd.html.
For IntelliJ exist pmd integration plugin. You can install it from standard repository.
- Open "File" -> "Settings" -> "Plugins" and press button "Browse repositories...".
- Type "pmd" in the search string.
- Select and install "PMDplugin" plugin.
- Restart IntelliJ
After restart IDE you can add ruleset to PMD setting.
- Open "File" -> "Settings"
- Type "pmd" in the search string.
- Select "Other Settings" -> "PMD" in the tree view.
- On the tab "RuleSets" press "+" for add new rulesset.
- In a opened dialog press button "Browse" and select file doc/codestyle/codepmd.xml and press "OK"
- In the tab "Options" set value "Target JDK" equals 1.8 and "Encoding" equals "UTF-8".
- Press button "Apply" and "OK".
For run checking code use PMD static analyzer from IntelliJ, you should select in "Project view" some project or packet or file and press right mouse button. In the opened menu select "Run PMD" -> "Custom rules" -> "pmd". After PMD is end work of check code IDE open "PMD view" in the footer windows area. In this view you can see issue in the your code and have navigation to problem code block.
© 2018, ariADDna project