Package org.sonar.php.metrics
Class CognitiveComplexityVisitor
- java.lang.Object
-
- org.sonar.plugins.php.api.visitors.PHPVisitorCheck
-
- org.sonar.php.metrics.CognitiveComplexityVisitor
-
- All Implemented Interfaces:
PHPCheck
,VisitorCheck
public class CognitiveComplexityVisitor extends PHPVisitorCheck
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CognitiveComplexityVisitor.CognitiveComplexity
static class
CognitiveComplexityVisitor.ComplexityComponent
-
Field Summary
-
Fields inherited from class org.sonar.plugins.php.api.visitors.PHPVisitorCheck
MAX_DEPTH
-
-
Constructor Summary
Constructors Constructor Description CognitiveComplexityVisitor()
-
Method Summary
-
Methods inherited from class org.sonar.plugins.php.api.visitors.PHPVisitorCheck
analyze, analyze, analyze, context, getFullyQualifiedName, init, newIssue, scan, scan, visitAnonymousClass, visitArrayAccess, visitArrayAssignmentPattern, visitArrayAssignmentPatternElement, visitArrayInitializerBracket, visitArrayInitializerFunction, visitArrayPair, visitAssignmentExpression, visitAttribute, visitAttributeGroup, visitBlock, visitBuiltInType, visitCallArgument, visitCaseClause, visitCastExpression, visitClassDeclaration, visitClassPropertyDeclaration, visitCompilationUnit, visitCompoundVariable, visitComputedVariable, visitConstDeclaration, visitDeclareStatement, visitDefaultClause, visitEchoTagStatement, visitEmptyStatement, visitExecutionOperator, visitExpandableStringCharacters, visitExpandableStringLiteral, visitExpressionListStatement, visitExpressionStatement, visitFunctionCall, visitGlobalStatement, visitHeredoc, visitInlineHTML, visitLabel, visitLexicalVariables, visitListExpression, visitLiteral, visitMatchConditionClause, visitMatchDefaultClause, visitMatchExpression, visitMemberAccess, visitNameIdentifier, visitNamespaceName, visitNamespaceStatement, visitNewExpression, visitParameter, visitParameterList, visitParenthesisedExpression, visitPostfixExpression, visitPrefixedCastExpression, visitPrefixExpression, visitReferenceVariable, visitReturnStatement, visitReturnTypeClause, visitScript, visitSpreadArgument, visitStaticStatement, visitThrowExpression, visitThrowStatement, visitToken, visitTraitAlias, visitTraitMethodReference, visitTraitPrecedence, visitTrivia, visitTryStatement, visitType, visitUnionType, visitUnsetVariableStatement, visitUseClause, visitUseStatement, visitUseTraitDeclaration, visitVariableDeclaration, visitVariableIdentifier, visitVariableVariable, visitYieldExpression
-
-
-
-
Method Detail
-
complexity
public static CognitiveComplexityVisitor.CognitiveComplexity complexity(FunctionTree functionTree)
-
complexity
public static int complexity(CompilationUnitTree cut)
-
visitIfStatement
public void visitIfStatement(IfStatementTree tree)
- Specified by:
visitIfStatement
in interfaceVisitorCheck
- Overrides:
visitIfStatement
in classPHPVisitorCheck
-
visitElseifClause
public void visitElseifClause(ElseifClauseTree tree)
- Specified by:
visitElseifClause
in interfaceVisitorCheck
- Overrides:
visitElseifClause
in classPHPVisitorCheck
-
visitElseClause
public void visitElseClause(ElseClauseTree tree)
- Specified by:
visitElseClause
in interfaceVisitorCheck
- Overrides:
visitElseClause
in classPHPVisitorCheck
-
visitSwitchStatement
public void visitSwitchStatement(SwitchStatementTree tree)
- Specified by:
visitSwitchStatement
in interfaceVisitorCheck
- Overrides:
visitSwitchStatement
in classPHPVisitorCheck
-
visitWhileStatement
public void visitWhileStatement(WhileStatementTree tree)
- Specified by:
visitWhileStatement
in interfaceVisitorCheck
- Overrides:
visitWhileStatement
in classPHPVisitorCheck
-
visitDoWhileStatement
public void visitDoWhileStatement(DoWhileStatementTree tree)
- Specified by:
visitDoWhileStatement
in interfaceVisitorCheck
- Overrides:
visitDoWhileStatement
in classPHPVisitorCheck
-
visitForStatement
public void visitForStatement(ForStatementTree tree)
- Specified by:
visitForStatement
in interfaceVisitorCheck
- Overrides:
visitForStatement
in classPHPVisitorCheck
-
visitForEachStatement
public void visitForEachStatement(ForEachStatementTree tree)
- Specified by:
visitForEachStatement
in interfaceVisitorCheck
- Overrides:
visitForEachStatement
in classPHPVisitorCheck
-
visitCatchBlock
public void visitCatchBlock(CatchBlockTree tree)
- Specified by:
visitCatchBlock
in interfaceVisitorCheck
- Overrides:
visitCatchBlock
in classPHPVisitorCheck
-
visitFunctionDeclaration
public void visitFunctionDeclaration(FunctionDeclarationTree tree)
- Specified by:
visitFunctionDeclaration
in interfaceVisitorCheck
- Overrides:
visitFunctionDeclaration
in classPHPVisitorCheck
-
visitFunctionExpression
public void visitFunctionExpression(FunctionExpressionTree tree)
- Specified by:
visitFunctionExpression
in interfaceVisitorCheck
- Overrides:
visitFunctionExpression
in classPHPVisitorCheck
-
visitArrowFunctionExpression
public void visitArrowFunctionExpression(ArrowFunctionExpressionTree tree)
- Specified by:
visitArrowFunctionExpression
in interfaceVisitorCheck
- Overrides:
visitArrowFunctionExpression
in classPHPVisitorCheck
-
visitMethodDeclaration
public void visitMethodDeclaration(MethodDeclarationTree tree)
- Specified by:
visitMethodDeclaration
in interfaceVisitorCheck
- Overrides:
visitMethodDeclaration
in classPHPVisitorCheck
-
visitConditionalExpression
public void visitConditionalExpression(ConditionalExpressionTree tree)
- Specified by:
visitConditionalExpression
in interfaceVisitorCheck
- Overrides:
visitConditionalExpression
in classPHPVisitorCheck
-
visitBreakStatement
public void visitBreakStatement(BreakStatementTree tree)
- Specified by:
visitBreakStatement
in interfaceVisitorCheck
- Overrides:
visitBreakStatement
in classPHPVisitorCheck
-
visitContinueStatement
public void visitContinueStatement(ContinueStatementTree tree)
- Specified by:
visitContinueStatement
in interfaceVisitorCheck
- Overrides:
visitContinueStatement
in classPHPVisitorCheck
-
visitGotoStatement
public void visitGotoStatement(GotoStatementTree tree)
- Specified by:
visitGotoStatement
in interfaceVisitorCheck
- Overrides:
visitGotoStatement
in classPHPVisitorCheck
-
visitBinaryExpression
public void visitBinaryExpression(BinaryExpressionTree tree)
- Specified by:
visitBinaryExpression
in interfaceVisitorCheck
- Overrides:
visitBinaryExpression
in classPHPVisitorCheck
-
-