magento-ecg/magniffer

An extendable, XPath driven, static code analysis tool for Magento, built on the top of PHP-Parser library.

Maintainers

👁 zlik

Package info

github.com/magento-ecg/magniffer

pkg:composer/magento-ecg/magniffer

Statistics

Installs: 585

Dependents: 0

Suggesters: 0

Stars: 73

Open Issues: 3

1.0 2015-03-23 01:13 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT b5b4611ae58d27e511b0f85cbd24dd5f9f052f45

This package is not auto-updated.

Last update: 2026-06-20 22:04:33 UTC


README

An extendable, XPath driven, static code analysis tool for Magento, built on the top of PHP-Parser library.

List of Detected Issues

  • SQL Queries Within a Loop
  • Not Limiting Collection Load Result
  • Empty Class
  • Empty Method
  • Expression is Always True
  • Empty Password in Configuration File
  • Handling Overly Broad Event
  • Use of Global Event
  • Configuration Not in adminhtml.xml.

Installation

With Composer:

composer require --dev magento-ecg/magniffer

Basic Usage

$ php ./vendor/bin/mgf /path/to/files

Extending

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