PHPackages                             sebastian/complexity - 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. sebastian/complexity

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

sebastian/complexity
====================

Library for calculating the complexity of PHP code units

6.0.0(3mo ago)1.3k528.8M↓13.1%10[2 issues](https://github.com/sebastianbergmann/complexity/issues)[2 PRs](https://github.com/sebastianbergmann/complexity/pulls)11BSD-3-ClausePHPPHP &gt;=8.4CI passing

Since Jul 22Pushed today6 watchersCompare

[ Source](https://github.com/sebastianbergmann/complexity)[ Packagist](https://packagist.org/packages/sebastian/complexity)[ Docs](https://github.com/sebastianbergmann/complexity)[ GitHub Sponsors](https://github.com/sebastianbergmann)[ Fund](https://liberapay.com/sebastianbergmann)[ RSS](/packages/sebastian-complexity/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (19)Used By (11)

[![Latest Stable Version](https://camo.githubusercontent.com/2a72d9ddaf0e72c92830266b98c239e396e0149faa1f39093627dbe92681722f/68747470733a2f2f706f7365722e707567782e6f72672f73656261737469616e2f636f6d706c65786974792f76)](https://packagist.org/packages/sebastian/complexity)[![CI Status](https://github.com/sebastianbergmann/complexity/workflows/CI/badge.svg)](https://github.com/sebastianbergmann/complexity/actions)[![codecov](https://camo.githubusercontent.com/3350c0c2a750e8bbf778a9df9cc2f6e3fc4bf146b0755e56b11cde4ef314ec09/68747470733a2f2f636f6465636f762e696f2f67682f73656261737469616e626572676d616e6e2f636f6d706c65786974792f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/sebastianbergmann/complexity)

sebastian/complexity
====================

[](#sebastiancomplexity)

Library for calculating the complexity of PHP code units.

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

[](#installation)

You can add this library as a local, per-project dependency to your project using [Composer](https://getcomposer.org/):

```
composer require sebastian/complexity

```

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

```
composer require --dev sebastian/complexity

```

###  Health Score

75

—

ExcellentBetter than 100% of packages

Maintenance92

Actively maintained with recent releases

Popularity78

Solid adoption and visibility

Community27

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 96.7% 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 ~126 days

Recently: every ~91 days

Total

17

Last Release

102d ago

Major Versions

2.0.x-dev → 4.0.02024-02-02

4.0.1 → 5.0.02025-02-07

3.2.x-dev → 4.0.x-dev2025-09-26

4.0.x-dev → 5.0.x-dev2025-12-31

5.0.x-dev → 6.0.02026-02-06

PHP version history (6 changes)1.0.0PHP ^7.3 || ^8.0

2.0.1PHP &gt;=7.3

3.0.0PHP &gt;=8.1

4.0.0PHP &gt;=8.2

5.0.0PHP &gt;=8.3

6.0.0PHP &gt;=8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1089?v=4)[Sebastian Probst Eide](/maintainers/sebastian)[@sebastian](https://github.com/sebastian)

---

Top Contributors

[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (384 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (10 commits)")[![Ayesh](https://avatars.githubusercontent.com/u/811553?v=4)](https://github.com/Ayesh "Ayesh (1 commits)")[![MattyRad](https://avatars.githubusercontent.com/u/1143595?v=4)](https://github.com/MattyRad "MattyRad (1 commits)")[![muglug](https://avatars.githubusercontent.com/u/2292638?v=4)](https://github.com/muglug "muglug (1 commits)")

---

Tags

cyclomatic-complexitysoftware-metrics

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sebastian-complexity/health.svg)

```
[![Health](https://phpackages.com/badges/sebastian-complexity/health.svg)](https://phpackages.com/packages/sebastian-complexity)
```

###  Alternatives

[phpunit/php-code-coverage

Library that provides collection, processing, and rendering functionality for PHP code coverage information.

8.9k892.4M1.5k](/packages/phpunit-php-code-coverage)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[behat/behat

Scenario-oriented BDD framework for PHP

4.0k96.8M2.0k](/packages/behat-behat)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k26.2M1.8k](/packages/infection-infection)[sebastian/lines-of-code

Library for counting the lines of code in PHP source code

1.2k528.9M13](/packages/sebastian-lines-of-code)[phpmetrics/phpmetrics

Static analyzer tool for PHP : Coupling, Cyclomatic complexity, Maintainability Index, Halstead's metrics... and more !

2.6k14.5M299](/packages/phpmetrics-phpmetrics)

PHPackages © 2026

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