PHPackages                             andrey-tech/pdepend-summary-formatter-php - 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. [CLI &amp; Console](/categories/cli)
4. /
5. andrey-tech/pdepend-summary-formatter-php

ActiveLibrary[CLI &amp; Console](/categories/cli)

andrey-tech/pdepend-summary-formatter-php
=========================================

Tool to show software code quality metrics, measured by PHP Depend, in console and CI/CD pipeline

1.3.1(3mo ago)16.9k↓52.1%3MITPHPPHP ^7.4 || ^8.0CI passing

Since Oct 5Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/andrey-tech/pdepend-summary-formatter-php)[ Packagist](https://packagist.org/packages/andrey-tech/pdepend-summary-formatter-php)[ Docs](https://github.com/andrey-tech/pdepend-summary-formatter-php)[ RSS](/packages/andrey-tech-pdepend-summary-formatter-php/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (18)Versions (18)Used By (3)

Pdepend Summary Formatter
=========================

[](#pdepend-summary-formatter)

[![Pdepend Summary Formatter logo](./assets/pdepend-summary-formatter-logo.png)](./assets/pdepend-summary-formatter-logo.png)

[![Latest Stable Version](https://camo.githubusercontent.com/9564d6f1cfe61713150a986d18883bb1df0f281020b4c83c9caeff50720cdadc/68747470733a2f2f706f7365722e707567782e6f72672f616e647265792d746563682f70646570656e642d73756d6d6172792d666f726d61747465722d7068702f76)](https://packagist.org/packages/andrey-tech/pdepend-summary-formatter-php)[![Total Downloads](https://camo.githubusercontent.com/e3e475a41712ae35368b2318c284b1eeeae337205996cd0b3d4fc373e279c200/68747470733a2f2f706f7365722e707567782e6f72672f616e647265792d746563682f70646570656e642d73756d6d6172792d666f726d61747465722d7068702f646f776e6c6f616473)](//packagist.org/packages/andrey-tech/pdepend-summary-formatter-php)[![PHP Version Require](https://camo.githubusercontent.com/caa21eba84ea71ca08e3a3a8cf53c0f6a7adfab68f503efed7c1d72ce1412caf/68747470733a2f2f706f7365722e707567782e6f72672f616e647265792d746563682f70646570656e642d73756d6d6172792d666f726d61747465722d7068702f726571756972652f706870)](https://packagist.org/packages/andrey-tech/pdepend-summary-formatter-php)[![License](https://camo.githubusercontent.com/cb881104ce85388a194eb783762a3f78588a860e471dd74261ff5fd80025f44a/68747470733a2f2f706f7365722e707567782e6f72672f616e647265792d746563682f70646570656e642d73756d6d6172792d666f726d61747465722d7068702f6c6963656e7365)](https://packagist.org/packages/andrey-tech/pdepend-summary-formatter-php)

Pdepend Summary Formatter is a tool to show software code quality metrics, measured by [PHP Depend](https://github.com/pdepend/pdepend) (pdepend), in console for development and in CI/CD pipeline.

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Command line options](#command-line-options)
- [Software metrics](#software-metrics)
- [Configuration YAML file](#configuration-yaml-file)
- [Exit codes](#exit-codes)
- [Authors and Maintainers](#authors-and-maintainers)
- [License](#license)

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

[](#installation)

Pdepend Summary Formatter tool requires **PHP &gt;= 7.4**, latest version of [PHP Depend](https://github.com/pdepend/pdepend)and [Composer](https://getcomposer.org/).

```
composer require --dev pdepend/pdepend
composer require --dev andrey-tech/pdepend-summary-formatter-php
```

Generate a default config file `pdepend-summary-formatter.yml.dist` in current working directory:

```
./vendor/bin/pdepend-summary-formatter --init
```

Then run `PHP Depend` to scan your source PHP code in directory `src` and generate an XML report in file `summary.xml`:

```
./vendor/bin/pdepend --summary-xml=summary.xml --suffix=php src
```

Then run Pdepend Summary Formatter tool to show code quality metrics, measured by PHP Depend, in console and to write results to specified text file `summary.txt`:

```
./vendor/bin/pdepend-summary-formatter summary.xml --output-file=summary.txt
```

Command line options
--------------------

[](#command-line-options)

```
./vendor/bin/pdepend-summary-formatter
```

The Pdepend Summary Formatter tool command line interface also accepts the following optional arguments:

- `--init` — Will generate a default config file `pdepend-summary-formatter.yml.dist` in current working directory.
- `--output-file=` — Write results also to the specified text file.
- `--config-file=` — The filepath to a custom config YAML file.
- `--ignore-red-metrics-on-exit` — Will exit with a zero code, even "red" metrics exist.
- `--ignore-yellow-metrics-on-exit` — Will exit with a zero code, even "yellow" metrics exist.
- `--no-color` — Disable colors in console.

An example command line of Pdepend Summary Formatter tool and PHP Depend tool:

```
./vendor/bin/pdepend --summary-xml=./var/summary.xml --suffix=php src,tests
./vendor/bin/pdepend-summary-formatter ./var/summary.xml --config-file=./pdepend-summary-formatter.yml --output-file=./var/summary.txt
```

An example of output text file `summary.txt`:

```
FILE: /app/src/AndreyTech/Pdepend/Summary/Formatter/Colorizer.php
+---------------------------+-----+-----+-----+-----+-----+-----+------+-----+------+
| CLASS                     | wmc | cbo | loc | cis | nom | npm | vars | dit | nocc |
+---------------------------+-----+-----+-----+-----+-----+-----+------+-----+------+
| Colorizer                 | 15  | 0   | 117 | 4   | 8   | 4   | 3    | 0   | 0    |
+---------------------------+-----+-----+-----+-----+-----+-----+------+-----+------+
+---------------------------+----+-----+------+-------+-------+-----+------+----+-----+------+-----+----+-----+-----+-----+
| METHOD                    | mi | ccn | ccn2 | crap0 | npath | loc | hb   | hd | hv  | he   | ht  | hi | hl  | hnd | hnt |
+---------------------------+----+-----+------+-------+-------+-----+------+----+-----+------+-----+----+-----+-----+-----+
| __construct               | 81 | 1   | 1    | 2     | 1     | 4   | 0.01 | 4  | 16  | 62   | 3   | 4  | 0.3 | 6   | 6   |
| getFgTagStats             | 82 | 1   | 1    | 2     | 1     | 4   | 0.01 | 8  | 12  | 93   | 5   | 1  | 0.1 | 5   | 5   |
| colorizeClassMetric       | 79 | 1   | 1    | 2     | 1     | 4   | 0.01 | 5  | 37  | 192  | 11  | 7  | 0.2 | 10  | 11  |
| colorizeMethodMetric      | 79 | 1   | 1    | 2     | 1     | 4   | 0.01 | 5  | 37  | 192  | 11  | 7  | 0.2 | 10  | 11  |
| colorize                  | 57 | 4   | 5    | 30    | 8     | 19  | 0.14 | 27 | 315 | 8517 | 473 | 12 | 0   | 32  | 63  |
| renderTemplate            | 59 | 3   | 3    | 12    | 4     | 17  | 0.09 | 14 | 320 | 4379 | 243 | 23 | 0.1 | 25  | 69  |
| updateFgTagStats          | 70 | 2   | 2    | 6     | 2     | 8   | 0.05 | 23 | 78  | 1813 | 101 | 3  | 0   | 13  | 21  |
| parseConfig               | 73 | 1   | 1    | 2     | 1     | 16  | 0.03 | 7  | 96  | 660  | 37  | 14 | 0.1 | 13  | 26  |
+---------------------------+----+-----+------+-------+-------+-----+------+----+-----+------+-----+----+-----+-----+-----+

+---------------------+--------+--------+--------+--------+--------+-----+-----+-----+-----+-----+------+------+-------+
| PROJECT             | min mi | avg mi | max mi | std mi | med mi | noc | nom | noi | nof | nop | loc  | lloc | ncloc |
+---------------------+--------+--------+--------+--------+--------+-----+-----+-----+-----+-----+------+------+-------+
| 2026-03-29T05:30:57 | 57     | 72     | 82     | 9      | 76     | 11  | 80  | 0   | 0   | 3   | 1486 | 559  | 1353  |
+---------------------+--------+--------+--------+--------+--------+-----+-----+-----+-----+-----+------+------+-------+

```

Software metrics
----------------

[](#software-metrics)

[PHP Depend](https://pdepend.org/) (pdepend) tool can generate a large set of [software metrics](https://pdepend.org/documentation/software-metrics/index.html)from a given code base. These values can be used to measure the quality of a software project and they help to identify that parts of an application where a refactoring should be applied.

Pdepend Summary Formatter tool shows only the part of software metrics, measured by PHP Depend, and shows them in `green`, `yellow` and `red` colors in the console, according to boundaries for values, defined in configuration YAML file.

This table shows a list of the software metrics by Pdepend Summary Formatter tool for entire project, classes, traits, methods. The table also shows the default values for "red" boundaries of software metrics, based on [PHP Mess Detector](https://phpmd.org/) (PHPMD) tool.

MetricDescriptionProjectClassTraitMethodavg miAverage [Maintainability Index](https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-maintainability-index-range-and-meaning?view=vs-2022)50cbo[Coupling Between Objects](https://phpmd.org/rules/design.html#couplingbetweenobjects)1313ccn[Cyclomatic Complexity Number](https://phpmd.org/rules/codesize.html#cyclomaticcomplexity)10ccn2[Extended Cyclomatic Complexity Number](https://stackoverflow.com/questions/27954015/cyclomatic-complexity-and-variants)10cis[Class Interface Size](https://phpmd.org/rules/codesize.html#excessivepubliccount)4545crap0[Change Risk Analysis and Predictions Index](https://www.artima.com/weblogs/viewpost.jsp?thread=210575) for 0% coverage29dit[Depth of Inheritance Tree](https://phpmd.org/rules/design.html#depthofinheritance)6hb[Halstead Bugs](https://en.wikipedia.org/wiki/Halstead_complexity_measures)✓hd[Halstead Difficulty](https://en.wikipedia.org/wiki/Halstead_complexity_measures)✓he[Halstead Effort](https://en.wikipedia.org/wiki/Halstead_complexity_measures)✓hi[Halstead Intelligence Content](https://en.wikipedia.org/wiki/Halstead_complexity_measures)✓hl[Halstead Level](https://en.wikipedia.org/wiki/Halstead_complexity_measures)✓hnd[Halstead Vocabulary](https://en.wikipedia.org/wiki/Halstead_complexity_measures)✓hnt[Halstead Length](https://en.wikipedia.org/wiki/Halstead_complexity_measures)✓ht[Halstead Programming Time](https://en.wikipedia.org/wiki/Halstead_complexity_measures)✓hv[Halstead Volume](https://en.wikipedia.org/wiki/Halstead_complexity_measures)✓llocLogical Lines Of Code✓loc[Lines Of Code](https://phpmd.org/rules/codesize.html#excessivemethodlength)1000100max miMaximum of [Maintainability Index](https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-maintainability-index-range-and-meaning?view=vs-2022)50mi[Maintainability Index](https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-maintainability-index-range-and-meaning?view=vs-2022)50min miMinimum of [Maintainability Index](https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-maintainability-index-range-and-meaning?view=vs-2022)50nocc[Number Of Child Classes](https://phpmd.org/rules/design.html#numberofchildren)15nclocNon Comment Lines Of Code✓nocNumber Of Classes✓nofNumber Of Functions✓noiNumber Of Interfaces✓nom[Number Of Methods](https://phpmd.org/rules/codesize.html#toomanymethods)25npm[Number of Public Methods](https://phpmd.org/rules/codesize.html#toomanypublicmethods)2020npath[NPath Complexity](https://phpmd.org/rules/codesize.html#npathcomplexity)200nopNumber of Packages (namespaces)✓std mi[Standard deviation](https://en.wikipedia.org/wiki/Standard_deviation) of [Maintainability Index](https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-maintainability-index-range-and-meaning?view=vs-2022)✓med mi[Median](https://en.wikipedia.org/wiki/Median) of [Maintainability Index](https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-maintainability-index-range-and-meaning?view=vs-2022)✓vars[Number of Properties](https://phpmd.org/rules/codesize.html#toomanyfields)1515wmc[Weighted Method Count](https://phpmd.org/rules/codesize.html#excessiveclasscomplexity)5050Note: ✓ — means there are no defined "red" color boundaries for this metric.

Configuration YAML file
-----------------------

[](#configuration-yaml-file)

By default Pdepend Summary Formatter tool is looking for following configuration YAML files is current working directory:

- `pdepend-summary-formatter.yml`,
- `pdepend-summary-formatter.yml.dist`.

Configuration YAML file allows to set color boundaries for values of software metrics.

Pdepend Summary Formatter tool currently defines three color boundaries:

ColorDescriptionExit code`green`Ok0`yellow`Warning3`red`Error2A white value means there are no defined color boundaries for this metric.

> You can also add/set custom colors and styles. See [How to Color and Style the Console Output](https://symfony.com/doc/current/console/coloring.html) in Symfony console.

Fragment of default configuration file:

```
  metrics:

    # Metrics of class
    class:

      # https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-class-coupling?view=vs-2022
      # https://phpmd.org/rules/design.html#couplingbetweenobjects
      # https://pdepend.org/documentation/software-metrics/coupling-between-objects.html
      cbo:
        green: [ 0, 13 ],
        red+bold: [ 14, null ]

    # Metrics of method
    method:

      # https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-cyclomatic-complexity?view=vs-2022
      # https://phpmd.org/rules/codesize.html#cyclomaticcomplexity
      ccn:
        green: [ 1, 7 ]
        yellow+bold: [ 8, 10 ]
        red+bold: [ 11, null ]
```

Exit codes
----------

[](#exit-codes)

Pdepend Summary Formatter tool currently defines four different exit codes:

CodeDescription0This exit code indicates that everything worked as expected without "red" or "yellow" metrics.1This exit code indicates that an error/exception occurred which has interrupted tool during execution.2This exit code means that tool has processed the summary file without the occurrence of an error/exception with "red" metrics.3This exit code means that tool has processed the summary file without the occurrence of an error/exception with "yellow" metrics.

Authors and Maintainers
-----------------------

[](#authors-and-maintainers)

The author and maintainer of Pdepend Summary Formatter tool is [andrey-tech](https://github.com/andrey-tech).

License
-------

[](#license)

This tool is licensed under the [MIT license](./LICENSE).

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance82

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~69 days

Recently: every ~152 days

Total

14

Last Release

96d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/51994444?v=4)[Andrey](/maintainers/andrey-tech)[@andrey-tech](https://github.com/andrey-tech)

---

Top Contributors

[![andrey-tech](https://avatars.githubusercontent.com/u/51994444?v=4)](https://github.com/andrey-tech "andrey-tech (50 commits)")

---

Tags

clean-codeconsole-applicationcyclomatic-complexitydevhalstead-complexitymaintainability-indexmetricsmetrics-visualizationpdependphpqualityconsoledevpdependMetricsmetrics-visualizationcyclomatic-complexityhalstead-complexitymaintainability-index

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/andrey-tech-pdepend-summary-formatter-php/health.svg)

```
[![Health](https://phpackages.com/badges/andrey-tech-pdepend-summary-formatter-php/health.svg)](https://phpackages.com/packages/andrey-tech-pdepend-summary-formatter-php)
```

###  Alternatives

[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54743.1k4](/packages/jolicode-castor)[whatsdiff/whatsdiff

See what's changed in your project's dependencies

771.2k](/packages/whatsdiff-whatsdiff)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)

PHPackages © 2026

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