Magento Project Mess Detector

Related tags

Miscellaneous mpmd
Overview

Magento Project Mess Detector

Author: Fabrizio Branca (fbrnc.net / @fbrnc)

Build Status

Some additional commands for the excellent n98-magerun Magento command-line tool that will help you find out how messed up a Magento instance is :)

n98-magerun.phar | grep mpmd
mpmd
 mpmd:codepooloverrides                  Find all code pool overrides
 mpmd:corehacks                          Find all core hacks
 mpmd:dependencycheck                    Find dependencies
 mpmd:dependencycheck:configured         Returns the list of modules that are CONFIGURED in these module's config xml.
 mpmd:dependencycheck:graph:class        Creates a class graph
 mpmd:dependencycheck:graph:configured   Creates a graph of all configured depencencies.
 mpmd:dependencycheck:graph:module       Creates a module graph
 mpmd:dependencycheck:verify             Checks if found dependencies match a given module's xml file

Table of Contents

Installation

There are a few options. You can check out the different options in the MageRun docs.

Here's the easiest:

  1. Install n98-magerun if you haven't already. Find the instructions on the n98-magerun wiki.

  2. Create ~/.n98-magerun/modules/ if it doesn't already exist. (or /usr/local/share/n98-magerun/modules or put your modules inside your Magento instance in lib/n98-magerun/modules if you prefer that)

mkdir -p ~/.n98-magerun/modules/
  1. Clone the mpmd repository in there.
git clone https://github.com/AOEpeople/mpmd.git ~/.n98-magerun/modules/mpmd
  1. It should be installed. To verify that it was installed correctly, check if the new commands show up in the command list:
n98-magerun.phar | grep mpmd

Commands

Command mpmd:corehacks

Usage:
 mpmd:corehacks [--format[="..."]] pathToVanillaCore [htmlReportOutputPath] [skipDirectories]

Arguments:
 pathToVanillaCore     Path to Vanilla Core used for comparison
 htmlReportOutputPath  Path to where the HTML report will be written
 skipDirectories       ':'-separated list of directories that will not be considered (defaults to '.svn:.git')

This command requires a vanilla version of Magento (same version and edition! Run n98-magerun.phar sys:info for more details) to be present somewhere in the filesystem. It will then traverse all project files and compare them with the original files. This command will also be able to tell the difference between whitespace or code comments changes and real code changes. It will generate a HTML report that also includes the diffs.

$ cd /var/www/magento/htdocs
$ n98-magerun.phar mpmd:corehacks /path/to/vanilla/magento /path/to/report.html
Comparing project files in 'var/www/magento/htdocs' to vanilla Magento code in '/path/to/vanilla/magento'...
+----------------------+-------+
| Type                 | Count |
+----------------------+-------+
| differentFileContent | 2     |
| identicalFiles       | 16049 |
| fileMissingInB       | 1     |
| sameFileButComments  | 0     |
+----------------------+-------+
Generating detailed HTML Report

Report preview:

Image

Command: mpmd:codepooloverrides

Usage:
 mpmd:codepooloverrides [--format[="..."]] [htmlReportOutputPath] [skipDirectories]

Arguments:
 htmlReportOutputPath  Path to where the HTML report will be written
 skipDirectories       ':'-separated list of directories that will not be considered (defaults to '.svn:.git')

This command will compare all code pools with each other and detect files that are overriding each other. It will show identical files (What's the point of these? But yes, seen projects where this happened), copied files with changes in comments and whitespace only, and real changes. Of course with diff...

Report preview:

Image

Dependency Checker

The dependency checker parses one or more files or directories and detects PHP classes that are being "used" there.

How does it work?

The dependency checker is a "semi" static code analysis tool. That means it does the job without actually executing any of the PHP code you're pointing it to, but it does need that module to be installed correctly and it will invoke the Magento framework to resolve classpaths (catalog/product -> Mage_Catalog_Model_Product)

Why?

While tools like pdepend exist those tools don't know anything about Magento in general, Magento's special classpaths and where they are being used. Also sometimes the numbers generated by pdepend are a little overwhelming and after all what are you going to do knowing that you're module has an avarage cyclomatic complexity of x?

The mpmd:dependencychecker will

  • help you to detect other Magento modules that the module you're currently looking at depends on.
  • check you module's configuration and let's you know if all actual dependencies are declared correctly and will also show if the module is declaring dependencies that this tool didn't detect (Note: this tool isn't perfect, so please double check before removing any dependencies)
  • show you the relations between modules and individual classes
  • produce pretty graphs that you can render with Graphviz
  • help you detect code that requires some refactoring and will help you create cleaner - less dependent - modules in the first place.

