Package org.sonar.javascript.checks
Class EmptyStatementCheck
- java.lang.Object
-
- org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor
-
- org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitorCheck
-
- org.sonar.javascript.checks.EmptyStatementCheck
-
- All Implemented Interfaces:
JavaScriptCheck,TreeVisitor
public class EmptyStatementCheck extends DoubleDispatchVisitorCheck
-
-
Constructor Summary
Constructors Constructor Description EmptyStatementCheck()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidvisitElseClause(ElseClauseTree tree)Same asvisitIfStatement.voidvisitEmptyStatement(EmptyStatementTree tree)voidvisitForStatement(ForStatementTree tree)InvoidvisitIfStatement(IfStatementTree tree)InvoidvisitScript(ScriptTree tree)voidvisitWhileStatement(WhileStatementTree tree)Same asvisitForStatement.-
Methods inherited from class org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitorCheck
addIssue, addIssue, addLineIssue, scanFile
-
Methods inherited from class org.sonar.plugins.javascript.api.visitors.DoubleDispatchVisitor
getContext, scan, scan, scanChildren, scanTree, visitAccessorMethodDeclaration, visitArgumentList, visitArrayAssignmentPattern, visitArrayBindingPattern, visitArrayLiteral, visitArrowFunction, visitAssignmentExpression, visitAssignmentPatternRestElement, visitBinaryExpression, visitBindingProperty, visitBlock, visitBreakStatement, visitCallExpression, visitCaseClause, visitCatchBlock, visitClass, visitComment, visitComputedPropertyName, visitConditionalExpression, visitContinueStatement, visitDebugger, visitDecorator, visitDefaultClause, visitDefaultExportDeclaration, visitDoWhileStatement, 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, visitForObjectStatement, visitFromClause, visitFunctionDeclaration, visitFunctionExpression, visitIdentifier, visitImport, visitImportClause, visitImportDeclaration, visitImportModuleDeclaration, visitInitializedAssignmentPatternElement, visitInitializedBindingElement, visitJsxClosingElement, visitJsxEmptyClosingElement, visitJsxEmptyOpeningElement, visitJsxIdentifier, visitJsxJavaScriptExpression, visitJsxOpeningElement, visitJsxSelfClosingElement, visitJsxShortFragmentElement, visitJsxSpreadAttribute, visitJsxStandardAttribute, visitJsxStandardElement, visitJsxText, visitLabelledStatement, visitLiteral, visitMemberExpression, visitMethodDeclaration, visitModule, visitNamedExportDeclaration, visitNamedImportExportClause, visitNameSpaceExportDeclaration, visitNameSpaceImport, visitNewExpression, visitNewTarget, visitObjectAssignmentPattern, visitObjectAssignmentPatternPairElement, visitObjectBindingPattern, visitObjectLiteral, visitPairProperty, visitParameterList, visitParenthesisedExpression, visitRestElement, visitReturnStatement, visitSpecifier, visitSpreadElement, visitSuper, visitSwitchStatement, visitTaggedTemplate, visitTemplateCharacters, visitTemplateExpression, visitTemplateLiteral, visitThrowStatement, visitToken, visitTryStatement, visitUnaryExpression, visitVariableDeclaration, visitVariableStatement, visitWithStatement, visitYieldExpression
-
-
-
-
Method Detail
-
visitScript
public void visitScript(ScriptTree tree)
- Overrides:
visitScriptin classDoubleDispatchVisitor
-
visitIfStatement
public void visitIfStatement(IfStatementTree tree)
Inif (a) ; else ;
the semicolons are necessary (so no issue is raised) as there are no curly brackets.- Overrides:
visitIfStatementin classDoubleDispatchVisitor
-
visitElseClause
public void visitElseClause(ElseClauseTree tree)
Same asvisitIfStatement.- Overrides:
visitElseClausein classDoubleDispatchVisitor
-
visitForStatement
public void visitForStatement(ForStatementTree tree)
Infor (i = 0; i < arr.length; arr[i++] = 0);
the semicolon is necessary (so no issue is raised) as there are no curly brackets.- Overrides:
visitForStatementin classDoubleDispatchVisitor
-
visitWhileStatement
public void visitWhileStatement(WhileStatementTree tree)
Same asvisitForStatement.- Overrides:
visitWhileStatementin classDoubleDispatchVisitor
-
visitEmptyStatement
public void visitEmptyStatement(EmptyStatementTree tree)
- Overrides:
visitEmptyStatementin classDoubleDispatchVisitor
-
-