Sample app to test apex static code analysis tools.
First, install PMD by running:
cd $HOME
curl -OL https://github.com/pmd/pmd/releases/download/pmd_releases%2F6.15.0/pmd-bin-6.15.0.zip
unzip pmd-bin-6.15.0.zip
alias pmd="$HOME/pmd-bin-6.15.0/bin/run.sh pmdThen the analysis can be triggered with:
pmd -d . -R apex_ruleset.xml -f xml -reportfile pmd-report.xml -l apexAs SonarCloud does not support Apex language, an attempt to use SonarCloud as other tools collector is done. A PMD analysis is triggered in TravisCI and exported to SonarCloud by specifiying 'sonar.java.pmd.reportPaths=./pmd-report.xml' in the sonar-project.properties.
TravisCI builds: https://travis-ci.org/asolfre/apex-static-analysis-sample/builds/