An extendable, XPath driven, static code analysis tool for Magento, built on the top of PHP-Parser library.
An extendable, XPath driven, static code analysis tool for Magento, built on the top of PHP-Parser library.
With Composer:
composer require --dev magento-ecg/magniffer
$ php ./vendor/bin/mgf /path/to/files
It’s easy to create a custom inspection by declaring a message, xpath and inspector in YAML file. For example:
message : Empty Class
xpath : //node:Stmt_Class[count(subNode:stmts/scalar:array/*) = 0]/subNode:name/scalar:string
inspector : php