# PHPMD

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.

Category: Code quality
Languages: PHP

## Standard evidence

Rubric v1 · 4/8 verified · 4 unknown · 0 contrary · reviewed 2026-11-28

- **Definition** (verified) — The CyclomaticComplexity rule counts control-flow decisions plus method entry and compares that measure to the configured threshold. Reviewed 2026-11-28. [Source](https://phpmd.org/rules/codesize.html)
- **Measurement** (verified) — The analyzer reports violations for a named ruleset, including a codesize example with structured XML results. Reviewed 2026-11-28. [Source](https://phpmd.org/documentation/index.html)
- **Conformance** (unknown) — No reviewed evidence is recorded for this dimension.
- **CI enforcement** (verified) — The documented exit contract distinguishes a clean scan (0), rule violations (2), and invocation failure (1). Reviewed 2026-11-28. [Source](https://phpmd.org/documentation/index.html)
- **Getting started** (unknown) — No reviewed evidence is recorded for this dimension.
- **Real-world adoption** (verified) — CodeRabbit’s Assertive profile runs the built-in codesize ruleset on PHP files. Its Chill profile checks unused code only. Reviewed 2026-11-28. [Source](https://docs.coderabbit.ai/tools/phpmd)
- **Agent guidance** (unknown) — No reviewed evidence is recorded for this dimension.
- **Agent portability** (unknown) — No reviewed evidence is recorded for this dimension.

## Adoption

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.

Seikika package: no verified installation is listed.

## References

- [Tool documentation](https://phpmd.org/)
- [Agent skill](/skills/phpmd/SKILL.md)
