Skip to content
David Renz edited this page May 27, 2016 · 31 revisions

How To Contribute

There is a lot of room for improvement or extension. Depending on what you want to do you eighter need to fork, extend and pull request this repository or the PMD repository.

Add or improve existing PMD rules

If you want to add rules that work similarly to the ones we already have you will have to extend PMD itsself. Check the PMD README.md to learn how to contribute.

Upgrade PMD version used by the engine

Contributions made to PMD will not be automatically used by the Code Climate engine. You have to replace the current build of PMD in the engine with new one. Those are the steps you need to do:

  1. Adjust the pom.xml of PMD to get a lean build of PMD only with the required Jars, we recommend you to use our pom.xml.

  2. Build PMD. Execute mvn clean packagein the root directory of PMD.

  3. Unzip the generated pmd-bin-5.5.0-SNAPSHOT.zip in the /pmd/pmd-dist/target directory.

  4. Fork the Apex Metrics engine.

  5. Replace the content of /codeclimate-apexmetrics/lib/pmd with the content of your unzipped pmd-bin-5.5.0-SNAPSHOT directory.

  6. Test and execute your custome engine locally or pull request you changes.

Add new engine component

Beside extending the underlying PMD framework people could also add totally new mechanisms to evaluate code. Code would then not only run through PMD but also through other internal components. Just imagine using the Tooling Api and then reporting back on usused code across class boundaries as implemented by Salesforce.com MVP Andrew Fawcett.

Clone this wiki locally