On the command line you can pass a category for a given language (here apex) to pmd
// best practice
pmd check -d C:\src\ -f html -R category/apex/bestpractices.xml -r C:\src\best.html
// security
pmd check -d C:\src\ -f html -R category/apex/security.xml -r C:\src\security.html
// error prone
pmd check -d C:\src\ -f html -R category/apex/errorprone.xml -r C:\src\errorprn.html
You can also combine the categories
pmd check -d C:\src\ -f html
-R category/apex/bestpractices.xml,
category/apex/codestyle.xml, category/apex/design.xml,
category/apex/documentation.xml, category/apex/errorprone.xml,
category/apex/performance.xml, category/apex/security.xml
-r C:\src\PMD_Report_all_categories.html
The categories available for a language can be found by unpacking the jar file for your language below ...\pmd-bin-7.0.0-rc3\lib
.
I could not find any rules for c
- neither on the page 3rd party rulesets
- nor below Making rulesets any page for a language specific rule
- i could not match any files below the folder
pmd-bin-7.0.0-rc3\liblib
to c (see screen)
