{"id":13505177,"url":"https://github.com/Trismegiste/Mondrian","last_synced_at":"2025-03-29T23:31:11.652Z","repository":{"id":7591262,"uuid":"8947594","full_name":"Trismegiste/Mondrian","owner":"Trismegiste","description":"A static php code analysis tool using the Graph Theory","archived":false,"fork":false,"pushed_at":"2021-10-22T11:02:05.000Z","size":5839,"stargazers_count":393,"open_issues_count":10,"forks_count":21,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-05-19T05:47:07.825Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://trismegiste.github.io/Mondrian/","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Trismegiste.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-22T08:12:48.000Z","updated_at":"2024-05-15T15:45:38.000Z","dependencies_parsed_at":"2022-09-21T11:12:01.365Z","dependency_job_id":null,"html_url":"https://github.com/Trismegiste/Mondrian","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trismegiste%2FMondrian","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trismegiste%2FMondrian/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trismegiste%2FMondrian/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Trismegiste%2FMondrian/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Trismegiste","download_url":"https://codeload.github.com/Trismegiste/Mondrian/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246112660,"owners_count":20725300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T00:00:59.614Z","updated_at":"2025-03-29T23:31:11.594Z","avatar_url":"https://github.com/Trismegiste.png","language":"PHP","funding_links":[],"categories":["Standalone","代码分析","目录","Table of Contents","PHP","代码分析 Code Analysis","Code Analysis","代码分析( Code Analysis )","静态分析 Static Analysis"],"sub_categories":["Metrics","静态分析 Static Analysis","Static Analysis","Globalization"],"readme":"# Mondrian [![Build Status](https://travis-ci.org/Trismegiste/Mondrian.png?branch=master)](https://travis-ci.org/Trismegiste/Mondrian)\n\nOk guyz, you have a master degree in [Graph Theory][1], you follow [Law of Demeter][2]\nand you live on [S.O.L.I.D][3] principles ?\n\nLet's have some Fun ! (^ω^)\n\n## What\nIt is a set of CLI tools to help you to analyse and refactor highly coupled classes.\nAs you know Law of Demeter and S.O.L.I.D guidances, you need your classes loosely\ncoupled. And for this, there is one only rule : **ABSTRACTION**\n\n![From Hell To Kiss](./doc/img/abstracting.png)\n\nThis app provides some helpers to add abstraction into concrete classes\nwith minimum pain.\n\n## Getting started\nDownload the PHAR : [mondrian.phar](https://github.com/Trismegiste/Mondrian/raw/master/bin/box/mondrian.phar)\n\nTry to run a simple command with a few files (or a small part of a project)\n```\n$ mondrian.phar digraph /home/dev/project\n```\nThis command produces a DOT file for [GraphViz](http://www.graphviz.org). Other formats are available :\n* html : interactive graph with the d3.js awesome library\n* svg : open standard for vector graphics (requires [GraphViz](http://www.graphviz.org/Download..php))\n* json : format for d3.js for example\n\n### Example with html format\n```\n$ php mondrian.php d --ignore=tests --ignore=vendor --format=html ./MyPhpProject/\n```\n![html-report](./doc/img/sample-d3js.png)\n\nNote: The generated html file does not require any dependencies nor a connection.\n\n## Ecosystem\nRunning unit tests with [PHPUnit](https://phpunit.de/getting-started.html)\n```\n$ phpunit.phar\n```\n\nBuilding the documentation with [phpDocumentor](http://phpdoc.org/docs/latest/getting-started/installing.html#phar)\n```\n$ phpDocumentor.phar\n```\n\nBuilding mondrian.phar from the sources with [box2](https://github.com/box-project/box2#as-a-phar-recommended)\n```\n$ box.phar b\n```\n\n## Examples\n### Default digraph on trismegiste/dokudoki\n![digraph1](./doc/img/sample1.jpg)\n\n### Which components are bottleneck ?\n![digraph2](./doc/img/sample2.jpg)\n\n### Reduced graph to LSP violations on trismegiste/prolog\n![digraph3](./doc/img/sample3.jpg)\n\n## How\n\nRead the concept [here][12]\n\nRead the online documentation [here][4]\n\nAnd the API [here][5] (not up to date)\n\n## Extensible\n\nYou can easily add plugins to this tool to make your own algorithm, coloring scheme\nor new generator. I try to make the API mostly decoupled, re-usable and with great\nSRP and OCP concerns. Look into the \"About\" plugin to understand a basic stub of\nplugin.\n\n## Third party\n\nPackages used in this project :\n\n * [nikic/php-parser][6] for parsing PHP\n * [symfony/console][7] for creating CLI app with swag\n * [alom/graphviz][8] for rendering DOT files\n * [symfony/finder][9] for searching files through filesystem\n * [symfony/config][10] for managing yaml configuration without headache\n * [D3.js](http://d3js.org/) for graph rendering in html\n * Phar builded with [Box][11]\n\n## Special thanks\n\n * William Gibson\n * JS Bach\n * Dream Theater\n\n[1]: http://en.wikipedia.org/wiki/Graph_theory\n[2]: http://en.wikipedia.org/wiki/Law_of_Demeter\n[3]: http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)\n[4]: http://trismegiste.github.io/Mondrian/\n[5]: http://trismegiste.github.io/Mondrian/doc/index.html\n[6]: https://github.com/nikic/PHP-Parser\n[7]: https://github.com/symfony/Console\n[8]: https://github.com/alexandresalome/graphviz\n[9]: https://github.com/symfony/Finder\n[10]: https://github.com/symfony/Config\n[11]: https://github.com/kherge/Box\n[12]: ./doc/README.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTrismegiste%2FMondrian","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTrismegiste%2FMondrian","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTrismegiste%2FMondrian/lists"}