In this section:
Introduction
Parasoft supports PHP by integrating with PHP Mess Detector (PHPMD), an easy-to-configure front-end for the raw PHP Depend metrics. PHPMD checks PHP source code for several potential problems, such as, possible bugs, suboptimal code, overcomplicated expressions, and unused parameters, methods, and properties. Visit the PHPMD website for additional information: https://phpmd.org.
The Parasoft PHPMD extension processes the PHPMD result file, generates reports showing violations and severities for the code authors, and sends the data to Parasoft DTP. DTP presents the data in widgets, reports, and other interfaces that enable you to prioritize violations, place them into remediation workflows, and monitor progress toward improving the code quality.
Requirements
- PHPMD version 2.10.2 is currently supported
- PHPMD should be installed and successfully running analysis.
Usage
- If you have not already done so, execute PHPMD, outputting the results to an XML file.
- Open a command prompt and navigate to the Multi-Language Pack installation directory.
- Execute the multilanguage-pack.bat or multilanguage-pack.sh script with the required parameters all on one line, e.g.:
multilanguage-pack.sh -tool phpmd -results.file "c:\YourProject\phpmd-results.xml" -source.dir "C:\YourProject\src"
Internal technical log files from the Multi-Language Pack execution are generated in the <INSTALL>/.mlp subdirectory.
Required Parameters
The following parameters are required.
tool
This setting specifies the Parasoft extension to execute. Use -tool
phpmd
to run the PHPMD extension.
results.file
This settings specifies the path to the XML file containing PHPMD execution results.
source.dir
This parameter specifies the path to the source code of the project under test. This is used to collect source control metadata (e.g., authorship, last updated, etc.) for DTP reporting and processing.