On this page:
Mess Detector Page
for Windows and Linux
The page is available only when the PHP plugin is enabled. The plugin is activated by default. If the plugin is disabled, enable it on the Plugins page as described in Enabling and Disabling Plugins.
On this page, choose the Mess Detector script to use.
| Item || Description |
| Configuration || From this drop-down list, choose the script to use: |
- To use the script associated with a specific remote PHP interpreter, choose the name of this interpreter.
- To use the script associated with the default project interpreter, that is, the one chosen on the PHP page of the Settings dialog box, choose By default project interpreter.
- To use a local script, choose Local. In this case the local Mess Detector will be executed no matter which PHP interpreter - local or remote - is used in the project. Note that there can be only one Local configuration for Mess Detector because PhpStorm runs a script (
phpmd.bat for Windows or
phpmd for Linux) which contains a path to a PHP engine.
| Ignored files || This area displays a list of files that Mess Detector skips. PhpStorm suggests adding a new file to the list during inspection when waiting for response from the Mess Detector exceeds the limit specified in the Tool process timeout field. This is done to prevent slowing down processing. For each file, PhpStorm displays its name and location. |
- To delete a file from the list and have Mess Detector process it again, select the file and click the Remove file button .
- To remove all the files from the list, click the Clean the list button .
Mess Detector Dialog
The dialog box opens when you click next to the Configuration drop-down list on the Mess Detector page.
Use this dialog box to configure local Mess Detector scripts, scripts associated with remote PHP interpreters, see PHP Mess Detector, and configure Mess Detector's behaviour.
The left-hand pane of the dialog box shows all the configured Mess Detector scripts, one of them is of the type Local, and others are named after the remote PHP interpreters with which the scripts are associated. When you select a configuration, the right-hand pane shows its details.
- To configure or edit the Local script, select Local and specify the location of
phpmd in the PHP Mess Detector path field.
- To configure a new script associated with a remote PHP interpreter:
- Click on the toolbar.
- In the Mess Detector by Remote Interpreter dialog box that opens, choose the remote PHP interpreter to use the associated script from. If the list does not contain a relevant interpreter, click and configure a remote interpreter in the CLI Interpreters dialog box as described in Configuring Remote PHP Interpreters.
When you click OK, PhpStorm brings you back to the Mess Detector dialog box where the new Mess Detector configuration is added to the list and the right-hand pane shows the chosen remote PHP interpreter, the path to the Mess Detector associated with it, and the advanced PHP Mess Detector options.
| PHP Mess Detector (phpmd) Path || In this text box, specify the location of the Mess Detector utility |
phpmd.bat.If the script is associated with a PHP interpreter, PhpStorm detects the path to it and fills in the field automatically but you can edit it if necessary.
In either case, type the path manually or click the Browse button and select the path in the dialog box, that opens.
To check that the specified path to
phpmd ensures interaction between PhpStorm and Mess Detector, that is, the tool can be launched from PhpStorm and PhpStorm will receive problem reports from it, click the Validate button. This validation is equal to running the
phpmd --version command. If validation passes successfully, PhpStorm displays the information on the detected Mess Detector version.
| Interpreter || The field shows the chosen PHP interpreter to use the Mess Detector from. |
| Maximum number of messages per file || In this text box, set the upper limit for the total number of messages to be reported for a file. All the messages above this limit will be rejected. PhpStorm will display the following warning right in the code: |
Too many PHP Mess Detector messages and suggest adding the file to the Ignored files list.
| Tool process timeout || In this text box, specify how long you want PhpStorm to wait for a result from PHP Mess Detector, whereupon the process is killed to prevent excessive CPU and memory usage. This gives you the capability to fine tune the PHP Mess Detector process behavior depending on the configuration of your computer and the rule sets used. |
Last modified: 21 August 2017