forked from phpmetrics/PhpMetrics
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Andrii Havryliuk edited this page Oct 23, 2024
·
2 revisions
This is a fork of https://github.com/phpmetrics/PhpMetrics with some adjustments to make package dependencies for Shopware more understandable.
- Added configuration option
package-depth
to make package dependencies report more coarse-grained (0 will switch to default behavior) - Added configuration option
package-exclude
to exclude from report namespaces starting with one of provided prefixes. For more details see PackageSieve and it's usages.
- Clone repository
- Checkout 3.x-custom-package-resolution branch
- Run
composer install
- Create configuration file
phpmetrics.json
:
{
"composer": true,
"includes": [
"src",
"custom/plugins/SwagCommercial/src",
"custom/plugins/SaasRufus/src"
],
"excludes": [
"Test.php",
"_fixture",
"vendor"
],
"extensions": [
"php"
],
"groups": [
{
"name": "Core",
"match": "!^Shopware\\\\Core\\\\!"
},
{
"name": "Administration",
"match": "!^Shopware\\\\Administration\\\\!"
},
{
"name": "Elasticsearch",
"match": "!^Shopware\\\\Elasticsearch\\\\!"
},
{
"name": "Storefront",
"match": "!^Shopware\\\\Storefront\\\\!"
},
{
"name": "WebInstaller",
"match": "!^Shopware\\\\WebInstaller\\\\!"
},
{
"name": "Migration",
"match": "!migration!i"
},
{
"name": "Commercial",
"match": "!^Shopware\\\\Commercial\\\\!"
},
{
"name": "Rufus",
"match": "!^Swag\\\\SaasRufus\\\\!"
}
],
"package-depth": 4,
"package-exclude": [
"Shopware\\Core\\Migration\\V6_3\\",
"Shopware\\Core\\Migration\\V6_4\\",
"Shopware\\Core\\Migration\\V6_5\\",
"Shopware\\Core\\Migration\\V6_6\\",
"Shopware\\Core\\Migration\\V6_7\\",
"Shopware\\Core\\Framework\\DataAbstractionLayer\\",
"Symfony\\",
"Doctrine\\"
],
"plugins": {
}
}
- Run analysis
php ./path_to_the_code/bin/phpmetrics --config=phpmetrics.json --report-html=phpmetrics_report --report-json=phpmetrics_report.json