> ## 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.

# analyzeCode(PMD)

> Execute PMD Static code analyzer on source code. It will help you find common programming flaws like unused variables, empty catch blocks, unnecessary

Execute PMD Static code analyzer on source code. 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 the 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 will install PMD for you if you like. Otherwise, you can download other versions 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><td>**Property Name**</td><td>**Property Code**</td><td>**Required**</td><td>**Description**</td></tr><tr><td>PMD Path</td><td>`FDPMD_PATH`</td><td>No</td><td>Absolute path to PMD bin folder containing run.sh and pmd.bat(Eg: /u01/pmd/pmd-bin-6.46.0/bin)If this value is empty, then the plugin will install PMD v7.19.0 on end point (as of FlexDeploy 9.0.0.12)</td></tr></tbody></table>

# Project Properties 

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><td>**Property Name**</td><td>**Property Code**</td><td>**Required**</td><td>**Description**</td></tr><tr><td>PMD Rule File Names</td><td>`FDPMD_RULE_FILE`</td><td>No\*</td><td>Rule File Name(s). Specify multiple PMD Rule Files separated commas. Relative paths are in respect to FD\_TEMP\_DIR but absolute path can also be set.\* `FDPMD_RULE_FILE` or `FDPMD_INP_PMD_RULE_FILE` must be configured OR `FDPMD_LANG_TYPE` must be configured to default a rule set file.</td></tr><tr><td>Language Type</td><td>`FDPMD_LANG_TYPE`</td><td>No</td><td>Select this to define what language PMD will use to test.(This Property is mandatory if No custom Ruleset provided. )</td></tr></tbody></table>

# Inputs

<table><colgroup><col /><col /><col /><col /></colgroup><tbody><tr><th>**Input Name**</th><td>**Input Code**</td><td>**Required**</td><td>**Description**</td></tr><tr><th>PMD Rule File Names</th><td>`FDPMD_INP_PMD_RULE_FILE`</td><td>No\*</td><th>Rule File Name(s). Specify multiple PMD Rule Files separated commas. Relative paths are in respect to FD\_TEMP\_DIR but absolute path can also be set.\* `FDPMD_RULE_FILE` or `FDPMD_INP_PMD_RULE_FILE` must be configured OR `FDPMD_LANG_TYPE` must be configured to default a rule set file.</th></tr><tr><th>Project Source Folder</th><td>`FDPMD_INP_PROJECT_LOCATION`</td><td>No</td><td>Path to the project. If a relative path is given, a path inside of the FD\_TEMP\_DIR will be assumed.</td></tr><tr><th>Additional arguments</th><td>`FDPMD_INP_ADDITIONAL_ARGS`</td><td>No</td><td>Additional Arguments to pass to the PMD CLI such as options, output formats, and supported languages.[[https://pmd.github.io/pmd/pmd\_userdocs\_cli\_reference.html#options](https://pmd.github.io/pmd/pmd_userdocs_cli_reference.html#options)](https://pmd.github.io/pmd/pmd_userdocs_cli_reference.html#options)ex: --debug,--use-version \<lang-version></td></tr></tbody></table>

# Outputs

<table><colgroup><col /><col /><col /></colgroup><tbody><tr><th>**Output Name**</th><td>**Required**</td><td>**Description**</td></tr><tr><th>`FDPMD_OUT_TOTAL_ISSUE_COUNT`</th><td>No</td><td>Total issues count</td></tr><tr><th>`FDPMD_OUT_PRIORITY1_TOTAL_ISSUE_COUNT`</th><td>No</td><th>Total issues count for priority 1</th></tr><tr><th>`FDPMD_OUT_PRIORITY2_TOTAL_ISSUE_COUNT`</th><td>No</td><td>Total issues count for priority 2</td></tr><tr><td>`FDPMD_OUT_PRIORITY3_TOTAL_ISSUE_COUNT`</td><td>No</td><td>Total issues count for priority 3</td></tr><tr><th>`FDPMD_OUT_PRIORITY4_TOTAL_ISSUE_COUNT`</th><td>No</td><td>Total issues count for priority 4</td></tr></tbody></table>

# Artifacts

This operation doesn't produce any artifacts.  

# Endpoint Selection

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

# Endpoint Execution

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