PHPackages                             hkirsman/code-quality - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. hkirsman/code-quality

ActivePhpcodesniffer-standard[Testing &amp; Quality](/categories/testing)

hkirsman/code-quality
=====================

Code Quality checker wrapper for GrumPHP

2.1.0(4y ago)01MITPHP

Since Sep 5Pushed 4y agoCompare

[ Source](https://github.com/hkirsman/code-quality-1)[ Packagist](https://packagist.org/packages/hkirsman/code-quality)[ Docs](https://github.com/wunderio/code-quality)[ RSS](/packages/hkirsman-code-quality/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (12)Versions (30)Used By (0)

Code Quality
============

[](#code-quality)

[![CircleCI](https://camo.githubusercontent.com/510a87be829ab6632329663afae12d83daddd47b6583d84347afc9797c05f08d/68747470733a2f2f636972636c6563692e636f6d2f67682f77756e646572696f2f636f64652d7175616c6974792e7376673f7374796c653d737667)](https://circleci.com/gh/wunderio/code-quality)

This composer package will provide some basic code quality checks before committing code by using .

**It checks only modified files or new files on git commit, but check on all configured paths can be executed running `vendor/bin/grumphp run`**

This tool only extends [GrumPHP](https://github.com/phpro/grumphp). Please read its [documentation](https://github.com/phpro/grumphp/blob/master/README.md#configuration) on how to configure tool itself.

Checks performed
----------------

[](#checks-performed)

This repository currently has following checks:

- Shell script exec bits - [check\_file\_permissions](src/Task/CheckFilePermissions/README.md)
- PHP Drupal CS and PHP Code security - [phpcs](src/Task/Phpcs/README.md)
- PHP 7.3 Compatibility - [php\_compatibility](src/Task/PhpCompatibility/README.md)
- PHP syntax - [php\_check\_syntax](src/Task/PhpCheckSyntax/README.md)
- Cognitive complexity and other ecs sniffs - [ecs](src/Task/Ecs/README.md)
- Yaml syntax - [yaml\_lint](src/Task/YamlLint/README.md)
- Json syntax - [json\_lint](src/Task/JsonLint/README.md)
- Deprecation testing - [php\_stan](src/Task/PhpStan/README.md)

Pre-requisites
--------------

[](#pre-requisites)

- Composer
- PHP &gt;= 7.1

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

[](#installation)

This needs to be done only once either while creating a project or enabling code checks in existing project.

```
composer require wunderio/code-quality --dev
cp vendor/wunderio/code-quality/config/grumphp.yml ./grumphp.yml
cp vendor/wunderio/code-quality/config/phpstan.neon ./phpstan.neon

```

The commit hook for GrumPHP is automatically installed on composer require.

Customization
-------------

[](#customization)

### Configuration

[](#configuration)

Details of the configuration are broken down into the following sections.

- [Parameters](https://github.com/phpro/grumphp/blob/master/doc/parameters.md) – Configuration settings for GrumPHP itself.
- [Tasks](https://github.com/phpro/grumphp/blob/master/doc/tasks.md) – External tasks performing code validation and their respective configurations.
- [TestSuites](https://github.com/phpro/grumphp/blob/master/doc/testsuites.md)
- [Extensions](https://github.com/phpro/grumphp/blob/master/doc/extensions.md)
- [Events](https://github.com/phpro/grumphp/blob/master/doc/events.md)
- [Conventions checker](https://github.com/phpro/grumphp/blob/master/doc/conventions.md)

### Task parameters

[](#task-parameters)

If you need to customize the rules for PHP CodeSniffer then drop in phpcs.xml in the same folder as composer.json and configure grumphp.yml:

```
parameters:
  tasks:
    phpcs:
      standard:
        - phpcs.xml
```

Same applies to any task that uses other configuration file (easy-coding-standards).

**Each code quality tool allows you to define at least 3 things:**

- `run_on` - Multiple paths that will be checked and files staged must be from same path
- `ignore_patterns` - path parts that will exclude files from check
- `extensions` - file extensions of files that should be checked

Please see individual task documentation for more information on what are other configurable options.

Commands
--------

[](#commands)

Since GrumPHP is just a CLI tool, these commands can be triggered:

- [configure](https://github.com/phpro/grumphp/blob/master/doc/commands.md#installation)
- [git:init](https://github.com/phpro/grumphp/blob/master/doc/commands.md#installation)
- [git:deinit](https://github.com/phpro/grumphp/blob/master/doc/commands.md#installation)
- [git:pre-commit](https://github.com/phpro/grumphp/blob/master/doc/commands.md#git-hooks)
- [git:commit-msg](https://github.com/phpro/grumphp/blob/master/doc/commands.md#git-hooks)
- [run](https://github.com/phpro/grumphp/blob/master/doc/commands.md#run)

Usage
-----

[](#usage)

The pre-commit hook will be automatically run upon executing `git commit`.

The code scanning can be avoided by `git commit --no-verify` or `git commit -n`.

You can run the checks manually with: `./vendor/bin/grumphp run`

Usage in Continuous Integration
-------------------------------

[](#usage-in-continuous-integration)

You can easily use the code quality checkers on your CI (CircleCi/Jenkins/GitLab CI) by adding this line:

```
./vendor/bin/grumphp run --no-ansi --no-interaction

```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity1

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 80.1% 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 ~37 days

Recently: every ~111 days

Total

25

Last Release

1588d ago

Major Versions

0.2.0 → 1.0.02019-09-19

1.0.9 → 2.0.02020-12-08

1.0.10 → 2.1.02022-02-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/492375?v=4)[Hannes Kirsman](/maintainers/hkirsman)[@hkirsman](https://github.com/hkirsman)

---

Top Contributors

[![guncha25](https://avatars.githubusercontent.com/u/10857118?v=4)](https://github.com/guncha25 "guncha25 (133 commits)")[![mitrpaka](https://avatars.githubusercontent.com/u/2673714?v=4)](https://github.com/mitrpaka "mitrpaka (23 commits)")[![hkirsman](https://avatars.githubusercontent.com/u/492375?v=4)](https://github.com/hkirsman "hkirsman (7 commits)")[![mikkmiggur](https://avatars.githubusercontent.com/u/14977199?v=4)](https://github.com/mikkmiggur "mikkmiggur (2 commits)")[![mgalang](https://avatars.githubusercontent.com/u/209939?v=4)](https://github.com/mgalang "mgalang (1 commits)")

---

Tags

qualitygithooks

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hkirsman-code-quality/health.svg)

```
[![Health](https://phpackages.com/badges/hkirsman-code-quality/health.svg)](https://phpackages.com/packages/hkirsman-code-quality)
```

###  Alternatives

[wp-cli/wp-cli-tests

WP-CLI testing framework

423.1M142](/packages/wp-cli-wp-cli-tests)[slevomat/coding-standard

Slevomat Coding Standard for PHP\_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.

1.5k134.0M2.3k](/packages/slevomat-coding-standard)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M343](/packages/drupal-core-dev)[ec-europa/toolkit

Toolkit packaged for Drupal projects based on Robo.

40252.8k34](/packages/ec-europa-toolkit)[acquia/coding-standards

PHP\_CodeSniffer rules (sniffs) for Acquia coding standards

225.0M35](/packages/acquia-coding-standards)[axelerant/drupal-quality-checker

Code quality checking tools for Drupal project.

13205.2k1](/packages/axelerant-drupal-quality-checker)

PHPackages © 2026

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