This post originated from an RSS feed registered with PHP Buzz
by Sebastian Bergmann.
Original Post: PHPUnit and Software Metrics
Feed Title: Sebastian Bergmann on PHP
Feed URL: http://sebastian-bergmann.de/rss.php?category=6&version=2.0
Feed Description: Sebastian Bergmann is a long-time contributor to various PHP projects, including PHP itself. He is currently working for eZ Systems AS on the Workflow Engine component for the eZ Platform. As the developer of PHPUnit, he also helps with testing the eZ Components. In his free time he likes to hack on Open Source software and to take photographs, preferably while travelling the world.
The upcoming 3.2 release of PHPUnit adds a couple of software metrics to the data that is stored in PHPUnit's test database . Below is a list of the metrics that are calculated and collected: Project Level Number of Interfaces (INTERFS) Number of Abstract Classes (CLSa) Number of Concrete Classes (CLSc) Number of Classes (CLS) Number of Root Classes (ROOTS) Number of Leaf Classes (LEAFS) Maximum Depth of Intheritance Tree (maxDIT) File Level Lines of Code (LOC) Comment Lines of Code (CLOC) Non-Comment Lines of Code (NCLOC) Lines of Executable Code (ELOC) Lines of Executed Code Code Coverage Function Level Lines of Code (LOC) Lines of Executable Code (ELOC) Lines of Executed Code Code Coverage Cyclomatic Complexity Change Risk Analysis and Predictions (CRAP) Index Class Level Lines of Code (LOC) Lines of Executable Code (ELOC) Lines of Executed Code Code Coverage Attribute Inheritance Factor (AIF) Attribute Hiding Factor (AHF) Class Size (CSZ) Class Interface Size (CIS) Depth of Inheritance Tree (DIT) Method Inheritance Factor (MIF) Method Hiding Factor (MHF) Number of Children (NOC) Number of Interfaces Implemented (IMPL) Number of Variables (VARS) Number of Non-Private Variables (VARSnp) Number of Variables (VARSi) Polymorphism Factor (PF) Weighted Methods per Class (WMC) Weighted Non-Private Methods per Class (WMCnp) Weighted Inherited Methods per Class (WMCi) Method Level Lines of Code (LOC) Lines of Executable Code (ELOC) Lines of Executed Code Code Coverage Cyclomatic Complexity Change Risk Analysis and Predictions (CRAP) Index The example below shows how you can access, for instance, the Cyclomatic Complexity information for all methods of a project.