Parsers

The dependency checker comes with two different parsers (and allows you to add new ones:)

Parser Will process How it works
Tokenizer *.php, *.phtml The tokenizer parser will split the PHP file into tokens and traverses them. Handlers can subscribe to token to detect various class usages.
Xpath *.xml The xpath parser will read the file into a SimpleXMLElement object and will pass this to all the subscribed handlers

How to add your own parser

Add a new parser via n98-magerun's YAML configuration

commands:
  Mpmd\Magento\DependencyCheckCommand:
    parsers:
      - Mpmd\DependencyChecker\Parser\Tokenizer
      - Mpmd\DependencyChecker\Parser\Xpath
      - (... add your parser here ...)

All parsers need to implement Mpmd\DependencyChecker\Parser\ParserInterface. Also checkout the AbstractParser that implements that interface and might be a good starting point.

Handlers

Every parser comes with a number of handlers. Here's the list of default handlers that come with the dependency checker:

Parser Handler Will process What it does
Tokenizer Interfaces T_IMPLEMENTS Finds interfaces: class A implements B {}
Tokenizer WhitespaceString T_NEW, T_EXTENDS, T_CLASS Finds classes instantiated with 'new': $a = new B();
Finds extended classes: class A extends B {}
Tokenizer StaticCalls T_DOUBLE_COLON Finds static calls: A::B and A::B()
Tokenizer TypeHints T_FUNCTION Finds type hints: function a (B $b) {}
Tokenizer MagentoFactoryMethods T_STRING for specific keywords Finds classes instantiated with one of Magento's factory methods and resolves them to real PHP classes not taking rewrites into account:
Mage::getModel()
Mage::getSingleton()
Mage::getResourceModel()
Mage::getResourceSingleton()
$this->getLayout()->createBlock()
Mage::getBlockSingleton()
Mage::helper()
Mage::getResourceHelper()
Mage::getControllerInstance()
Xpath LayoutXml All xml files Finds blocks and resolves them into real PHP classes:
Xpath SystemXml All xml files Finds references to models in system.xml files:
adminhtml/system_config_form_field_notification
adminhtml/system_config_source_yesno
adminhtml/system_config_backend_store

Note: MagentoFactoryMethods, LayoutXml and SystemXml need to resolve Magento classpaths into real PHP classes. The challenge hereby is NOT to take rewrites into account since rewriting a class is a mechanism that was introduced to ALLOW decoupling without dependending on each other. In order to leverage Magento and it's configuration to resolve the class paths but not take the rewrite into accounts

  • the module that we're testing needs to be installed into a functioning Magento environment and all dependencies must be fulfilled
  • we need to "trick" something into being Mage_Core_Model_Config having access to the same data but doing things slightly differently. Mpmd\Util\MagentoFactory takes care of that and provides access to some of the original functions like getModelClassName() and getBlockClassName()...

How to add your own handler

Add a new handler via n98-magerun's YAML configuration (also checkout n98-magerun's documentation for custom commands)

commands:
  Mpmd\Magento\DependencyCheckCommand:
	Mpmd\DependencyChecker\Parser\Tokenizer:
      handlers:
        - Mpmd\DependencyChecker\Parser\Tokenizer\Handler\WhitespaceString
        - Mpmd\DependencyChecker\Parser\Tokenizer\Handler\Interfaces
        - (... add your tokenizer handler here ...)
    
   
    :
      handlers:
        - (... add your 
    
      handler here ...)    

    
   

All handlers need to implement Mpmd\DependencyChecker\HandlerInterface. Also checkout the AbstractHandler and the inheriting abstract handlers for the tokenizer parser and the xpath parser that implement that interface and might be a good starting point.

Specifying sources

Almost every command (and sub-command) of the dependency checker requires you to specify what you want to analyze. This can be one or more files or directories. And glob patterns are also supported. Here are some examples:

# Single file:
$ n98-magerun.phar mpmd:dependencycheck -m app/code/local/My/Module/Model/Test.php

# Full directory:
$ n98-magerun.phar mpmd:dependencycheck -m app/code/local/My/Module/

# Full modman directory (will also find the files you might have in app/design/):
$ n98-magerun.phar mpmd:dependencycheck -m .modman/My_Module

