uinno / code-analysis
Review your code to detect, understand and fix issues fast. Security issues in code, Static Code Analysis, Refactoring issues, Coding Standards issues.
1.0.4
2022-06-24 10:32 UTC
Requires
- ext-dom: *
- ext-simplexml: *
- enlightn/security-checker: ^1.10
- friendsofphp/php-cs-fixer: ^3.2.1
- rector/rector: ^0.12.2 <0.12.21
- vimeo/psalm: ^4.12.0
Suggests
- icanhazstring/composer-unused: In additional we recommended install this plugin
- psalm/plugin-laravel: If Laravel is used, it is recommended install this plugin
- psalm/plugin-symfony: If Symfony is used, it is recommended install this plugin
- roave/security-advisories:dev-latest: In additional we recommended install this plugin
README
Description
Review your code to detect, understand and fix issues fast. Security issues in code, Static Code Analysis, Refactoring issues, Coding Standards issues.
Usage
$ composer require uinno/code-analysis --dev
$ composer require icanhazstring/composer-unused --dev
$ composer require roave/security-advisories:dev-latest --dev
$ composer require psalm/plugin-laravel --dev
(If you are using Laravel in your project.)- add folder configuration for
composer.json
"extra": { "code": { "rector": { "paths": [ "/app/Containers/AppSection" ], "skip": [ "/app/Ship/Migrations/*", "/app/Ship/Core/*", "/app/Containers/*/Data/Migrations/*", "/app/Containers/*/Data/Criterias/*", "/app/Containers/*/Routes/*" ] }, "cs-fixer": { "paths": [ "/app/Containers", "/config", "/database" ], "skip": [ "/bootstrap", "/resources", "/node_modules", "/public", "/storage", "/vendor" ] }, "psalm": { "paths": [ "/app/Containers" ], "skip": [ "/vendor" ], "config": { "plugins": { "pluginClass": [ {"class": "Psalm\\LaravelPlugin\\Plugin"} ] } } } } }
composer.json
"scripts": { "rector": [ "./vendor/bin/rector process --config=./vendor/uinno/code-analysis/code/configs/rector.php --clear-cache" ], "rector-check": [ "./vendor/bin/rector process --config=./vendor/uinno/code-analysis/code/configs/rector.php --clear-cache --dry-run" ], "php-cs-fixer": [ "./vendor/bin/php-cs-fixer fix --config=./vendor/uinno/code-analysis/code/configs/.php_cs.dist.php --allow-risky=yes --using-cache=no" ], "php-cs-fixer-check": [ "./vendor/bin/php-cs-fixer fix --dry-run --config=./vendor/uinno/code-analysis/code/configs/.php_cs.dist.php --diff -vv --allow-risky=yes --using-cache=no" ], "psalm": [ "php ./vendor/uinno/code-analysis/code/src/psalm_config.php --target=./psalm.xml", "./vendor/bin/psalm --threads=4 --no-cache --config=./psalm.xml", "rm ./psalm.xml" ], "enlightn-security-checker": [ "./vendor/bin/security-checker security:check ./composer.lock --format=json" ], "unused": [ "composer unused --no-progress" ], "validity": [ "composer validate --no-check-all --no-check-publish" ] }
TODO:
- runner for this tools