public class CognitiveComplexity extends DoubleDispatchVisitor
| Modifier and Type | Class and Description |
|---|---|
static class |
CognitiveComplexity.ComplexityData |
| Constructor and Description |
|---|
CognitiveComplexity() |
CognitiveComplexity(int declarationNestingLevel) |
getContext, scan, scan, scanChildren, scanTree, visitArgumentList, visitArrayAssignmentPattern, visitArrayBindingPattern, visitArrayLiteral, visitAssignmentExpression, visitAssignmentPatternRestElement, visitBindingProperty, visitBlock, visitCallExpression, visitCaseClause, visitClass, visitComment, visitComputedPropertyName, visitDebugger, visitDecorator, visitDefaultClause, visitDefaultExportDeclaration, visitEmptyStatement, visitExportClause, visitExportDefaultBinding, visitExportDefaultBindingWithExportList, visitExportDefaultBindingWithNameSpaceExport, visitExpressionStatement, visitExtendsClause, visitFieldDeclaration, visitFinallyBlock, visitFlowArrayTypeShorthand, visitFlowArrayTypeWithKeywordTree, visitFlowCastingExpression, visitFlowDeclare, visitFlowFunctionSignature, visitFlowFunctionType, visitFlowFunctionTypeParameter, visitFlowFunctionTypeParameterClause, visitFlowGenericParameter, visitFlowGenericParameterClause, visitFlowImplementsClause, visitFlowInterfaceDeclaration, visitFlowIntersectionType, visitFlowLiteralType, visitFlowMethodPropertyDefinitionKey, visitFlowModule, visitFlowModuleExports, visitFlowNamespacedType, visitFlowObjectTypeTree, visitFlowOpaqueType, visitFlowOptionalBindingElement, visitFlowOptionalType, visitFlowParameterizedGenerics, visitFlowParenthesisedType, visitFlowPropertyType, visitFlowPropertyTypeKey, visitFlowSimpleType, visitFlowTupleType, visitFlowTypeAliasStatement, visitFlowTypeAnnotation, visitFlowTypedBindingElement, visitFlowTypeofType, visitFlowUnionType, visitFromClause, visitIdentifier, visitImport, visitImportClause, visitImportDeclaration, visitImportModuleDeclaration, visitInitializedAssignmentPatternElement, visitInitializedBindingElement, visitJsxClosingElement, visitJsxEmptyClosingElement, visitJsxEmptyOpeningElement, visitJsxIdentifier, visitJsxJavaScriptExpression, visitJsxOpeningElement, visitJsxSelfClosingElement, visitJsxShortFragmentElement, visitJsxSpreadAttribute, visitJsxStandardAttribute, visitJsxStandardElement, visitJsxText, visitLabelledStatement, visitLiteral, visitMemberExpression, visitModule, visitNamedExportDeclaration, visitNamedImportExportClause, visitNameSpaceExportDeclaration, visitNameSpaceImport, visitNewExpression, visitNewTarget, visitObjectAssignmentPattern, visitObjectAssignmentPatternPairElement, visitObjectBindingPattern, visitObjectLiteral, visitPairProperty, visitParameterList, visitParenthesisedExpression, visitRestElement, visitReturnStatement, visitScript, visitSpecifier, visitSpreadElement, visitSuper, visitTaggedTemplate, visitTemplateCharacters, visitTemplateExpression, visitTemplateLiteral, visitThrowStatement, visitToken, visitTryStatement, visitUnaryExpression, visitVariableDeclaration, visitVariableStatement, visitWithStatement, visitYieldExpressionpublic CognitiveComplexity(int declarationNestingLevel)
public CognitiveComplexity()
public CognitiveComplexity.ComplexityData calculateFunctionComplexity(FunctionTree functionTree, boolean definesModule)
public CognitiveComplexity.ComplexityData calculateScriptComplexity(ScriptTree tree)
public void clear()
public void visitIfStatement(IfStatementTree tree)
visitIfStatement in class DoubleDispatchVisitorpublic void visitElseClause(ElseClauseTree tree)
visitElseClause in class DoubleDispatchVisitorpublic void visitWhileStatement(WhileStatementTree tree)
visitWhileStatement in class DoubleDispatchVisitorpublic void visitDoWhileStatement(DoWhileStatementTree tree)
visitDoWhileStatement in class DoubleDispatchVisitorpublic void visitForStatement(ForStatementTree tree)
visitForStatement in class DoubleDispatchVisitorpublic void visitForObjectStatement(ForObjectStatementTree tree)
visitForObjectStatement in class DoubleDispatchVisitorpublic void visitCatchBlock(CatchBlockTree tree)
visitCatchBlock in class DoubleDispatchVisitorpublic void visitSwitchStatement(SwitchStatementTree tree)
visitSwitchStatement in class DoubleDispatchVisitorpublic void visitBinaryExpression(BinaryExpressionTree tree)
visitBinaryExpression in class DoubleDispatchVisitorpublic void visitConditionalExpression(ConditionalExpressionTree tree)
visitConditionalExpression in class DoubleDispatchVisitorpublic void visitBreakStatement(BreakStatementTree tree)
visitBreakStatement in class DoubleDispatchVisitorpublic void visitContinueStatement(ContinueStatementTree tree)
visitContinueStatement in class DoubleDispatchVisitorpublic void visitFunctionDeclaration(FunctionDeclarationTree tree)
visitFunctionDeclaration in class DoubleDispatchVisitorpublic void visitArrowFunction(ArrowFunctionTree tree)
visitArrowFunction in class DoubleDispatchVisitorpublic void visitFunctionExpression(FunctionExpressionTree tree)
visitFunctionExpression in class DoubleDispatchVisitorpublic void visitMethodDeclaration(MethodDeclarationTree tree)
visitMethodDeclaration in class DoubleDispatchVisitorpublic void visitAccessorMethodDeclaration(AccessorMethodDeclarationTree tree)
visitAccessorMethodDeclaration in class DoubleDispatchVisitorCopyright © 2011–2018 SonarSource and Eriks Nukis. All rights reserved.