$stack
$stack :
SpaghettiCoupling is an analyser which finds coupling between classes,
How ? This analyser searches path between two classes through calls of public methods, inheritance or instanciation.
The language I used for representing source code into a digraph was created especially to show that.
Note 1 : This service creates a new digraph by selecting only the class vertices because with the implementations, there are too many vertices. The goal of the digraph is the "search for bridges". This is a concept in graph theory where two highly connected graphs are linked by only one edge. By cuting this edge (by adding an interface for example), you can easily break your "monolith of code" into two pieces.
Note 2 : since I only analyse public methods, I knowingly miss some connections. I state that it is not an issue now. If there is a new instance in a protected method, this an "inner refactoring" not a refactoring of the structure of public implementations.
In a second time, you can refactor this coupling later because you have more freedom to change that : you are in a class, there is no coupling outside, or perhaps it's ok (factory method pattern for example). Remember, the purpose of this service is to help you to "break a monolith" you barely know, not to replace your coding skills. There is no magic for that.
There are more immportant issues with cycles of components for example.
searchPath(\Trismegiste\Mondrian\Graph\Vertex $src, \Trismegiste\Mondrian\Graph\Vertex $dst)
\Trismegiste\Mondrian\Graph\Vertex | $src | |
\Trismegiste\Mondrian\Graph\Vertex | $dst |
__construct(\Trismegiste\Mondrian\Graph\Graph $g)
Decorates the graph
\Trismegiste\Mondrian\Graph\Graph | $g |
addEdge(\Trismegiste\Mondrian\Graph\Vertex $source, \Trismegiste\Mondrian\Graph\Vertex $target)
Add a (un)directed edge if it does not already exist
\Trismegiste\Mondrian\Graph\Vertex | $source | |
\Trismegiste\Mondrian\Graph\Vertex | $target |
addVertex(\Trismegiste\Mondrian\Graph\Vertex $v)
Add a vertex to the graph without edge
\Trismegiste\Mondrian\Graph\Vertex | $v |
searchEdge(\Trismegiste\Mondrian\Graph\Vertex $source, \Trismegiste\Mondrian\Graph\Vertex $target) : \Trismegiste\Mondrian\Graph\Edge
Searches an existing (directed or not) edge between two vertices
\Trismegiste\Mondrian\Graph\Vertex | $source | |
\Trismegiste\Mondrian\Graph\Vertex | $target |
getSuccessor(\Trismegiste\Mondrian\Graph\Vertex $v) : null|array
Get successors of a vertex
\Trismegiste\Mondrian\Graph\Vertex | $v |
null if the vertex is not in this graph
or an array of vertices
getEdgeIterator(\Trismegiste\Mondrian\Graph\Vertex $v) : \Trismegiste\Mondrian\Graph\Iterator
Get an iterator on edges for one vertex
\Trismegiste\Mondrian\Graph\Vertex | $v |
setFilterPath(\Trismegiste\Mondrian\Analysis\Strategy\Search $strategy)
Set the strategy to reduce the graph by shortening a path between 2 components
\Trismegiste\Mondrian\Analysis\Strategy\Search | $strategy |
recursivSearchPath(\SplObjectStorage $step, \Trismegiste\Mondrian\Graph\Vertex $dst)
\SplObjectStorage | $step | |
\Trismegiste\Mondrian\Graph\Vertex | $dst |