PHP Class SebastianBergmann\CodeCoverage\Node\File

Inheritance: extends SebastianBergmann\CodeCoverage\Node\AbstractNode
Show file Open project: sebastianbergmann/php-code-coverage Class Usage Examples

Public Methods

Method Description
__construct ( string $name, SebastianBergmann\CodeCoverage\Node\AbstractNode $parent, array $coverageData, array $testData, boolean $cacheTokens ) Constructor.
count ( ) : integer Returns the number of files in/under this node.
getClasses ( ) : array Returns the classes of this node.
getCoverageData ( ) : array Returns the code coverage data of this node.
getFunctions ( ) : array Returns the functions of this node.
getLinesOfCode ( ) : array Returns the LOC/CLOC/NCLOC of this node.
getNumClasses ( ) : integer Returns the number of classes.
getNumExecutableLines ( ) : integer Returns the number of executable lines.
getNumExecutedLines ( ) : integer Returns the number of executed lines.
getNumFunctions ( ) : integer Returns the number of functions.
getNumMethods ( ) : integer Returns the number of methods.
getNumTestedClasses ( ) : integer Returns the number of tested classes.
getNumTestedFunctions ( ) : integer Returns the number of tested functions.
getNumTestedMethods ( ) : integer Returns the number of tested methods.
getNumTestedTraits ( ) : integer Returns the number of tested traits.
getNumTraits ( ) : integer Returns the number of traits.
getTestData ( ) : array Returns the test data of this node.
getTraits ( ) : array Returns the traits of this node.

Protected Methods

Method Description
calculateStatistics ( ) Calculates coverage statistics for the file.
crap ( integer $ccn, float $coverage ) : string Calculates the Change Risk Anti-Patterns (CRAP) index for a unit of code based on its cyclomatic complexity and percentage of code coverage.
processClasses ( PHP_Token_Stream $tokens )
processFunctions ( PHP_Token_Stream $tokens )
processTraits ( PHP_Token_Stream $tokens )

Private Methods

Method Description
newMethod ( string $methodName, array $method, string $link ) : array

Method Details

__construct() public method

Constructor.
public __construct ( string $name, SebastianBergmann\CodeCoverage\Node\AbstractNode $parent, array $coverageData, array $testData, boolean $cacheTokens )
$name string
$parent SebastianBergmann\CodeCoverage\Node\AbstractNode
$coverageData array
$testData array
$cacheTokens boolean

calculateStatistics() protected method

Calculates coverage statistics for the file.
protected calculateStatistics ( )

count() public method

Returns the number of files in/under this node.
public count ( ) : integer
return integer

crap() protected method

Calculates the Change Risk Anti-Patterns (CRAP) index for a unit of code based on its cyclomatic complexity and percentage of code coverage.
protected crap ( integer $ccn, float $coverage ) : string
$ccn integer
$coverage float
return string

getClasses() public method

Returns the classes of this node.
public getClasses ( ) : array
return array

getCoverageData() public method

Returns the code coverage data of this node.
public getCoverageData ( ) : array
return array

getFunctions() public method

Returns the functions of this node.
public getFunctions ( ) : array
return array

getLinesOfCode() public method

Returns the LOC/CLOC/NCLOC of this node.
public getLinesOfCode ( ) : array
return array

getNumClasses() public method

Returns the number of classes.
public getNumClasses ( ) : integer
return integer

getNumExecutableLines() public method

Returns the number of executable lines.
public getNumExecutableLines ( ) : integer
return integer

getNumExecutedLines() public method

Returns the number of executed lines.
public getNumExecutedLines ( ) : integer
return integer

getNumFunctions() public method

Returns the number of functions.
public getNumFunctions ( ) : integer
return integer

getNumMethods() public method

Returns the number of methods.
public getNumMethods ( ) : integer
return integer

getNumTestedClasses() public method

Returns the number of tested classes.
public getNumTestedClasses ( ) : integer
return integer

getNumTestedFunctions() public method

Returns the number of tested functions.
public getNumTestedFunctions ( ) : integer
return integer

getNumTestedMethods() public method

Returns the number of tested methods.
public getNumTestedMethods ( ) : integer
return integer

getNumTestedTraits() public method

Returns the number of tested traits.
public getNumTestedTraits ( ) : integer
return integer

getNumTraits() public method

Returns the number of traits.
public getNumTraits ( ) : integer
return integer

getTestData() public method

Returns the test data of this node.
public getTestData ( ) : array
return array

getTraits() public method

Returns the traits of this node.
public getTraits ( ) : array
return array

processClasses() protected method

protected processClasses ( PHP_Token_Stream $tokens )
$tokens PHP_Token_Stream

processFunctions() protected method

protected processFunctions ( PHP_Token_Stream $tokens )
$tokens PHP_Token_Stream

processTraits() protected method

protected processTraits ( PHP_Token_Stream $tokens )
$tokens PHP_Token_Stream