# Enable SCA Apex PMD validation criteria.

The **org administrator** can define global validation criteria to enforce Static Code Analysis (SCA) tools such as Apex PMD across CI jobs, gated commits, and merge jobs. Based on the priority set, the build will be successful only if the criteria are met.

Before you set the SCA criteria, ensure the following:

* Apex PMD is integrated with ARM.
* You are an **org administrator** or have the privilege to access the **My Account** page.

## How to set the Apex PMD criteria? <a href="#how-to-set-the-apex-pmd-criteria" id="how-to-set-the-apex-pmd-criteria"></a>

1. Log into the ARM account.
2. Go to **Admin > My Account**.
3. Go to **Validation Criteria - Static Code Analysis** section and select the **Enable Validation Criteria - SCA** checkbox.
4. Select **ApexPMD** and now set the priorities for it.
5. In the screenshot below, the **Priority-3** is set to **greater** than **5**, which means if **Priority-3** related errors are more than **5**, it should **pass**, or else it will **fail**.\
   This means if **Priority-3** related errors are more than 5, it should pass, or&#x20;

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FJSFbGv3r6a2PLVQs64uV%2Fimage.png?alt=media&#x26;token=7b37f7d9-d472-43b8-86ad-9f2b1510dbbd" alt=""><figcaption></figcaption></figure>

6. Click **Save** to save the changes.
7. Now, go to the **Commit Validation - Approval Settings** section. You can enforce the SCA criteria to run for all commits before being merged to the version control branch.
8. Select the **Enable criteria-based Review Process** checkbox.
9. Enable the second checkbox, i.e., **Should pass validation criteria for Static Code Analysis** checkbox.
10. Choose **ApexPMD**.
11. Select the **Auto reject commit process if the criteria are not met** checkbox to auto-reject the commit if the set standards are not met *(as mentioned in Step-2)*.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FGeXYqY3WhmzpE0z5Vx1k%2Fimage.png?alt=media&#x26;token=84be71e8-b285-417d-ab5c-e797cc35ef09" alt="" width="486"><figcaption></figcaption></figure>

12. Click **Save**.

In the below screenshot, the SCA criteria were fulfilled *(Priority-3 should be greater than 5)*, and the validation commit was moved to the **Approved** state as expected.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FVd7emZc0AokpjizXA7Gl%2Fimage.png?alt=media&#x26;token=a7b3a3cb-39ea-481b-a865-773f3e8688c9" alt="" width="519"><figcaption></figcaption></figure>
