Package org.sonar.python.metrics
Class ComplexityVisitor
java.lang.Object
org.sonar.plugins.python.api.tree.BaseTreeVisitor
org.sonar.python.metrics.ComplexityVisitor
- All Implemented Interfaces:
TreeVisitor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcomplexity(Tree pyTree) intvoidvisitBinaryExpression(BinaryExpression pyBinaryExpressionTree) voidvoidvisitConditionalExpression(ConditionalExpression pyConditionalExpressionTree) voidvisitForStatement(ForStatement pyForStatementTree) voidvisitFunctionDef(FunctionDef pyFunctionDefTree) voidvisitIfStatement(IfStatement pyIfStatementTree) voidvisitWhileStatement(WhileStatement pyWhileStatementTree) Methods inherited from class org.sonar.plugins.python.api.tree.BaseTreeVisitor
scan, scan, visitAliasedName, visitAnnotatedAssignment, visitArgumentList, visitAsPattern, visitAssertStatement, visitAssignmentExpression, visitAssignmentStatement, visitAwaitExpression, visitBreakStatement, visitCallExpression, visitCapturePattern, visitCaseBlock, visitClassDef, visitClassPattern, visitCompoundAssignment, visitComprehensionFor, visitContinueStatement, visitDecorator, visitDelStatement, visitDictCompExpression, visitDictionaryLiteral, visitDottedName, visitDoubleStarPattern, visitEllipsis, visitElseClause, visitExceptClause, visitExecStatement, visitExpressionList, visitExpressionStatement, visitFileInput, visitFinallyClause, visitFormatSpecifier, visitFormattedExpression, visitGlobalStatement, visitGroupPattern, visitGuard, visitImportFrom, visitImportName, visitKeyValuePair, visitKeyValuePattern, visitKeywordPattern, visitLambda, visitListLiteral, visitLiteralPattern, visitMappingPattern, visitMatchStatement, visitName, visitNone, visitNonlocalStatement, visitNumericLiteral, visitOrPattern, visitParameter, visitParameterList, visitParenthesizedExpression, visitPassStatement, visitPrintStatement, visitPyListOrSetCompExpression, visitQualifiedExpression, visitRaiseStatement, visitRegularArgument, visitRepr, visitReturnStatement, visitSequencePattern, visitSetLiteral, visitSliceExpression, visitSliceItem, visitSliceList, visitStarPattern, visitStatementList, visitStringElement, visitStringLiteral, visitSubscriptionExpression, visitToken, visitTryStatement, visitTuple, visitTupleParameter, visitTypeAliasStatement, visitTypeAnnotation, visitTypeParam, visitTypeParams, visitUnaryExpression, visitUnpackingExpression, visitValuePattern, visitWildcardPattern, visitWithItem, visitWithStatement, visitYieldExpression, visitYieldStatement
-
Constructor Details
-
ComplexityVisitor
public ComplexityVisitor()
-
-
Method Details
-
complexity
-
visitFunctionDef
- Specified by:
visitFunctionDefin interfaceTreeVisitor- Overrides:
visitFunctionDefin classBaseTreeVisitor
-
visitForStatement
- Specified by:
visitForStatementin interfaceTreeVisitor- Overrides:
visitForStatementin classBaseTreeVisitor
-
visitWhileStatement
- Specified by:
visitWhileStatementin interfaceTreeVisitor- Overrides:
visitWhileStatementin classBaseTreeVisitor
-
visitIfStatement
- Specified by:
visitIfStatementin interfaceTreeVisitor- Overrides:
visitIfStatementin classBaseTreeVisitor
-
visitConditionalExpression
- Specified by:
visitConditionalExpressionin interfaceTreeVisitor- Overrides:
visitConditionalExpressionin classBaseTreeVisitor
-
visitBinaryExpression
- Specified by:
visitBinaryExpressionin interfaceTreeVisitor- Overrides:
visitBinaryExpressionin classBaseTreeVisitor
-
visitComprehensionIf
- Specified by:
visitComprehensionIfin interfaceTreeVisitor- Overrides:
visitComprehensionIfin classBaseTreeVisitor
-
getComplexity
public int getComplexity()
-