http://pdepend.org/download.html

PHP_Depend is a small program that performs static code analysis on a given source base. Static code analysis means that PHP_Depend first takes the source code and parses it into an easily processable internal data structure. This data structure is normally called an AST (Abstract Syntax Tree), that represents the different statements and elements used in the analyzed source base. Then it takes the generated AST and measures several values, the so called software metrics. Each of this values stands for a quality aspect in the the analyzed software, observed from a very high level of abstraction, because no source was reviewed manually until now.

What is a software metric?
Okay, so what are these software metrics? Normally software metrics are really simple things. They are just the sum of some statements or code fragments found in the analyzed source. For example, the Cyclomatic Complexity Number of a method is just the sum of all logical statements, like ''if'', ''for'' etc., in the analyzed method. This means a Cyclomatic Complexity value of ''23'' only says that there are 23 statements in the analyzed method. You can now take this value and compare it with your own or others experience, when a piece of software gets unmaintainable due to its complexity.

And why should I use PHP_Depend?
That's a really good question! Why should you use a just another tool in your daily development process to perform such a simple task like building source statistics? The answer is easy.

    *PHP_Depend is automatable and always objective, it just measures the quality facts of a given source base.
    *PHP_Depend scales with growing source bases, where human code reviews will fail some day.
    *PHP_Depend allows to indentify suspect parts of a software that will be part of a code review, without looking into the source code
    *PHP_Depend also supports some fancy metrics that are so useful, when a certain level of metrics knowledge war reached.


Share