PMD SCA Settings

Updated 2 weeks ago by Copado Solutions

If your are using PMD, Copado includes a built-in rule sets which can be customized according to your needs.

In order to use these default rule sets, you will need to create Static Code Analysis Settings for PMD and add the required rule sets to these settings.

To create Static Code Analysis Settings for PMD follow the steps below:

  1. Log in to the Org where Copado is installed.
  2. Navigate to the Static Code Analysis Settings tab and then click on New to create a new record.
  3. Select PMD as record type.

  1. This will open a new Static Code Analysis Settings record.

  1. Fill in the New Static Code Analysis Settings Name field and click on Save.
  2. Open the Static Code Analysis Settings record you just created and click on Generate Default RuleSet.

By clicking on the Generate Default RuleSet button you are retrieving a total of 34 PMD rules that you can run to enforce code best practices.

  1. Click on Back to come back to your SCA record.

Once you have completed the steps above, add your static code analysis settings to your pipeline.

From now on, whenever you run a static code analysis from a User Story or an Org Credential record associated to an environment inside this Pipeline, it will take these SCA settings and will create a new Static Code Analysis Results record with the scan details.

Customize RuleSet

You can customize any RuleSet as required, add a new rule, edit it or delete an existing rule. Each rule has a priority within a 1 to 5 interval, and it  can be defined according to the relevance of the violated rule.

Notes:

  • A rule with priority 1 is considered as the most important rule and a rule with priority 5 as the least

Additional Reading

Run Static Code Analysis


How did we do?