# eric7.Plugins.CheckerPlugins.CodeStyleChecker.Complexity.mccabe

### Global Attributes

__version__

### Classes

ASTVisitor | Performs a depth-first walk of the AST.
PathGraph |
PathGraphingAstVisitor | A visitor for a parsed Abstract Syntax Tree which finds executable statements.
PathNode |

### Functions

None

## ASTVisitor

Performs a depth-first walk of the AST.

### Derived from

object

### Class Attributes

None

### Class Methods

None

### Methods

ASTVisitor |
default |
dispatch |
preorder | Do preorder walk of tree using visitor

### Static Methods

None

#### ASTVisitor (Constructor)

ASTVisitor()

#### ASTVisitor.default

default(node, *args)

#### ASTVisitor.dispatch

dispatch(node, *args)

#### ASTVisitor.preorder

preorder(tree, visitor, *args)

Do preorder walk of tree using visitor

Up

## PathGraph

### Derived from

object

### Class Attributes

None

### Class Methods

None

### Methods

PathGraph |
complexity | Return the McCabe complexity for the graph.
connect |
to_dot |

### Static Methods

None

#### PathGraph (Constructor)

PathGraph(name, entity, lineno, column=0)

#### PathGraph.complexity

complexity()

Return the McCabe complexity for the graph. V-E+2

#### PathGraph.connect

connect(n1, n2)

#### PathGraph.to_dot

to_dot()
Up

## PathGraphingAstVisitor

A visitor for a parsed Abstract Syntax Tree which finds executable statements.

### Derived from

ASTVisitor

### Class Attributes

visitAsyncFor
visitAsyncFunctionDef
visitAsyncWith
visitTry

### Class Methods

None

### Methods

PathGraphingAstVisitor |
_subgraph | create the subgraphs representing any `if` and `for` statements
_subgraph_parse | parse the body and any `else` block of `if` and `for` statements
appendPathNode |
default |
dispatch_list |
reset |
visitClassDef |
visitFunctionDef |
visitIf |
visitLoop |
visitSimpleStatement |
visitTryExcept |
visitWith |

### Static Methods

None

#### PathGraphingAstVisitor (Constructor)

PathGraphingAstVisitor()

#### PathGraphingAstVisitor._subgraph

_subgraph(node, name, extra_blocks=())

create the subgraphs representing any `if` and `for` statements

#### PathGraphingAstVisitor._subgraph_parse

_subgraph_parse(node, pathnode, extra_blocks)

parse the body and any `else` block of `if` and `for` statements

#### PathGraphingAstVisitor.appendPathNode

appendPathNode(name)

#### PathGraphingAstVisitor.default

default(node, *args)

#### PathGraphingAstVisitor.dispatch_list

dispatch_list(node_list)

#### PathGraphingAstVisitor.reset

reset()

#### PathGraphingAstVisitor.visitClassDef

visitClassDef(node)

#### PathGraphingAstVisitor.visitFunctionDef

visitFunctionDef(node)

#### PathGraphingAstVisitor.visitIf

visitIf(node)

#### PathGraphingAstVisitor.visitLoop

visitLoop(node)

#### PathGraphingAstVisitor.visitSimpleStatement

visitSimpleStatement(node)

#### PathGraphingAstVisitor.visitTryExcept

visitTryExcept(node)

#### PathGraphingAstVisitor.visitWith

visitWith(node)
Up

## PathNode

### Derived from

object

### Class Attributes

None

### Class Methods

None

### Methods

PathNode |
dot_id |
to_dot |

### Static Methods

None

#### PathNode (Constructor)

PathNode(name, look="circle")

#### PathNode.dot_id

dot_id()

#### PathNode.to_dot

to_dot()
Up