> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# analyzeApexCode

> Execute PMD Static code analyzer for apex classes. It will help you find common programming flaws like unused variables, empty catch blocks, unnecessa

Execute PMD Static code analyzer for apex classes. It will help you find common programming flaws like unused variables, empty catch blocks, unnecessary object creation, and many more.  This operation can be executed after build or before deployment on the artifact. You can provide a rule file to control what to check or use the default rule file. 

> [!NOTE]
>
> ### PMD
>
> This operation requires PMD tool on the endpoint. You can download it from [https://sourceforge.net/projects/pmd/files/pmd/](https://sourceforge.net/projects/pmd/files/pmd/).

# Target Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>PMD Path</td><td>`FDSF_PMD_PATH`</td><td>No</td><td>Path for the PMD install. (Eg: /u01/pmd-bin-6.30.0/bin)</td></tr></tbody></table>

# Project Properties

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Property Name**</th><th>**Property Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>PMD Rule File Name</td><td>`FDSF_PMD_RULE_FILE`</td><td>No</td><td>PMD Rule File with path. Default rules would be used, if not provided.  </td></tr></tbody></table>

# Inputs

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Input Name**</th><th>**Input Code**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>PMD Rule File Name</td><td>`FDSF_INP_PMD_RULE_FILE`</td><td>No</td><td>PMD Rule File with path.</td></tr><tr><td>Project Source Folder</td><td>`FDSF_INP_PROJECT_LOCATION`</td><td>No</td><td>Path to the project which contains a Apex classes. The project artifact is unzipped and used, if this value is not provided.</td></tr></tbody></table>

# Outputs

<table><colgroup><col /><col /><col /></colgroup><tbody><tr><th>**Output Name**</th><th>**Required**</th><th>**Description**</th></tr><tr><td>`FDSF_OUT_TOTAL_ISSUE_COUNT`</td><td>No</td><td>Total issues count</td></tr><tr><td>`FDSF_OUT_PRIORITY1_TOTAL_ISSUE_COUNT`</td><td>No</td><td>Total issues count for priority 1</td></tr><tr><td>`FDSF_OUT_PRIORITY2_TOTAL_ISSUE_COUNT`</td><td>No</td><td>Total issues count for priority 2</td></tr><tr><td>`FDSF_OUT_PRIORITY3_TOTAL_ISSUE_COUNT`</td><td>No</td><td>Total issues count for priority 3</td></tr><tr><td>`FDSF_OUT_PRIORITY4_TOTAL_ISSUE_COUNT`</td><td>No</td><td>Total issues count for priority 4</td></tr></tbody></table>

# Artifacts

This operation consumes artifacts from the artifacts repository.

# Endpoint Selection

This operation will select all available endpoints associated to the Target.

# Endpoint Execution

This operation will execute on any one of the selected endpoints and will be random in the determination of which one.
