Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Php Metrics Laravel Package

halleck45/php-metrics

PhpMetrics analyzes PHP projects and classes, producing a readable HTML report packed with code metrics like cyclomatic complexity, maintainability index, and coupling. Install it as a dev dependency via Composer and run it against any folder to spot risky code and track quality over time.

View on GitHub
Deep Wiki
Context7
v2.11.0

What's Changed

Full Changelog: https://github.com/phpmetrics/PhpMetrics/compare/v2.10.0...v2.11.0

v2.10.0

What's Changed

New Contributors

Full Changelog: https://github.com/phpmetrics/PhpMetrics/compare/v2.9.1...v2.10.0

v2.9.0

What's Changed

New Contributors

Full Changelog: https://github.com/phpmetrics/PhpMetrics/compare/v2.8.2...v2.9.0

v3.0.0rc8

[3.0.0-rc8] - 2025-02-05

Fixes

  • Warning message on ExternalsVisitor.php
  • PHP Infection rolled back to 0.28 as 0.29 is not compatible with PHP 8.1

Updates

  • Upgrade Psalm to 6.3.0
v3.0.0rc7

[3.0.0-rc7] - 2025-02-04

Fixes

  • Fix numeric version array key in Composer\Packagist.php (thanks @Klemo1997)

Updates

  • Add OpenMetrics format (thanks @alanpoulain)
  • Re-add Psalm as it is now compatible with nikic/php-parser v5
  • Upgrade QA
v3.0.0rc6

[3.0.0-rc6] - 2024-02-08

Updates

  • Upgrade to nikic/php-parser v5. Related BC Breaks are solved. #503
  • Upgrade to PHPUnit 10.5
  • Temporary remove Psalm as not compatible with nikic/php-parser v5.
  • Remove Qodana as licence is mandatory
v3.0.0rc5

[3.0.0-rc5] - 2024-01-17

Fixes

v3.0.0rc4

[3.0.0-rc4] - 2023-09-15

New features

  • Add cyclomatic complexity for each method in a class
  • Complexity table slightly updated to more comfortable table width

Updates

  • Upgrade to PHPUnit 10.3
  • Upgrade to Psalm 5.15
  • Upgrade to Qodana 2023.2-eap
v3.0.0rc3

[3.0.0-rc3] - 2023-04-20

Fixed

  • Fatal error when analyzing snippets like $a->{$b} or $a->{<some_expression>}.
  • Fatal error when analyzing snippets like $a->{$b}() or $a->{<some_expression>}().

Updates

  • Update to PHPUnit 10.1
v3.0.0rc2

[3.0.0-rc2] - 2023-04-17

New features

  • Documentation: Fix #491 by adding the possibility of running PhpMetrics via sh rather than php, for some OS.

Fixed

  • Fatal error when analyzing snippets like $a->$b() or $c().
  • Special versions are now taken into account on artefacts/bintray.json when a new release comes out.
v3.0.0rc1

[3.0.0-rc1] - 2023-04-11

This new major version is containing lots of internal re-architecture processes in the source code, and upgrades the internal quality of PhpMetrics to a new level. Nevertheless, it contains also some BC Breaks and some metrics are remove. Please take a look at the detailed changelog below if you experiment any trouble.

BC Break

  • PhpMetrics 3.0 is requiring PHP 8.1 minimum. To parse projects that are not yet in PHP 8.1, please use a docker installation based on a PHP 8.1 Docker Image
  • Git and JUnit plugins are no longer allowed in the configuration file

Removed

  • Installation and usage from Debian package. Please use the phar, composer, or docker instead
  • Metric removed: Git related metrics
  • Metric removed: PHPUnit related metrics
  • Metric removed: PageRank metric
  • Metric removed: On System Complexity, totalStructuralComplexity, totalDataComplexity and totalSystemComplexity.
  • Metric removed: On class-method enumeration, nbGetters and nbSetters are removed as no particular metric needs them.

New features

  • Internal: Install a real dedicated QA system to secure PhpMetrics as mch as possible
  • Internal: QA System is composed of PHP_CodeSniffer, PHPUnit, PHP Infection, PHPStan, Psalm and Qodana
  • Internal: Make possible to create releases with suffixed names
  • Minor UX/UI improvements on the HTML report.

