com.puppycrawl.tools.checkstyle.checks.metrics

Class NPathComplexityCheck

Implemented Interfaces:
Configurable, Contextualizable

public final class NPathComplexityCheck
extends AbstractComplexityCheck

Checks the npath complexity against a specified limt (default = 200). The npath metric computes the number of possible execution paths through a function. Similar to the cyclomatic complexity but also takes into account the nesting of conditional statements and multi-part boolean expressions.

Authors:
Simon Harris
o_sukhodolsky TODO: For every or: _value += (_orCount * (nestedValue - 1)); TODO: For every and: ???

Constructor Summary

NPathComplexityCheck()
Creates new instance of the check.

Method Summary

int[]
getDefaultTokens()
protected String
getMessageID()
void
leaveToken(DetailAST aAST)
void
visitToken(DetailAST aAST)

Methods inherited from class com.puppycrawl.tools.checkstyle.checks.metrics.AbstractComplexityCheck

getCurrentValue, getMax, getMessageID, getRequiredTokens, incrementCurrentValue, leaveToken, leaveTokenHook, popValue, pushValue, setCurrentValue, setMax, visitToken, visitTokenHook

Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check

beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter

getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, log, log, setSeverity

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean

configure, contextualize, finishLocalSetup, getConfiguration, setupChild

Constructor Details

NPathComplexityCheck

public NPathComplexityCheck()
Creates new instance of the check.

Method Details

getDefaultTokens

public int[] getDefaultTokens()
Overrides:
getDefaultTokens in interface Check


getMessageID

protected String getMessageID()
Overrides:
getMessageID in interface AbstractComplexityCheck


leaveToken

public void leaveToken(DetailAST aAST)
Overrides:
leaveToken in interface AbstractComplexityCheck


visitToken

public void visitToken(DetailAST aAST)
Overrides:
visitToken in interface AbstractComplexityCheck