• Stars
    star
    394
  • Rank 108,843 (Top 3 %)
  • Language
    PHP
  • Created over 11 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A static php code analysis tool using the Graph Theory

Mondrian Build Status

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 ! (^ω^)

What

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

From Hell To Kiss

This app provides some helpers to add abstraction into concrete classes with minimum pain.

Getting started

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 :

  • html : interactive graph with the d3.js awesome library
  • svg : open standard for vector graphics (requires GraphViz)
  • json : format for d3.js for example

Example with html format

$ php mondrian.php d --ignore=tests --ignore=vendor --format=html ./MyPhpProject/

html-report

Note: The generated html file does not require any dependencies nor a connection.

Ecosystem

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

Examples

Default digraph on trismegiste/dokudoki

digraph1

Which components are bottleneck ?

digraph2

Reduced graph to LSP violations on trismegiste/prolog

digraph3

How

Read the concept here

Read the online documentation here

And the API here (not up to date)

Extensible

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.

Third party

Packages used in this project :

Special thanks

  • William Gibson
  • JS Bach
  • Dream Theater

More Repositories

1

Prolog

Warren Abstract Machine - A embedded Prolog compiler and virtual machine for PHP
PHP
31
star
2

Php-Is-Magic

A library for php-wizard level 20 : design pattern, simulator and dynamic generation
PHP
29
star
3

WamBundle

Warren Abstract Machine - A embedded Prolog compiler and virtual machine for PHP standalone and Symfony 2.3
JavaScript
24
star
4

phpunit-assert-solid

Don't remind others the SOLID guidances, do it programatically
PHP
9
star
5

Are-Php-Traits-Good-Or-Evil

Some random thoughts about PHP Traits : A blessing or a curse for efferent coupling ?
PHP
9
star
6

you-are-not-solid-when

Some examples of bad practices against SOLID principles
8
star
7

PhpRules

A rule engine for PHP. Taken from http://www.swindle.net/php-rules/
PHP
6
star
8

RADBundle

This is a bundle for rapid application developpement or scaffolding for Symfony2
PHP
6
star
9

DokudokiBundle

Everything you need to build an app on Symfony2 + MongoDB : schemaless database layer, magic model, schemaless form and finally migrations. Nevertheless, the dbal can be used outside the symfony2 framework.
PHP
4
star
10

Benchmarkdown

Benchmarking PHP Markdown parsers
PHP
3
star
11

Alkahest

Serializer/Unserializer for unopinionated persistence layer
PHP
3
star
12

eclipse-wiki

A website based on data provided by a MediaWiki API. Built on Symfony 6 and MongoDb 6. Intended to run on local server
PHP
3
star
13

Yuurei

Micro Object Document Mapper for MongoDB
PHP
2
star
14

rpg-name-generator

Library for generating random names (for table-top roleplaying games)
PHP
2
star
15

PastaDebug

PastaDebug is a dynamic code analysis tool for Mondrian
PHP
2
star
16

Twitwi

My own static page generator based on Twig and twitter bootstrap
PHP
2
star
17

sw-neph-pcgen

A random PC generator for SW-RPG (playing with javascript)
JavaScript
2
star
18

strangelove-bundle

How I Learned to Stop Worrying about Doctrine and Love MongoDb BSON
PHP
2
star
19

Socialist

Core library for social networking
PHP
2
star
20

ZeroKelvin

A foolish attempt to write a recursive serializer based PHP serialize
PHP
2
star
21

what-is-the-answer-to-life-the-universe-and-everything

Homage to Douglas Adams
PHP
1
star
22

symfony-prelude

Prelude to Symfony : an easy way to start a Symfony app
PHP
1
star
23

tileboard

http://webdesign.tutsplus.com/tutorials/build-a-modular-dashboard-interface-with-pure--webdesign-13314
CSS
1
star
24

iinano

symfony
JavaScript
1
star
25

Hiragana

A converter from Hepburn notation (or approximation) to Hiragana
PHP
1
star
26

ObjectDynamoMapper

Proof of concept for a Object-DynamoDb Mapper
PHP
1
star
27

sw-charman

Playing with RiotJS, PureCSS & IndexedDB : a manager for PC & NPC for SW-RPG
JavaScript
1
star
28

genetic

Genetic algorithms sandbox with PHP8+Symfony6
PHP
1
star
29

tensorflow-boilerplate

A boilerplate for TensorFlow with GPU
Dockerfile
1
star
30

Gallery

A personal gallery : KISS compliant thanx to Silex and PureCSS
PHP
1
star
31

SerialIcer

An unopinionated recursive un/serializer object <-> array
PHP
1
star
32

videodrome

Movie generators in PHP7 + Symfony 5 + ffmpeg
PHP
1
star
33

pdfgofast

A ready-copy-paste docker container to generate HTML-to-PDF
Go
1
star