PHP Depend - Software Metrics for PHP

Software metrics supported by PHP_Depend

PHP Depend can generate a large set of software metrics from a given code base, these values can be used to measure the quality of a software project and they help to identify that parts of an application where a refactoring should be applied.

This section will give a brief overview of the software metrics provided by PHP Depend and it tries to give an introduction how to interpret them in the context of an application's code base.

Metric

Description

Project

Package

File

Class

Method

ahh

Average Hierarchy Height

The average of the maximum lenght from a root class to ist deepest subclass subclass

X

andc

Average Number of Derived Classes

The average of direct subclasses of a class

X

ca

Afferent Coupling

Number of unique incoming dependencies from other artifacts of the same type.

X

calls

Number of Method or Function Calls

X

cbo

Coupling Between Objects

Number of unique outgoing dependencies to other artifacts of the same type.

X

ccn

Cyclomatic Complexity Number

X

X

ccn2

Extended Cyclomatic Complexity Number

X

X

ce

Efferent Coupling

Number of unique outgoing dependencies to other artifacts of the same type.

X

cis

Class Interface Size

Number of non private methods and properties of a class:

CIS = public(NOM + VARS)

Measures the size of the interface from other parts of the system to a class.

X

cloc

Comment Lines fo Code

X

X

X

X

clsa

Number of Abstract Classes

X

clsc

Number of Concrete Classes

X

cr

Code Rank

Google PageRank applied on Packages and Classes. Classes with a high value should be tested frequently.

X

X

csz

Class Size

Number of methods and properties of a class:

CSZ = NOM + VARS

Measures the size of a class concerning operations and data.

X

dit

Depth of Inheritance Tree

Depth of inheritance to root class

X

eloc

Executable Lines of Code

X

X

X

X

fanout

Number of Fanouts

Referenced Classes

X

leafs

Number of Leaf Classes

(finla) classes

X

lloc

Logical Lines Of Code

X

X

X

X

loc

Lines Of Code

X

X

X

X

maxDIT

Max Depth of Inheritance Tree

Maximum depth of inheritance

X

noam

Number Of Added Methods

X

nocc

Number Of Child Classes

X

noom

Number Of Overwritten Methods

X

ncloc

Non Comment Lines Of Code

X

X

X

X

noc

Number Of Classes

X

X

nof

Number Of Functions

X

X

noi

Number Of Interfaces

X

X

nom

Number Of Methods

X

X

X

npm

Number of Public Methods

X

npath

NPath Complexity

X

nop

Number of Packages

X

rcr

Reverse Code Rank

X

X

roots

Number of Root Classes

X

vars

Properties

X

varsi

Inherited Properties

X

varsnp

Non Private Properties

X

wmc

Weighted Method Count

The WMC metric is the sum of the complexities of all declared methods and constructors of class.

X

wmci

Inherited Weighted Method Count

Same as wmc, but only inherited methods.

X

wmcnp

Non Private Weighted Method Count

Same as wmc, but only non private methods.

X

Build on CloudBees button