PHP_CodeSniffer
[ class tree: PHP_CodeSniffer ] [ index: PHP_CodeSniffer ] [ all elements ]

Class: Generic_Sniffs_Metrics_CyclomaticComplexitySniff

Source Location: /PHP_CodeSniffer-0.9.0/CodeSniffer/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php

Class Overview


Checks the cyclomatic complexity (McCabe) for functions.


Author(s):

Version:

  • Release: 0.9.0

Copyright:

  • 2007 Mayflower GmbH

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 33]
Checks the cyclomatic complexity (McCabe) for functions.

The cyclomatic complexity (also called McCabe code metrics) indicates the complexity within a function by counting the different paths the function includes.



[ Top ]


Class Variables

$absoluteComplexity =  20

[line 48]

A complexity higer than this value will throw an error.
  • Access: protected

Type:   int


[ Top ]

$complexity =  10

[line 41]

A complexity higher than this value will throw a warning.
  • Access: protected

Type:   int


[ Top ]



Method Detail

process   [line 72]

void process( PHP_CodeSniffer_File $phpcsFile, int $stackPtr)

Processes this test, when one of its tokens is encountered.
  • Access: public

Parameters:

PHP_CodeSniffer_File   $phpcsFile   —  The file being scanned.
int   $stackPtr   —  The position of the current token in the stack passed in $tokens.

[ Top ]

register   [line 56]

array register( )

Returns an array of tokens this test wants to listen for.
  • Access: public

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:09:55 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.