This extension integrates PHP Mess Detector (PHPMD) with Visual Studio Code using DDEV as the runtime environment. It provides real-time code quality analysis for PHP projects running in DDEV containers.
- Real-time PHP code analysis using PHPMD through DDEV
- Configurable validation triggers (on save or on type)
- Customizable PHPMD rulesets and severity levels
- Automatic DDEV project detection
- Problems panel integration with clickable issue links
- VS Code 1.100.0 or higher
- DDEV project with running container
- PHPMD installed in your DDEV container
Install the extension from the VS Code Marketplace or search for "DDEV PHPMD" in VS Code's extension panel.
Install PHPMD in your DDEV container:
ddev composer require --dev phpmd/phpmd
- Open a DDEV project in VS Code
- The extension automatically analyzes PHP files when you save them
- Issues appear in the Problems panel and are highlighted in the editor
- Click on issues to view detailed information and external documentation
Key settings in VS Code preferences:
ddev-phpmd.enable
: Enable/disable the extensionddev-phpmd.validateOn
: When to validate ("save"
or"type"
)ddev-phpmd.rulesets
: PHPMD rulesets to useddev-phpmd.configPath
: Path to custom PHPMD configuration file
GPL-3.0 License. See LICENSE for details.