PHPackages                             micheh/phpcs-gitlab - 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. micheh/phpcs-gitlab

ActiveLibrary[Testing &amp; Quality](/categories/testing)

micheh/phpcs-gitlab
===================

GitLab Report for PHP\_CodeSniffer (display the violations in the GitLab CI/CD Code Quality Report)

2.1.0(8mo ago)4411.1M—5.6%3[4 PRs](https://github.com/micheh/phpcs-gitlab/pulls)13BSD-3-ClausePHPCI passing

Since May 22Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/micheh/phpcs-gitlab)[ Packagist](https://packagist.org/packages/micheh/phpcs-gitlab)[ RSS](/packages/micheh-phpcs-gitlab/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (13)Used By (13)

GitLab Report for PHP\_CodeSniffer
----------------------------------

[](#gitlab-report-for-php_codesniffer)

[![Main workflow](https://github.com/micheh/phpcs-gitlab/actions/workflows/main.yml/badge.svg)](https://github.com/micheh/phpcs-gitlab/actions/workflows/main.yml/badge.svg)[![codecov](https://camo.githubusercontent.com/25b68c65e8b05232bc404bbcece53e598522baa7703513fb6ea53f0c65edb8f2/68747470733a2f2f636f6465636f762e696f2f6769746875622f6d69636865682f70687063732d6769746c61622f67726170682f62616467652e7376673f746f6b656e3d30324653463354543054)](https://codecov.io/github/micheh/phpcs-gitlab)

This library adds a custom report to [PHP\_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer/) (phpcs) to generate a codequality artifact that can be used by GitLab CI/CD. The custom report is generated in Code Climate format and allows GitLab CI/CD to display the violations in the Code Quality report.

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

[](#installation)

Install this library using [Composer](https://getcomposer.org):

```
composer require --dev micheh/phpcs-gitlab
```

Then adjust your `.gitlab-ci.yml` to run PHP\_CodeSniffer with the custom reporter and to collect the codequality artifacts:

```
phpcs:
  script: vendor/bin/phpcs --report=full --report-\\Micheh\\PhpCodeSniffer\\Report\\Gitlab=phpcs-quality-report.json
  artifacts:
    reports:
      codequality: phpcs-quality-report.json
```

The example above uses two reports, one to display in the build log (full) and one to generate the codequality artifact file in Code Climate format.

> **Note:** GitLab did not support multiple codequality artifacts before version 15.7. If you are using an earlier version of GitLab, you will not be able to see the violations from multiple tools (e.g. PHP Code Sniffer &amp; PHPStan) in the Code Quality report.

Inside the codequality artifact, GitLab expects relative paths to the files with violations. To generate relative paths with PHP Code Sniffer, set the `basepath` argument in your `phpcs.xml.dist` configuration file with `` or run phpcs with `--basepath=.` (adjust the base path as needed).

It is also possible to specify the reports to be used in the `phpcs.xml.dist` file:

```

```

Upgrade from version 1 to 2
---------------------------

[](#upgrade-from-version-1-to-2)

The usage of this package remains the same. However, the calculation of the fingerprint has been updated and is now based on the content instead of the line number. This has the advantage that lines with violations can move up or down and GitLab will not report them as new violations. When upgrading to version 2, it is likely that all violations will show up as changed once, since all fingerprints are new.

References
----------

[](#references)

- [PHP\_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer/)
- [GitLab CI/CD Code Quality](https://docs.gitlab.com/ee/ci/testing/code_quality.html)
- [Code Climate Specification](https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#data-types)

License
-------

[](#license)

The files in this archive are licensed under the BSD-3-Clause license. You can find a copy of this license in [LICENSE.md](LICENSE.md).

###  Health Score

58

—

FairBetter than 98% of packages

Maintenance74

Regular maintenance activity

Popularity57

Moderate usage in the ecosystem

Community22

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 83% 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 ~388 days

Recently: every ~486 days

Total

6

Last Release

243d ago

Major Versions

0.2 → 1.0.02020-06-27

1.1.0 → 2.0.02025-01-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee309938d7863c2a8209e415617207328a023b3e23ecb2d4a64c928659f05ce4?d=identicon)[micheh](/maintainers/micheh)

---

Top Contributors

[![micheh](https://avatars.githubusercontent.com/u/1307920?v=4)](https://github.com/micheh "micheh (39 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")

---

Tags

code-climatecode-qualitygitlabgitlab-reportphp-codesnifferphpcsphpcsPHP\_CodeSniffercode qualitygitlabreportcode climate

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/micheh-phpcs-gitlab/health.svg)

```
[![Health](https://phpackages.com/badges/micheh-phpcs-gitlab/health.svg)](https://phpackages.com/packages/micheh-phpcs-gitlab)
```

###  Alternatives

[dealerdirect/phpcodesniffer-composer-installer

PHP\_CodeSniffer Standards Composer Installer Plugin

596161.9M1.9k](/packages/dealerdirect-phpcodesniffer-composer-installer)[wp-coding-standards/wpcs

PHP\_CodeSniffer rules (sniffs) to enforce WordPress coding conventions

2.7k42.5M1.6k](/packages/wp-coding-standards-wpcs)[slevomat/coding-standard

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

1.5k123.5M1.8k](/packages/slevomat-coding-standard)[phpcsstandards/phpcsextra

A collection of sniffs and standards for use with PHP\_CodeSniffer.

10224.3M44](/packages/phpcsstandards-phpcsextra)[phpcompatibility/phpcompatibility-wp

A ruleset for PHP\_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.

21830.6M587](/packages/phpcompatibility-phpcompatibility-wp)[sirbrillig/phpcs-variable-analysis

A PHPCS sniff to detect problems with variables.

14448.5M97](/packages/sirbrillig-phpcs-variable-analysis)

PHPackages © 2026

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