\Trismegiste\Mondrian\AnalysisCodeMetrics

CodeMetrics analyses a graph and counts number of vertices per type Design Pattern : Decorator

Metrics are usefull to fast evaluate what kind of project you have to refactor. But it is not a guide where you have to go. Of course a project with a 50/50 ratio in interfaces/classes can be a good thing but if classes are used in parameters of methods instead of interfaces, interfaces are not really usefull. It's easy to fake good metrics.

This analyser also counts where methods are declared first in the inheritance tree. A good point can be that you have low count of method first declared in class. This can mean you can decouple your concrete classes (remember LSP)

From my experience, it's better to have dirty code in loosely coupled classes than beautiful code in highly coupled classes, because your beautiful code does not stand a chance against the entropy of changing.

Dirty code can be refactored, even in paralell process, if you have loosely coupling.

In short : Bad coding practices has bad metrics but good metrics does not means good coding practices. That's why I didn't push too far these statistics.

See the others tool to find out where the coupling is.

Summary

Methods
Properties
Constants
__construct()
addEdge()
addVertex()
getEdgeSet()
getVertexSet()
searchEdge()
getSuccessor()
getEdgeIterator()
getPartition()
getCardinal()
No public properties found
No constants found
No protected methods found
$graph
N/A
extractShortName()
No private properties found
N/A

Properties

$graph

$graph : 

Type

Methods

getEdgeSet()

getEdgeSet() : array

Get the edges set

Returns

array

getVertexSet()

getVertexSet() : array

Get the vertices in the graph

Returns

array

getSuccessor()

getSuccessor(\Trismegiste\Mondrian\Graph\Vertex  $v) : null|array

Get successors of a vertex

Parameters

\Trismegiste\Mondrian\Graph\Vertex $v

Returns

null|array —

null if the vertex is not in this graph

                    or an array of vertices

getEdgeIterator()

getEdgeIterator(\Trismegiste\Mondrian\Graph\Vertex  $v) : \Trismegiste\Mondrian\Graph\Iterator

Get an iterator on edges for one vertex

Parameters

\Trismegiste\Mondrian\Graph\Vertex $v

Returns

\Trismegiste\Mondrian\Graph\Iterator

getPartition()

getPartition() 

Returns a list of subgraph

getCardinal()

getCardinal() : array

Makes the statistics on the code

Returns

array —

hashmap of stat

extractShortName()

extractShortName(\Trismegiste\Mondrian\Graph\Vertex  $v) : string

Extract the class name of a vertex to get a printable result

Parameters

\Trismegiste\Mondrian\Graph\Vertex $v

Returns

string