All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Upgrade to nikic/php-parser v5. Related BC Breaks are solved.
- Upgrade to PHPUnit 10.5
- Temporary remove Psalm as not compatible with nikic/php-parser v5.
- Remove Qodana as licence is mandatory
- PHP8 Issue Uncaught TypeError: round()
- Internal: Unit tests that were not updated from latest changes
- Internal: docker-releasing process when built-in docker image is no longer available.
- Add cyclomatic complexity for each method in a class
- Complexity table slightly updated to more comfortable table width
- Upgrade to PHPUnit 10.3
- Upgrade to Psalm 5.15
- Upgrade to Qodana 2023.2-eap
- Fatal error when analyzing snippets like
$a->{$b}
or$a->{<some_expression>}
. - Fatal error when analyzing snippets like
$a->{$b}()
or$a->{<some_expression>}()
.
- Update to PHPUnit 10.1
- Documentation: Fix #491 by adding the possibility of running PhpMetrics via
sh
rather thanphp
, for some OS.
- 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.
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.
- 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
- 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.
- 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 and Psalm and Qodana
- Internal: Make possible to create releases with suffixed names
- Minor UX/UI improvements on the HTML report.
- 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()
).
- Fixed errors in HTML template. (thanks @Hikingyo and @gemal)
- Improved README.md contents. (thanks @kudashevs)
- Fixed junit parameter in JSON configuration file
- Minor removals of unnecessary source code
- Remove wrong artefacts causing download issues
- Add favicon to HTML rendered pages (thanks @gemal)
- Add version to CSS and script to counter cache (thanks @gemal)
- Fixed issue with relative pat when using YAML configuration.
- Allow to search for patterns of code.
- Possibility to add custom violation rules via configuration.
- Allow to use YAML for configuration
- Add
--metrics
option to display documentation about some metrics calculated and used by PhpMetrics. - Exclude getters and setters from the CCN (cyclomatic complexity number) and LCoM (lack in cohesion of method) calculations
- Add
composer
option to enable or disable the composer packages analysis - Add
--report-summary-json
option to report a summarized information from the calculated metrics.
- Fixed issue with some columns in HTML reports
- Fixed compatibility issue where PHP 5 was no longer available on Debian systems (#434)
- Fixed issue with display of charts in groups (#429, #433)
- Fixed missing
composer.json
files when located in the root directory.
- Fixed path of violations HTML templates.
- Fixed error due to permission on generation of HTML report (#429)
- Fixed analysis on composer packages wrongly reported outdated when latest version is used. (#431)
- Way to group analysis by layer
- Improved UI
- Improved UI
- Fixed undefined constant PROJECT_DIR (#426)
- 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
- Explicitly define the class \Hal\Component\Ast\NodeTraverser to make PhpMetrics work using composer --classmap-authoritative. (#402)
- Ensure the packagist license is an array, so they can be displayed. (#404)
- Fix warning "Division by zero" when no package is defined. (#401)
- Move templates out of src
- Remove folders from phpcs
- Test the codebase against PHP 7.3 and 7.4
- Skip
self
andparent
from external dependencies of dependency graph (#370) thanks to (@lencse) - Don't leave notice when array is small in percentile function of loc report (#372) thanks to (@lencse)
- Fix parsing errors with PHP < 7 (#360, #361)
- Remain CCN for backward compatibility (#359, #362)
- CCN by classes is deprecated and will be removed in the next major release (#359, #362)
- Added package metrics (#283)
- Enhanced composer package comparison (#337, #342, thanks @juliendufresne)
- Better PHP 7 support (#335, #334, #336 thanks @carusogabriel)
- Support nikic/php-parser:^4 (#345, #347)
- 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)