Fixed

  • Internal: QA completely upgraded. PHPCS, PHPStan, Psalm and Qodana are no longer having errors except on baseline. Coverage is very close to 100%. All unit tests are passing. Mutation Score >94%. Some improvements are yet to come
  • Metric calculations: Fix LCoM calculation that was not able to understand promoted properties in constructor.
  • Metric calculations: Ignore PHP Attributes in the detection of getters and setters. This fixes LCoM calculation.
  • Metric calculations: Improve calculation on Afferent Coupling and Efferent Coupling (+ related metrics) thanks to enlarged context of external classes usages detection.
  • Metric calculations: Take NullSafeMethodCall ($x?->y()) into account for WeightMethodCount and Cyclomatic Complexity calculation.
  • Metric calculations: Take NullSafePropertyFetch ($x?->y) into account for WeightMethodCount and Cyclomatic Complexity calculation.
  • Metric calculations: Take newly introduced match structure into account for WeightMethodCount and Cyclomatic Complexity calculation.
  • Metric calculations: Improve KanDefect metrics as match are now took into account as number of selects, along with switches.
  • Metric calculations: On System Complexity, relative complexities are now calculated including NullSafeMethodCall ($x?->y()).
v2.8.1

Fixing issue with relative path when using YAML configuration

v2.8.0

Major release with

New features

  • allows to search patterns of code. Instead of providing our own rules, now we can add dynamic rules for violations.
  • allows also to use yaml for configuration.
  • adds a --metrics option
  • excludes getters and setters for ccn and lcom calculation
  • adds a composer option
  • adds a new --report-summary-json option

Fixes

  • Issue with columns in HTML report
v2.7.3

Include by default composer.json files located in the root dir

v2.7.2
v2.7.1

Fix #431 Fix #429

v2.7.0
  • improved UI
  • way to group analysis by layer
v2.6.2
  • Improved UI
v2.6.0

New features

  • Way to download report
  • Way to download chart
  • Resolve PHP7 getters / setters (#405)
  • Add metrics description file
  • Add a carousel in the main HTML report page to display both graph at the same time

Fixes

Explicitly define the class \Hal\Component\Ast\NodeTraverser to make PhpMetrics work using composer --classmap-authoritative. (#402) Ensure the packagist license iœs an array so they can be displayed. (#404) Fix warning "Division by zero" when no package is defined. (#401)

Misc

  • move templates out of src
  • Remove folders from phpcs
v2.5.0
v2.4.1

Fixed

  • Fix parsing errors with PHP < 7 (#360, #361)
  • Remain CCN for backward compatibility (#359, #362)

Deprecated

  • CCN by classes is deprecated and will be removed in the next major release (#359, #362)
v2.4.0

Added

  • Added package metrics (#283)

Changed

  • Enhanced composer package comparison (#337, #342 thanks @juliendufresne)
  • Better PHP 7 support (#335, #334, #336 thanks @carusogabriel)
  • Support nikic/php-parser:^4 (#345, #347)

Fixed

  • Refine Cyclomatic Complexity Metric (#343, #344, #353, #357, #358, thanks @fabianbadoi)
  • Improved composer package version comparison (#337, thanks @juliendufresne)
  • Resolved root path exclusion conflict (#355, thanks @fabianbadoi)
  • Fixed getter and setter detection with types (#335, #336, thanks @jakagacic)
  • Fixed documentation URL (#321, thanks @ottaviano)
  • Fix non unique block ids in HTML output (#356, thanks @dumith-erange)
  • Fix rounding of metrics (#339, thanks @ssfinney)
v2.3.2
v2.3.1
v2.3.0
v2.2.0
  • New metric: ccnMethodMax (maximum cyclomatic complexity of methods for class)
  • New report: composer dependencies versions
  • New report: composer dependencies licenses
  • HTML report is now responsive
  • Simplified README
  • Bugfix #276

Due to bug with .deb artifact factory, this release has no debian package yet

v2.1.0
  • Improved Junit report
  • Improved UI
  • Removed support of PHP 5.4
  • Fixed majors bugs with code parsing
  • Improved CI
  • removed Symfony/Console
v2.0.0
v2.0.0-rc
untagged-4292660c70b29c4b16b3
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
roundly-consulting/kubernetes-api-for-laravel
roundly-consulting/plausible-for-laravel
gvp/gvp-laravel-template
metasyncsite/laravel-metasync-client
roundly-consulting/onboarding-for-laravel
andydefer/laravel-notification
adachsoft/cli-process-tester
jhaskell13/laraflow
sebastienheyd/boilerplate-media-manager
ccast/tagixo-primix
pretendtrue/laravel-builder
sawmainek/laravel-scout-tntsearch-driver
tomshaw/laravel-calendar-table
dibakar/laravel-ownership
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo