---
name: phpmd
description: "Use when adopting PHPMD to assess this standard: Limit complexity in PHP methods"
---

# Apply PHPMD

Check method size, coupling and unused code with explicit thresholds. Use a flagged method to decide whether extraction improves its responsibilities.

## Procedure

1. Inspect the repository configuration and identify the files or targets covered by PHPMD.
2. Use PHPMD in this repository to meet this standard: Limit complexity in PHP methods. Check method size, coupling and unused code with explicit thresholds. Use a flagged method to decide whether extraction improves its responsibilities. Inspect the repository configuration, record the baseline and exact reproduction steps, then add the smallest repeatable check that detects a regression.
3. Record the tool version, configuration, scope and findings. Explain any checks that could not run.
4. Use the same invocation after changes and compare the evidence against the baseline.

Refer to [the upstream documentation](https://phpmd.org/) for configuration and prerequisites.
