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

Class: CyclomaticComplexitySniff

Source Location: /PHP_CodeSniffer-3.1.1/src/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php

Class Overview


Checks the cyclomatic complexity (McCabe) for functions.


Author(s):

Copyright:

  • 2007-2014 Mayflower GmbH

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 20]
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 35]

A complexity higher than this value will throw an error.
  • Access: public

Type:   integer


[ Top ]

$complexity =  10

[line 28]

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

Type:   integer


[ Top ]



Method Detail

process   [line 59]

void process( File $phpcsFile, int $stackPtr)

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

Parameters:

\PHP_CodeSniffer\Files\File   $phpcsFile   —  The file being scanned.
int   $stackPtr   —  The position of the current token in the stack passed in $tokens.

[ Top ]

register   [line 43]

array register( )

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

[ Top ]


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