Complexity Report
How the cyclomatic complexity of PHP open source software evolved over time - one line per release, measured with phploc.
- Repositories
- 809
- Releases
- 20,192
- Lines of code
- 2,194,613,102
Ø 9.73 → 9.51 across 791 libraries since January 1, 2026
Ø 9.68 → 9.54 across 784 libraries since August 4, 2025
Ø 10.10 → 9.74 across 724 libraries since August 4, 2021
Ø 11.90 → 9.49 across 799 libraries since their own first release
Everything the report carries, plus every public repository on GitHub that is mostly written in PHP - a composer.json is not needed.
Most starred repositories
The order the report itself is built around - stars decide what the chart opens with.
Open the chartcoolify
An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 280+ one-click services on your own servers.
filament
A powerful open-source UI framework for Laravel • Build and ship apps & admin panels fast with Livewire
monica
Personal CRM. Remember everything about your friends, family and business relationships.
Average cyclomatic complexity of the latest analysed release, across all methods and functions.
Open the chartcodeigniter-restserver
A fully RESTful server implementation for CodeIgniter using one library, one config file and one controller.
PHP-MySQLi-Database-Class
Wrapper for a PHP MySQL class, which utilizes MySQLi and prepared statements.
Lines of code in the latest analysed release, as phploc counts them.
Open the chartgoogle-api-php-client-services
magento2
Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
psalm
A PHP static analysis tool for finding errors and security vulnerabilities in PHP applications
dolibarr
Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
drupal
Verbatim mirror of the git.drupal.org repository for Drupal core. Please see the https://github.com/drupal/drupal#contributing. PRs are not accepted on GitHub.
Repositories whose average complexity grew the most within the last 12 months, measured against the release they stood at back then - the window the figure above uses as well.
Open the chartapi-platform
🕸️ Create REST and GraphQL APIs, scaffold Jamstack webapps, stream changes in real-time.
Complexity levels
How the report is made
Anyone can submit a repository - github.com is the only source, and no
composer.json is needed. A submission is turned down when the
repository is unknown, a fork, empty, larger than 10 GB, or less than 20%
PHP by the language breakdown github.com reports for it; everything else is
queued for a worker.
The worker clones it and checks out its release tags one after another. Only
major and minor releases are measured (5.4, 5.4.0) -
patch releases and pre-releases (anything carrying a -) are skipped,
as are a handful of releases whose date git cannot tell straight. On every
checkout,
phploc
reads every .php file of the working copy and leaves two numbers
behind: lines of code, and the average cyclomatic complexity of a class, dated by
the last commit that tag points at. The clone is deleted afterwards, the numbers
stay.
From then on the report keeps itself current: every night it refreshes stars and asks github.com which releases are missing, so a new minor turns up in the chart by itself - and a repository that did not release is not even cloned.
About cyclomatic complexity
Cyclomatic complexity counts the paths through a piece of code: one, plus one for
every branch - if, case, while,
for, catch, &&, ||.
Code without a single condition scores 1. What is charted here is the average
over all classes of a release, so it says how branchy the average class of a
library is - not how large it is, and not how good it is.
It is one metric, and worth what a metric is worth. It travels well as a rough
measure of how many paths a test suite has to cover, and badly as a verdict: a
clear class holding one big match outscores a tangle of indirection
nobody can follow, and pushing branches into polymorphism lowers the figure
without lowering the thinking. The shape of a line over the years says more than
any point on it.
The data has its glitches, too. Whatever sits in a repository at a tag is measured, so committed dependencies, generated code and test suites count towards the average. Libraries that were split, renamed or imported from another version control system - Zend → Laminas, the early PHPUnit tags - carry dates and jumps their git history cannot explain. And a gap in a line is a release that was left out or could not be measured - not one that never happened.
Further reading: Wikipedia, McCabe, A Complexity Measure (1976), NIST 500-235.
By owner symfony sebastianbergmann doctrine laravel thephpleague spatie php-fig composer nextcloud PHPOffice phpDocumentor guzzle WordPress fruitcake matomo-org flarum Seldaek nikic barryvdh roots yiisoft aimeos phpstan DenverCoder1 reactphp phar-io dompdf ramsey paragonie cakephp googleapis bobthecow nunomaduro JakubOnderka pestphp api-platform kalcaddle openai-php php-http lcobucci Ocramius overtrue facebookarchive laminas antonioribeiro getsentry MarkBaker nette PHPCSStandards clue CarbonPHP typo3 eliashaeussler