PHPackages                             maximal/gitlab-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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. maximal/gitlab-code-quality

ActiveProject[PDF &amp; Document Generation](/categories/documents)

maximal/gitlab-code-quality
===========================

GitLab Code Quality generator for PHP and JS projects

v1.11(3mo ago)843.5k↓55.3%2[1 issues](https://github.com/maximal/gitlab-code-quality/issues)MITPHPPHP ^8.0|^8.1|^8.2|^8.3|^8.4

Since Mar 20Pushed 3mo ago5 watchersCompare

[ Source](https://github.com/maximal/gitlab-code-quality)[ Packagist](https://packagist.org/packages/maximal/gitlab-code-quality)[ RSS](/packages/maximal-gitlab-code-quality/feed)WikiDiscussions main Synced yesterday

READMEChangelog (10)DependenciesVersions (15)Used By (0)

GitLab Code Quality generator for PHP and JS projects
=====================================================

[](#gitlab-code-quality-generator-for-php-and-js-projects)

This program generates [Code Climate](https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#data-types) report for [GitLab Code Quality widget](https://docs.gitlab.com/ee/ci/testing/code_quality.html#view-code-quality-results) in merge requests and pipelines using various tools and linters:

- [Psalm](https://psalm.dev/)
- [PHPStan](https://phpstan.org/)
- [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)
- [ECS](https://github.com/easy-coding-standard/easy-coding-standard)
- [ESLint](https://eslint.org/)
- [StyleLint](https://stylelint.io/)
- [Biome](https://biomejs.dev/)

They are automatically detected in the following paths:

- `vendor/bin/psalm`
- `vendor/bin/phpstan`
- `vendor/bin/phpcs`
- `vendor/bin/ecs`
- `node_modules/eslint/bin/eslint.js`
- `node_modules/stylelint/bin/stylelint.mjs`
- `node_modules/@biomejs/biome/bin/biome`

Two JS runtimes supported (to run Biome, ESLint, and StyleLint checks):

- [Bun](https://bun.sh/) (preferred over Node);
- [Node](https://nodejs.org/en) (used if no Bun executable found).

The application is written in pure PHP (8.0+) without any framework or library dependencies.

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

[](#installation)

Install the tool via [Composer](https://getcomposer.org/):

```
composer require --dev maximal/gitlab-code-quality
```

Make the test run:

```
./vendor/bin/gitlab-code-quality > gl-code-quality-report.json
```

Now, you should have `gl-code-quality-report.json` file with all code quality issues found in your project.

Usage
-----

[](#usage)

Edit your GitLab CI/CD config to have `code_quality` step, which runs this tool.

Example `.gitlab-ci.yml` file:

```
# ... ... ...

# GitLab Code Quality Widget
# https://docs.gitlab.com/ee/ci/testing/code_quality.html#view-code-quality-results
code_quality:
  stage: test
  script:
    - ./vendor/bin/gitlab-code-quality > gl-code-quality-report.json
  artifacts:
    reports:
      codequality: gl-code-quality-report.json
    expire_in: 1 month
    paths: [gl-code-quality-report.json]

# ... ... ...
```

### Strict Mode

[](#strict-mode)

By default, the tool returns non-zero exit code (1) only if critical errors are found. For example, on PHP syntax parsing errors (the code cannot be executed at all). This is considered a non-strict behavior.

Although, you can harden issue handling and have non-zero exit code (2) if any issues are found:

```
./vendor/bin/gitlab-code-quality --strict > gl-code-quality-report.json
```

In strict mode, code quality stage will fail CI/CD pipeline even on minor issues.

Configuration
-------------

[](#configuration)

Code quality tools are detected automatically and run with their default config files. You can override this behavior in `extra` section of your project’s `composer.json` file:

```
{
	// composer.json
	// ... ... ...
	"extra": {
		// GitLab Code Quality report settings with their default values
		// All the paths and filenames are relative to the root of the project
		"gitlab-code-quality": {
			// Directory for PHP checks/linters
			"php-dir": ".",
			// Directory for JS checks/linters
			"js-dir": "resources",
			// Paths above are typical for Laravel projects
			// Print issue statistics table to STDERR (`false` to only print issues JSON to STDOUT)
			"stats": true,
			// Print last issue location for every issue type in statistics table:
			// `false` or `"no"` — do not print
			// `true` or `"yes"` — print
			// `"single"` (default) — print only if the issue is the only one of its class
			"last": "single",
			// Run Psalm and PHP CodeSniffer with `--no-cache` and ECX with `--clear-cache`
			"cache": false,
			// Strict mode:
			// `false` to return non-zero exit code only if critical errors are found (for example, PHP parsing errors)
			// `true` to return non-zero exit code if any issues are found
			"strict": false,

			// Run Psalm if it exists in `vendor/bin`
			"psalm": true,
			// Psalm config file path
			"psalm-config": "psalm.xml",

			// Run PHPStan if it exists in `vendor/bin`
			"phpstan": true,
			// PHPStan config file path
			"phpstan-config": "phpstan.neon",

			// Run PHP CodeSniffer if it exists in `vendor/bin`
			"phpcs": true,
			// PHP CodeSniffer standard (name or path to rules file)
			"phpcs-standard": "PSR12",
			// PHP CodeSniffer ignore paths (string or array, will be added to `--ignore=` flag)
			"phpcs-ignore": "",

			// Run ECS (Easy Coding Standard) if it exists in `vendor/bin`
			"ecs": true,
			// ECS config file path
			"ecs-config": "ecs.php",

			// Bun executable for EsLint and StyleLint (preferred over Node)
			"bun": "bun",
			// Node executable for EsLint and StyleLint (used if no Bun found)
			"node": "node",

			// Run ESLint if it exists in `node_modules/eslint/bin/eslint.js`
			"eslint": true,
			// ESLint config file
			"eslint-config": ".eslintrc.yml",

			// Run StyleLint if it exists in `node_modules/stylelint/bin/stylelint.mjs`
			"stylelint": true,
			// StyleLint config file
			"stylelint-config": ".stylelintrc.yml",
			// Files to check glob pattern for StyleLint
			"stylelint-files": "resources/**/*.{css,scss,sass,vue}",

			// Run Biome if it exists in `node_modules/@biomejs/biome/bin/biome`
			"biome": true,
			// Biome config file
			"biome-config": "biome.jsonc"
		}
	},
	// ... ... ...
}
```

In most cases you only need to specify `php-dir` and `js-dir` paths. For example:

```
{
	// composer.json
	// ... ... ...
	"require-dev": {
		// ...
		"maximal/gitlab-code-quality": "^1.0",
		// ...
	},
	// ... ... ...
	"extra": {
		"gitlab-code-quality": {
			// Run all quality tools if they exist,
			// considering that PHP files are located in `app` directory
			// and JS files are located in `frontend` directory
			"php-dir": "app",
			"js-dir": "frontend",
		}
	},
	// ... ... ...
}
```

In an ordinary [Laravel](https://laravel.com/) project this tool runs in zero-config way with Laravel’s default paths (`php-dir` is `.` and `js-dir` is `resourses`):

```
{
	// composer.json
	// ... ... ...
	"require-dev": {
		// ...
		"maximal/gitlab-code-quality": "^1.0",
		// ...
	},
	// ... ... ...
	"extra": {
		"laravel": {
			// ... Laravel’s `dont-discover` and other configs ...
		},
		// No `gitlab-code-quality` section
	},
	// ... ... ...
}
```

Coding Style
------------

[](#coding-style)

[PER-3T](https://github.com/maximal/per-3t) / PSR-12T (PHP’s standard [PER-3](https://www.php-fig.org/per/coding-style/) / [PSR-12](https://www.php-fig.org/psr/psr-12/) with [SmartTabs](https://www.emacswiki.org/emacs/SmartTabs) instead of spaces).

Author
------

[](#author)

-
-
-

###  Health Score

54

—

FairBetter than 96% of packages

Maintenance80

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 88.5% 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 ~85 days

Recently: every ~161 days

Total

14

Last Release

95d ago

PHP version history (2 changes)v1.0PHP &gt;=8.0

v1.8PHP ^8.0|^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

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

---

Top Contributors

[![maximal](https://avatars.githubusercontent.com/u/980679?v=4)](https://github.com/maximal "maximal (23 commits)")[![ciltocruz](https://avatars.githubusercontent.com/u/19903919?v=4)](https://github.com/ciltocruz "ciltocruz (2 commits)")[![oskarmodig](https://avatars.githubusercontent.com/u/3178877?v=4)](https://github.com/oskarmodig "oskarmodig (1 commits)")

---

Tags

generatorcode qualitygitlabreportcode climatewidgetcicd

### Embed Badge

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

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

###  Alternatives

[micheh/phpcs-gitlab

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

4412.7M32](/packages/micheh-phpcs-gitlab)[shuchkin/simplexlsxgen

Export data to Excel XLSx file. PHP XLSX generator.

1.1k2.4M32](/packages/shuchkin-simplexlsxgen)[kartik-v/yii2-export

A library to export server/db data in various formats (e.g. excel, html, pdf, csv etc.)

1693.3M36](/packages/kartik-v-yii2-export)[jimmyjs/laravel-report-generator

Rapidly Generate Simple Pdf &amp; Excel Report on Laravel 5 (Using Barryvdh/DomPdf or Barryvdh/laravel-snappy &amp; maatwebsite/excel)

580165.5k1](/packages/jimmyjs-laravel-report-generator)[aspose-cloud/aspose-words-cloud

Open, generate, edit, split, merge, compare and convert Word documents. Integrate Cloud API into your solutions to manipulate documents. Convert PDF to Word (DOC, DOCX, ODT, RTF and HTML) and in the opposite direction.

31169.4k](/packages/aspose-cloud-aspose-words-cloud)[spraed/pdf-generator-bundle

This bundle creates (multiple) PDFs in Symfony from Twig/HTML templates.

51522.1k](/packages/spraed-pdf-generator-bundle)

PHPackages © 2026

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