A static php code analysis tool using the Graph Theory
Ok guyz, you have a master degree in Graph Theory, you follow Law of Demeter
and you live on S.O.L.I.D principles ?
Let’s have some Fun ! (ω)
It is a set of CLI tools to help you to analyse and refactor highly coupled classes.
As you know Law of Demeter and S.O.L.I.D guidances, you need your classes loosely
coupled. And for this, there is one only rule : ABSTRACTION
This app provides some helpers to add abstraction into concrete classes
with minimum pain.
Download the PHAR : mondrian.phar
Try to run a simple command with a few files (or a small part of a project)
$ mondrian.phar digraph /home/dev/project
This command produces a DOT file for GraphViz. Other formats are available :
$ php mondrian.php d --ignore=tests --ignore=vendor --format=html ./MyPhpProject/
Note: The generated html file does not require any dependencies nor a connection.
Running unit tests with PHPUnit
$ phpunit.phar
Building the documentation with phpDocumentor
$ phpDocumentor.phar
Building mondrian.phar from the sources with box2
$ box.phar b
Read the concept here
Read the online documentation here
And the API here (not up to date)
You can easily add plugins to this tool to make your own algorithm, coloring scheme
or new generator. I try to make the API mostly decoupled, re-usable and with great
SRP and OCP concerns. Look into the “About” plugin to understand a basic stub of
plugin.
Packages used in this project :