Dcomplexity

We have taken a number of open-source PHP projects, including several popular Drupal modules, and have passed them through PHPMetrics to evaluate their complexity.

The projects

The PHPMetrics tool itself
Max cyclomatic complexity: 32
Drupal core
Max cyclomatic complexity: 358
WordPress CMS
Max cyclomatic complexity: 1182
Magento
Max cyclomatic complexity: 476
Moodle
Max cyclomatic complexity: 4460
Token Drupal module
Max cyclomatic complexity: 306
Pathauto Drupal module
Max cyclomatic complexity: 37
CTools Drupal module
Max cyclomatic complexity: 185
Metatag Drupal module
Max cyclomatic complexity: 88
Webform Drupal module
Max cyclomatic complexity: 419
Field Group Drupal module
Max cyclomatic complexity: 27
Admin Toolbar Drupal module
Max cyclomatic complexity: 70
Redirect Drupal module
Max cyclomatic complexity: 16
Entity Drupal module
Max cyclomatic complexity: 35
Captcha Drupal module
Max cyclomatic complexity: 42
Entity Reference Revisions Drupal module
Max cyclomatic complexity: 98
Paragraphs Drupal module
Max cyclomatic complexity: 356
Libraries Drupal module
Max cyclomatic complexity: 8
IMCE Drupal module
Max cyclomatic complexity: 110
Views Drupal module
Max cyclomatic complexity: 469
Better Exposed Filters Drupal module
Max cyclomatic complexity: 109
Twig Tweak Drupal module
Max cyclomatic complexity: 36
Google Analytics Drupal module
Max cyclomatic complexity: 110
Search API Drupal module
Max cyclomatic complexity: 402

FAQ

Where can I find this project's source code?

On GitHub at https://github.com/dcycle/dcomplexity

What is the URL of this project?

https://dcomplexity.org

How can I build this website locally?

docker compose up and then visit http://localhost:4331

How can I test my own code with PHPMetrics?

Put your code in a directory called ./my-code and then run docker run -v "$(pwd)":/my --rm composer /bin/bash -c "composer require phpmetrics/phpmetrics && ./vendor/bin/phpmetrics --report-html=myreport /my/my-code && mv myreport /my/my-report"

How can I suggest a Drupal module to be added?

Add a pull request to https://github.com/dcycle/dcomplexity suggesting the module on the file ./docs/_data/projects.yml.

How often is the website updated?

Not often!

If I add a module to ./docs/_data/projects.yml, how can I update the website to include it?

./scripts/run.sh

Are you associated with the techno-jungle artist Dcomplexity?

No! I hadn’t event heard of him until today. He’s not bad, you should check him out.

How can I interpret the metrics shown on this website?

https://phpmetrics.github.io/website/metrics/

How can I contact you?

Via LinkedIn at https://www.linkedin.com/in/albertalbala

Do you have a slideshow about this, ideally in French?

Glad you asked: see here

Who made the preview image on social media posts?

I prompted ChatGTP with ‘I have a website where I run several open source PHP projects through PHPMetrics, a tool to determine their relative code complexity. I need to have a preview image for that, can you make one? It shouldn’t look like stock photography and should be rather sober, and contain no text’. So much for ‘contain no text’!