# Glob patterns are supported:
$ n98-magerun.phar mpmd:dependencycheck -m app/code/local/My/*/
$ n98-magerun.phar mpmd:dependencycheck -m app/code/local/*/*/
$ n98-magerun.phar mpmd:dependencycheck -m app/code/*/*/*/

# Multiple locations 
$ n98-magerun.phar mpmd:dependencycheck -m app/code/local/My/Module/ app/code/community/My/OtherModule/ app/design/frontend/mypackage

Note: Please specify absolute paths or paths relative to your Magento root directory (not relative to the current directory, which might be different if n98-magerun detected Magento in a different directory (e.g. htdocs/) or you're using --root-dir=... to tell n98-magerun where to find your Magento root)

Command: mpmd:dependencychecker

This is the main command that gives you access to following options (specify one or more):

Option Short option What it does
--modules -m This shows you all modules that were detected in the specified sources and the modules that this code depends on.
--libraries -l This shows you all the libraries (lib/*) that the specified sources depend on
--classes -c This detects all the classes in the specified sources (where available) and shows what other classes they are using and how.
--details -d This shows all the details (verbose!)

Examples:

Modules -m|--modules
$ n98-magerun.phar mpmd:dependencycheck -m app/code/core/Mage/Captcha

+---------------+----------------+
| Source Module | Target Module  |
+---------------+----------------+
| Mage_Captcha  | Mage_Core      |
| Mage_Captcha  | Mage_Admin     |
| Mage_Captcha  | Mage_Customer  |
| Mage_Captcha  | Mage_Checkout  |
| Mage_Captcha  | Mage_Adminhtml |
+---------------+----------------+
Libraries -l|--libraries
$ n98-magerun.phar mpmd:dependencycheck -l app/code/core/Mage/Captcha

+-----------+
| Libraries |
+-----------+
| Varien    |
| Zend      |
+-----------+
Classes -c|--classes
$ n98-magerun.phar mpmd:dependencycheck -c app/code/core/Mage/Captcha

+------------------------------------------+-----------------------------------------+--------------------------+
| Source class                             | Target Class                            | Access Types             |
+------------------------------------------+-----------------------------------------+--------------------------+
| Mage_Captcha_Block_Captcha               | Mage_Core_Block_Template                | extends                  |
| Mage_Captcha_Block_Captcha               | Mage_Captcha_Helper_Data                | helper                   |
| Mage_Captcha_Block_Captcha_Zend          | Mage_Core_Block_Template                | extends                  |
| Mage_Captcha_Block_Captcha_Zend          | Mage_Captcha_Helper_Data                | helper                   |
| Mage_Captcha_Model_Config_Form_Backend   | Mage_Captcha_Model_Config_Form_Abstract | extends                  |
| Mage_Captcha_Model_Config_Form_Abstract  | Mage_Core_Model_Config_Data             | extends                  |
| Mage_Captcha_Model_Config_Form_Frontend  | Mage_Captcha_Model_Config_Form_Abstract | extends                  |
...
Details -d|--details
$ n98-magerun.phar mpmd:dependencycheck -d app/code/core/Mage/Captcha

+------------------------------------------------------------------------+------------------+-------------------------------------------------+
| File                                                                   | Access Type      | Class                                           |
+------------------------------------------------------------------------+------------------+-------------------------------------------------+
| app/code/core/Mage/Captcha/Block/Captcha.php                           | class            | Mage_Captcha_Block_Captcha                      |
| app/code/core/Mage/Captcha/Block/Captcha.php                           | extends          | Mage_Core_Block_Template                        |
| app/code/core/Mage/Captcha/Block/Captcha.php                           | helper           | Mage_Captcha_Helper_Data                        |
| app/code/core/Mage/Captcha/Block/Captcha/Zend.php                      | class            | Mage_Captcha_Block_Captcha_Zend                 |
| app/code/core/Mage/Captcha/Block/Captcha/Zend.php                      | extends          | Mage_Core_Block_Template                        |
| app/code/core/Mage/Captcha/Block/Captcha/Zend.php                      | helper           | Mage_Captcha_Helper_Data                        |
| app/code/core/Mage/Captcha/etc/system.xml                              | source_model     | Mage_Adminhtml_Model_System_Config_Source_Yesno |
| app/code/core/Mage/Captcha/etc/system.xml                              | source_model     | Mage_Captcha_Model_Config_Font                  |
...

Command: mpmd:dependencychecker:verify

This command compares the actual dependencies detected by looking at the code with the ones declared for a given module (specify with -m )

Example:

$ n98-magerun.phar mpmd:dependencycheck:verify -m Mage_Catalog app/code/core/Mage/Catalog

+---------------------+---------------------------------------------+--------------+
| Declared Dependency | Actual Dependency                           | Status       |
+---------------------+---------------------------------------------+--------------+
| Mage_Cms            | Mage_Cms                                    | OK           |
| Mage_Dataflow       | Mage_Dataflow                               | OK           |
| Mage_Eav            | Mage_Eav                                    | OK           |
| Mage_Index          | Mage_Index                                  | OK           |
| -                   | Mage_Adminhtml                              |  Undeclared  |
| -                   | Mage_Api2                                   |  Undeclared  |
| -                   | Mage_Api                                    |  Undeclared  |
| -                   | Mage_Bundle                                 |  Undeclared  |
| -                   | Mage_CatalogIndex                           |  Undeclared  |
...

In this example you can see how Mage_Catalog only declares dependencies to Mage_Cms, Mage_Dataflow, Mage_Eav and Mage_Index. But in reality Mage_Catalog depends on many more modules...

Note: Since pointing to a directory in app/code/ will not take the layout and template files into account that might belong to a module and will potentiallu also introduce dependencies it is recommended to always include all relevant directories to the source parameter, or - in case you're using modman and everything lives in a separate directory anyway point this command to that directory instead:

n98-magerun.phar mpmd:dependencycheck:verify -m My_Module ../.modman/My_Module

Command: mpmd:dependencychecker:configured

This command returns a list of all configured dependencies (taken from config xml). This (and the corresponding mpmd:dependencychecker:graph:configured) is the only command that does not analyze any files but only reads the dependencies from the configuration.

The command accepts one or more module and also supports glob-like patterns:

Examples

# Single module
$ n98-magerun.phar mpmd:dependencycheck:configured My_Module

# Two modules 
$ n98-magerun.phar mpmd:dependencycheck:configured My_Module My_OtherModule

# Wildcard(s)
$ n98-magerun.phar mpmd:dependencycheck:configured 'Mage_*' 'Enterprise_*'

# All modules
$ n98-magerun.phar mpmd:dependencycheck:configured '*'

Note: since bash might replace your glob syntax with different paths in case they match something in the current directory you should wrap any glob patterns in 'single quotes'/

Command: mpmd:dependencychecker:graph:module

This command will render a dependency graph for the relevant modules as a dot file. Use the Graphviz tool (Ubuntu: sudo apt-get install graphviz) to create a svg (or many other formats). Feel free to modify the dot-file to match any different styling. Find a full reference on the Graphviz website.

Example:

$ n98-magerun.phar mpmd:dependencycheck:graph:module app/code/core/Mage/* | dot -Tsvg -o mage.svg

# or:
$ n98-magerun.phar mpmd:dependencycheck:graph:module app/code/core/Mage/* > mage.dot
# customize your graph in mage.dot...
$ dot -Tsvg mage.dot -o mage.svg

Here's a tiny(!) crop of the graph generated in this example (click the image for a full-sized svg). Sadly there are a ton of dependencies in the Magento core (and most likely also in your modules) so these graphs can quickly grow pretty huge:

Image

Command: mpmd:dependencychecker:graph:class

While the previous command shows you a higher level view on modules only, mpmd:dependencychecker:graph:class will drill down into individual classes and optionally group them by module. Consider this graph "zooming in" into the modules in order to find out what classes are responsible for the dependency.

The graph shows different line types:

Style Type
Solid Inheritance: extends, implements
Dashed Composition: new, type_hints, get*, blocks, source/backend/frontend_model
Dotted everything else (static calls)

(This might require some better categorization (e.g. implements != inheritance, type hint != composition)

Example:

# ungrouped
$ n98-magerun.phar mpmd:dependencycheck:graph:class app/code/core/Mage/Captcha | dot -Tpng -o Mage_Captcha.png

# grouped
$ n98-magerun.phar mpmd:dependencycheck:graph:class --group app/code/core/Mage/Captcha | dot -Tpng -o Mage_Captcha.png
Ungrouped Grouped
Image Image

Command: mpmd:dependencychecker:graph:configured

This command will create a graph from the configured dependencies. The syntax is the same used in mpmd:dependencychecker:configured:

Example:

$ n98-magerun.phar mpmd:dependencycheck:graph:configured 'Mage_*' | dot -Tsvg -o Mage.svg

Disclaimer: There's a good chance that some dependencies are not detected at all (actually if variables are being used when instanciating object like Mage::getModel($modelClass);, Mage::getModel("acme/$model"); or new $class() then mpmd is ignoring those - and there might be some more scenarious where mpmd might be missing some dependencies). Please do not solely rely on the mpmd report while refactoring or before removing any modules!

How to run the unit tests

This plugin comes with unit tests. These unit tests will run outside of any n98-magerun or Magento context (they will mock everything from there). Running them by simply calling phpunit in the root directory. Also check the project out on Travis CI where the tests will be run on every commit.

phpunit --debug

Interesting Graphviz commands

There's a ton of things you can do with Graphviz. Starting from choosing different layouts to clustering nodes and coloring nodes and/or edges differently (e.g. by namespace or code pool?). Here are some examples:

In the following examples I replaced all nodes with simple black dots connected with black lines:

edge [arrowhead=vee, arrowtail=inv, arrowsize=.7, color="black"];
node [fontname="verdana", fixedsize=true, width="0.3", shape=point, style="filled", fillcolor="black"];

Replace splines with straight lines:

splines=false;

Circle pattern:

layout=circo;

Radial pattern:

layout=twopi;
Configured dependencies
mpmd:dependencycheck:graph:configured 'Mage_*'
Actual dependencies
mpmd:dependencycheck:graph:module 'app/code/core/Mage/*'
Image Image

No overlapping:

overlap=false;
layout=twopi;

(Click for svg) Image

Comments
  • Create different changetype for whitespace diffs

    Create different changetype for whitespace diffs

    This removes spam from whitespace changes between the fresh copy and the existing copy.

    Example:

    So much nicer than having 13724 "diferentFileContent" with blank diffs.

    opened by navarr 6
  • PHP Warning:  Unterminated comment starting line 28 in /home/vagrant/.n98-magerun/modules/mpmd/src/Mpmd/Util/Compare.php on line 114

    PHP Warning: Unterminated comment starting line 28 in /home/vagrant/.n98-magerun/modules/mpmd/src/Mpmd/Util/Compare.php on line 114

    Got this while running the command: PHP 5.3.10-1ubuntu3.16 with Suhosin-Patch (cli)

    PHP Warning:  Unterminated comment starting line 28 in /home/vagrant/.n98-magerun/modules/mpmd/src/Mpmd/Util/Compare.php on line 114
    PHP Stack trace:
    PHP   1. {main}() /usr/local/bin/n98-magerun.phar:0
    PHP   2. N98\Magento\Application->run() /usr/local/bin/n98-magerun.phar:8
    PHP   3. Symfony\Component\Console\Application->run() phar:///usr/local/bin/n98-magerun.phar/src/N98/Magento/Application.php:583
    PHP   4. N98\Magento\Application->doRun() phar:///usr/local/bin/n98-magerun.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:126
    PHP   5. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/n98-magerun.phar/src/N98/Magento/Application.php:523
    PHP   6. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/n98-magerun.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:195
    PHP   7. N98\Magento\Command\AbstractMagentoCommand->run() phar:///usr/local/bin/n98-magerun.phar/vendor/symfony/console/Symfony/Component/Console/Application.php:882
    PHP   8. Symfony\Component\Console\Command\Command->run() phar:///usr/local/bin/n98-magerun.phar/src/N98/Magento/Command/AbstractMagentoCommand.php:427
    PHP   9. Mpmd\Magento\CoreHacksCommand->execute() phar:///usr/local/bin/n98-magerun.phar/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:253
    PHP  10. Mpmd\Util\Compare->compareDirectories() /home/vagrant/.n98-magerun/modules/mpmd/src/Mpmd/Magento/CoreHacksCommand.php:78
    PHP  11. Mpmd\Util\Compare->compareDirectories() /home/vagrant/.n98-magerun/modules/mpmd/src/Mpmd/Util/Compare.php:46
    PHP  12. Mpmd\Util\Compare->compareDirectories() /home/vagrant/.n98-magerun/modules/mpmd/src/Mpmd/Util/Compare.php:46
    PHP  13. Mpmd\Util\Compare->compareDirectories() /home/vagrant/.n98-magerun/modules/mpmd/src/Mpmd/Util/Compare.php:46
    PHP  14. Mpmd\Util\Compare->compareDirectories() /home/vagrant/.n98-magerun/modules/mpmd/src/Mpmd/Util/Compare.php:46
    PHP  15. Mpmd\Util\Compare->compareFiles() /home/vagrant/.n98-magerun/modules/mpmd/src/Mpmd/Util/Compare.php:55
    PHP  16. Mpmd\Util\Compare->getFileContentWithoutComments() /home/vagrant/.n98-magerun/modules/mpmd/src/Mpmd/Util/Compare.php:84
    PHP  17. token_get_all() /home/vagrant/.n98-magerun/modules/mpmd/src/Mpmd/Util/Compare.php:114
    
    opened by connerbw 1
  • fix subdirectory scan bug

    fix subdirectory scan bug

    I had the problem, that the corehacks scanner only compared the root directory files and ignored all subdirectorys (eg. app/...).

    This small change fix the problem.

    opened by DevertNet 0
  • Default value for output file

    Default value for output file

    There should be some sensible default for [htmlReportOutputPath]. Also, the name of the variable is misleading. Although it states "Path" in reality the argument must include a file name.

    This won't work:

    $ n98 mpmd:corehacks ../path-to-vanilla-magento report/
    

    while this does:

    $ n98 mpmd:corehacks ../path-to-vanilla-magento report/report.html
    
    opened by riker09 0
  • diff not filled on smartos

    diff not filled on smartos

    Hi,

    Well done for your initiative on this project. However, I have an empty diff and plenty of logs when I run commands on my preprod server running on smartOS :

    ~/magerun/n98-magerun.phar | grep mpmd
    mpmd mpmd:codepooloverrides Find all code pool overrides mpmd:corehacks Find all core hacks mpmd:dependencycheck Find dependencies mpmd:dependencycheck:configured Returns the list of modules that are CONFIGURED in these module's config xml. mpmd:dependencycheck:graph:class Creates a class graph mpmd:dependencycheck:graph:configured Creates a graph of all configured depencencies. mpmd:dependencycheck:graph:module Creates a module graph mpmd:dependencycheck:verify Checks if found dependencies match a given module's xml file ~/magerun/n98-magerun.phar mpmd:corehacks ~/magerun/1.4.1.1 ~/magerun/reports/corehacks.html Comparing project files in '/preprod/magento' to vanilla Magento code in '/magerun/1.4.1.1'... +-----------------------+-------+ | Type | Count | +-----------------------+-------+ | differentFileContent | 171 | | identicalFiles | 8312 | | fileMissingInB | 6 | | sameFileButComments | 0 | | sameFileButWhitespace | 819 | +-----------------------+-------+ diff: illegal option -- B usage: diff [-bitw] [-c | -e | -f | -h | -n | -u] file1 file2 diff [-bitw] [-C number | -U number] file1 file2 diff [-bitw] [-D string] file1 file2 diff [-bitw] [-c | -e | -f | -h | -n | -u] [-l] [-r] [-s] [-S name] directory1 directory2 diff: illegal option -- B usage: diff [-bitw] [-c | -e | -f | -h | -n | -u] file1 file2 diff [-bitw] [-C number | -U number] file1 file2 diff [-bitw] [-D string] file1 file2 diff [-bitw] [-c | -e | -f | -h | -n | -u] [-l] [-r] [-s] [-S name] directory1 directory2 ..... usage: diff [-bitw] [-c | -e | -f | -h | -n | -u] file1 file2 diff [-bitw] [-C number | -U number] file1 file2 diff [-bitw] [-D string] file1 file2 diff [-bitw] [-c | -e | -f | -h | -n | -u] [-l] [-r] [-s] [-S name] directory1 directory2 diff: illegal option -- B usage: diff [-bitw] [-c | -e | -f | -h | -n | -u] file1 file2 diff [-bitw] [-C number | -U number] file1 file2 diff [-bitw] [-D string] file1 file2 diff [-bitw] [-c | -e | -f | -h | -n | -u] [-l] [-r] [-s] [-S name] directory1 directory2 Generating detailed HTML Report Writing HTML report to: /magerun/reports/corehacks.html

    As you can see, diff command haven't all attributes here. I will try to launch those commands on my computer instead of in preprod machine, but I just wanted to report this in case you want to fix it.

    Thanks

    Nicolas DEPOILLY

    opened by NicolasDepoilly 0
  • Replace dependencychecker with dependencycheck

    Replace dependencychecker with dependencycheck

    When using examples from Readme we received warnings:

      [InvalidArgumentException]
      There are no commands defined in the "mpmd:dependencychecker" namespace.
      Did you mean one of these?
          mpmd:dependencycheck:graph
          mpmd:dependencycheck
          mpmd
    
    

    This indicates that the module was renamed at some point ... or the Readme is just incorrect.

    opened by philwinkle 0
  • Separate Patched files into their own group

    Separate Patched files into their own group

    These PR creates a new section in the corehack report that separates and lists out files that the patch log says have been patched.

    An example, a repository compared with a version of Magento patched with the same patches, plus a modification to a file to show that the Diff functionality continues to exist in this section.

    opened by navarr 1
  • No file found or Invalid filter

    No file found or Invalid filter

    We are having issue in this, if you can help us solving the missing part. when we run command it says no file found if we put trailing slash before the PATH and if we dont put it says invalid filters.

    $ n98-magerun.phar mpmd:dependencycheck -d app/code/core/Mage/Captcha OR $ n98-magerun.phar mpmd:dependencycheck -d /app/code/core/Mage/Captcha

    opened by platonicsolz 1
  • dependencycheck: Expected token

    dependencycheck: Expected token "T_STRING", got token "T_VARIABLE"

    I'm getting this error when trying to run the dependency check:

    magerun -vvv mpmd:dependencycheck  -m app/code/local/SDM/*/
    Load dist config
    Search for Magento in folder /Users/steverobbins/html/ellison
    Found Magento in folder /Users/steverobbins/html/ellison
    Load plugin config /Users/steverobbins/.n98-magerun/modules/magerun-addons/n98-magerun.yaml
    Load plugin config /Users/steverobbins/.n98-magerun/modules/mpmd/n98-magerun.yaml
    DEBUG
    T_DOUBLE_ARROW: =>
    T_WHITESPACE:  
    T_VARIABLE: $visibility
    ==> T_DOUBLE_COLON: ::
    T_STRING: VISIBILITY_NOT_VISIBLE
    ): )
    T_WHITESPACE: 
    
    ): )
    T_WHITESPACE: 
    
    T_OBJECT_OPERATOR: ->
    T_STRING: setPageSize
    (: (
    T_LNUMBER: 200
    
    
    
      [Exception]                                        
      Expected token "T_STRING", got token "T_VARIABLE"  
    
    
    
    Exception trace:
     () at /Users/steverobbins/.n98-magerun/modules/mpmd/src/Mpmd/DependencyChecker/Parser/Tokenizer.php:79
     Mpmd\DependencyChecker\Parser\Tokenizer->assertToken() at /Users/steverobbins/.n98-magerun/modules/mpmd/src/Mpmd/DependencyChecker/Parser/Tokenizer/Handler/StaticCalls.php:15
     Mpmd\DependencyChecker\Parser\Tokenizer\Handler\StaticCalls->handle() at /Users/steverobbins/.n98-magerun/modules/mpmd/src/Mpmd/DependencyChecker/Parser/Tokenizer.php:41
     Mpmd\DependencyChecker\Parser\Tokenizer->parse() at /Users/steverobbins/.n98-magerun/modules/mpmd/src/Mpmd/Magento/DependencyCheckCommand.php:65
     Mpmd\Magento\DependencyCheckCommand->collectData() at /Users/steverobbins/.n98-magerun/modules/mpmd/src/Mpmd/Magento/DependencyCheckCommand.php:124
     Mpmd\Magento\DependencyCheckCommand->execute() at /Users/steverobbins/Project/n98-magerun/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
     Symfony\Component\Console\Command\Command->run() at /Users/steverobbins/Project/n98-magerun/src/N98/Magento/Command/AbstractMagentoCommand.php:448
     N98\Magento\Command\AbstractMagentoCommand->run() at /Users/steverobbins/Project/n98-magerun/vendor/symfony/console/Symfony/Component/Console/Application.php:882
     Symfony\Component\Console\Application->doRunCommand() at /Users/steverobbins/Project/n98-magerun/vendor/symfony/console/Symfony/Component/Console/Application.php:195
     Symfony\Component\Console\Application->doRun() at /Users/steverobbins/Project/n98-magerun/src/N98/Magento/Application.php:586
     N98\Magento\Application->doRun() at /Users/steverobbins/Project/n98-magerun/vendor/symfony/console/Symfony/Component/Console/Application.php:126
     Symfony\Component\Console\Application->run() at /Users/steverobbins/Project/n98-magerun/src/N98/Magento/Application.php:646
     N98\Magento\Application->run() at /Users/steverobbins/Project/n98-magerun/bin/n98-magerun:5
    

    I'm not sure if it's an issue with my module or with the checker, but I don't know what to do next. If I comment out the throw it seems to run fine.

    opened by steverobbins 1
Owner
AOE
AOE is a leading global provider of services for digital transformation and business models. AOE relies exclusively on established Enterprise Open Source...
AOE
PHP Magic Number Detector

PHP Magic Number Detector (PHPMND) phpmnd is a tool that aims to help you to detect magic numbers in your PHP code. By default 0 and 1 are not conside

Povilas Susinskas 514 Dec 14, 2022
Dead Code Detector (DCD) for PHP code.

This project is no longer maintained and its repository is only kept for archival purposes. PHP Dead Code Detector (PHPDCD) phpdcd is a Dead Code Dete

Sebastian Bergmann 406 Dec 30, 2022
A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2

Simple Import / Export tool A tool that allows to quickly export data from Magento 1 and Magento 2 store and import it back into Magento 2. Table data

EcomDev B.V. 51 Dec 5, 2022
Chef-magento - Installs and Configures a Magento project

Description Requirements Chef 0.10.0 or higher required (for Chef environment use). Platform Debian, Ubuntu CentOS, Red Hat, Fedora Your basebox must

Inviqa 3 Jun 30, 2020
Roach-example-project - Example project to demonstrate how to use RoachPHP in a Laravel project.

Example repository to illustrate how to use roach-php/laravel in a Laravel app. Check app/Spiders/FussballdatenSpider.php for an example spider that c

Kai Sassnowski 11 Dec 15, 2022
This Magento 2 extension integrates EasyTranslate into Magento 2.

EasyTranslate Magento 2 Connector This Magento 2 extension integrates EasyTranslate into Magento 2. Mind that you need to have an account with EasyTra

Easytranslate ApS 0 Oct 7, 2022
Magento-Functions - A Resource of Magento Functions

Magento-Functions A Resource of Magento Functions Table of Contents Category Product User Cart Checkout General Account [Working w/ URL's] (#urls) Cat

Bryan Littlefield 28 Apr 19, 2021
Magento - Magento Community Editions

Magento Community Edition /// THIS REPOSITORY IS DEPREACTED /// 1.9.4.1 will be the last version update. Please switch over to OpenMage! Either to the

FireGento e. V. 107 Oct 17, 2022
Magento-Vagrant-Puppet-Nginx - Installs magento and a nginx server

Magento-Vagrant-Puppet-Nginx Installs Magento MySQL PHP PHP-FPM Nginx n98-magerun Setup git submodule init git submodule update vagrant up Modify pupp

Christian Münch 61 Aug 10, 2022
Docker-magento - Docker image for Magento 1.6 to 1.9

Docker image for Magento 1.x This repo creates a Docker image for Magento 1.x. Please note The primary goal of this repo is to create Docker images fo

Fu Cheng 144 Nov 18, 2022
Magento-composer-installer - Composer installer for Magento modules

!!! support the maintainer of this project via Patreon: https://www.patreon.com/Flyingmana Magento Composer Installer The purpose of this project is t

null 213 Sep 24, 2022
Cookbook-magento - Collection of recipes to build app stack for the Magento deployments with Chef

Magento Cookbook Collection of recipes to build app stack for the Magento deployments with Chef Installation With Berkshelf echo "cookbook 'magento',

Yevhen Viktorov 37 Sep 26, 2020
Magento-bulk - Bulk Import/Export helper scripts and CLI utilities for Magento Commerce

Magento Bulk Bulk operations for Magento. Configuration Copy config.php.sample to config.php and edit it. Product Attribute Management List All Attrib

Bippo Indonesia 23 Dec 20, 2022
Phpcs-magento-rules - A set of PHPCS rules used by made.com when hacking Magento

Made.com PHPCS Magento Rules A set of PHPCS rules used by made.com when hacking Magento. Pre-Requisites PHPCS Installation Short Version Clone this re

Made.com Tech Team 26 Jun 3, 2020
This Magento extension provides a Real Full Page Caching for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

This Magento extension provides a Real Full Page Caching (FPC) for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

Hugues Alary 95 Feb 11, 2022
Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Automatically load the next page of products in Magento. Easy to install and configure, this module works 100% out of the box with vanilla Magento 1.9.x and earlier.

Strategery 123 Nov 20, 2021
Foundation 3 Framework for Magento 1.7. Foundation styles and libraries. Magento Responsive theme. Off-canvas Left-Right sidebar columns for mobile.

Magento Foundation 3 Framework Zurb Foundation 3 framework for Magento 1.7. Magento Foundation 3 Version 1.3.0. Demo page: http://magendation.internet

Nando Boronat 62 Apr 1, 2022