GS/BS
← Standards directory
Code quality

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.

PHP

Community rubric · v1

The evidence

Evidence coverage4 / 8
4 supported · 4 unresolved

One point for each verified check. Unknown means we still need evidence. Contrary evidence records an observed result that goes against the criterion.

Latest evidence review ·

  • Definition

    Verified

    The CyclomaticComplexity rule counts control-flow decisions plus method entry and compares that measure to the configured threshold.

    Cited source ↗
  • Measurement

    Verified

    The analyzer reports violations for a named ruleset, including a codesize example with structured XML results.

    Cited source ↗
  • Conformance

    Unknown

    No reviewed evidence is recorded for this dimension.

    What would demonstrate a violation? Contribute evidence ↗

  • CI enforcement

    Verified

    The documented exit contract distinguishes a clean scan (0), rule violations (2), and invocation failure (1).

    Cited source ↗
  • Getting started

    Unknown

    No reviewed evidence is recorded for this dimension.

    Can a newcomer complete a first run? Contribute evidence ↗

  • Real-world adoption

    Verified

    CodeRabbit’s Assertive profile runs the built-in codesize ruleset on PHP files. Its Chill profile checks unused code only.

    Cited source ↗
  • Agent guidance

    Unknown

    No reviewed evidence is recorded for this dimension.

    Can an agent act on a specific finding? Contribute evidence ↗

  • Agent portability

    Unknown

    No reviewed evidence is recorded for this dimension.

    Does the practice work in two agent harnesses? Contribute evidence ↗

Use this standard

Agent prompt

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.
Read the agent skill ↗

Primary source

PHPMD documentation ↗