PHPackages                             csoellinger/silverstripe-phpmd - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. csoellinger/silverstripe-phpmd

ActiveSilverstripe-vendormodule[Validation &amp; Sanitization](/categories/validation)

csoellinger/silverstripe-phpmd
==============================

Extended mess detection rules from phpmd for SilverStripe applications.

v1.1.1(4y ago)07MITPHPPHP ^7.4 || ^8.0

Since Jun 13Pushed 4y agoCompare

[ Source](https://github.com/CSoellinger/silverstripe-phpmd)[ Packagist](https://packagist.org/packages/csoellinger/silverstripe-phpmd)[ Docs](https://github.com/CSoellinger/silverstripe-phpmd)[ RSS](/packages/csoellinger-silverstripe-phpmd/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (13)Versions (5)Used By (0)

PHPMD rules for SilverStripe
============================

[](#phpmd-rules-for-silverstripe)

[![Build Status](https://camo.githubusercontent.com/9bbdad39bfea67f310479accec0fc7224e37486c736c4b5517f96bbf8a60099f/68747470733a2f2f6170702e7472617669732d63692e636f6d2f43536f656c6c696e6765722f73696c7665727374726970652d7068706d642e7376673f6272616e63683d6d61696e)](https://app.travis-ci.com/CSoellinger/silverstripe-phpmd)

This repo was heavily inspired and forked from

Extended mess detection rules from phpmd for SilverStripe () applications.

The rules make it easier for developers to comply with the SilverStripe Coding Conventions: [https://docs.silverstripe.org/en/4/contributing/php\_coding\_conventions/](https://docs.silverstripe.org/en/4/contributing/php_coding_conventions/)

It uses mostly standard PHPMD rules, with a few notable changes:

- Excluded `CleanCode/StaticAccess`: Static access is a "feature" in SilverStripe
- Replaced `CamelCaseMethodName` with `CamelCaseInstanceMethodName`: Static methods with named snake case a "feature" in SilverStripe.
- Replaced `CamelCasePropertyName` with `CamelCaseInstancePropertyName`: Static properties with snake case are a "feature" in SilverStripe.
- Replaced `CamelCaseVariableName` with `CamelCaseInstanceVariableName`: Static variable calls with snake case are a "feature" in SilverStripe.
- Replaced `UnusedPrivateField` with `UnusedInstancePrivateField`: Check to instance fields only. Unused private statics are by design in SilverStripe.
- Fixed short name variable rule for $db, $id und $i
- Added class name check cause by SilverStripe design class name should match the file name

Installation
------------

[](#installation)

Global installation for usage across projects:

```
composer global require csoellinger/silverstripe-phpmd

```

Local installation on an existing project:

```
composer require --dev csoellinger/silverstripe-phpmd

```

Usage
-----

[](#usage)

For global installations:

```
~/.composer/vendor/bin/phpmd  text ~/.composer/vendor/csoellinger/silverstripe-phpmd/silverstripe-ruleset.xml

```

For local installations:

```
vendor/bin/phpmd  text vendor/csoellinger/silverstripe-phpmd/silverstripe-ruleset.xml

```

For more details, refer to the [command line usage](http://phpmd.org/documentation/index.html) guides on phpmd.org.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~7 days

Total

3

Last Release

1513d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17972547?v=4)[CSoellinger](/maintainers/CSoellinger)[@CSoellinger](https://github.com/CSoellinger)

---

Top Contributors

[![Zerogiven](https://avatars.githubusercontent.com/u/389319?v=4)](https://github.com/Zerogiven "Zerogiven (30 commits)")[![chillu](https://avatars.githubusercontent.com/u/111025?v=4)](https://github.com/chillu "chillu (8 commits)")

---

Tags

phpmdmess detectionsilverstripecode qualityrulesextendsclean code

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/csoellinger-silverstripe-phpmd/health.svg)

```
[![Health](https://phpackages.com/badges/csoellinger-silverstripe-phpmd/health.svg)](https://phpackages.com/packages/csoellinger-silverstripe-phpmd)
```

###  Alternatives

[mi-schi/phpmd-extension

Contains extra phpmd rules from clean code book and the best practices of my experiences.

40928.6k5](/packages/mi-schi-phpmd-extension)[ruler/ruler

A simple stateless production rules engine for modern PHP.

1.1k850.5k4](/packages/ruler-ruler)[undefinedoffset/silverstripe-nocaptcha

A spam protector and form field using Google's reCAPTCHA v2 or optionally a foundation v3 implementation

31503.8k20](/packages/undefinedoffset-silverstripe-nocaptcha)[sheadawson/silverstripe-zenvalidator

Faster, easier client and server-side form validation for SilverStripe

5782.6k2](/packages/sheadawson-silverstripe-zenvalidator)[jonom/silverstripe-text-target-length

Set character length recommendations on SilverStripe text form fields

30141.2k13](/packages/jonom-silverstripe-text-target-length)[suin/php-cs-fixer-rules

A Rule set for PHP-CS-Fixer mainly targeting PHP 7.1 or higher.

13126.2k3](/packages/suin-php-cs-fixer-rules)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
