test_class.declarator: parser = PHPParserBuilder.createParser(PHPLexicalGrammar.TOP_STATEMENT)
test_class.modifier: private
test_class.original_string: private ActionParser<Tree> parser = PHPParserBuilder.createParser(PHPLexicalGrammar.TOP_STATEMENT);
test_class.type: ActionParser<Tree>
test_class.var_name: parser
test_class.file: php-frontend/src/test/java/org/sonar/php/metrics/ComplexityVisitorTest.java
test_class.identifier: ComplexityVisitorTest
test_case.body: @Test
    public void statements() throws Exception {
      assertThat(complexity("$a = 0;")).isEqualTo(0);
      assertOneComplexityToken("if ($a) {}", "if");
      assertOneComplexityToken("if ($a) {} else {}", "if");
      assertThat(complexity("if ($a) {} else if($b) {} else {}")).isEqualTo(2);
      assertOneComplexityToken("if ($a): endif;", "if");
      assertOneComplexityToken("for (;;) {}", "for");
      assertOneComplexityToken("foreach ($a as $b) {}", "foreach");
      assertOneComplexityToken("while ($a) {}", "while");
      assertOneComplexityToken("do {} while($a);", "do");
      assertThat(complexity("switch ($a) {}")).isEqualTo(0);
      assertOneComplexityToken("switch ($a) {case 1:}", "case");
      assertThat(complexity("switch ($a) {default:}")).isEqualTo(0);
  
      assertThat(complexity("try {}")).isEqualTo(0);
      assertThat(complexity("try {} catch(E $s) {}")).isEqualTo(0);
      assertThat(complexity("return 1;")).isEqualTo(0);
      assertThat(complexity("throw e;")).isEqualTo(0);
      assertThat(complexity("goto x;")).isEqualTo(0);
    }
test_case.class_method_signature: ComplexityVisitorTest.statements()
test_case.full_signature: @Test public void statements()
test_case.identifier: statements
test_case.invocations: isEqualTo assertThat complexity assertOneComplexityToken assertOneComplexityToken isEqualTo assertThat complexity assertOneComplexityToken assertOneComplexityToken assertOneComplexityToken assertOneComplexityToken assertOneComplexityToken isEqualTo assertThat complexity assertOneComplexityToken isEqualTo assertThat complexity isEqualTo assertThat complexity isEqualTo assertThat complexity isEqualTo assertThat complexity isEqualTo assertThat complexity isEqualTo assertThat complexity
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void statements()
focal_class.declarator: complexityTrees = new ArrayList<>()
focal_class.modifier: private
focal_class.original_string: private List<Tree> complexityTrees = new ArrayList<>();
focal_class.type: List<Tree>
focal_class.var_name: complexityTrees
focal_class.file: php-frontend/src/main/java/org/sonar/php/metrics/ComplexityVisitor.java
focal_class.identifier: ComplexityVisitor
focal_class.class_method_signature: ComplexityVisitor.visitCaseClause(CaseClauseTree tree)
focal_class.full_signature: @Override public void visitCaseClause(CaseClauseTree tree)
focal_class.identifier: visitCaseClause
focal_class.modifiers: @Override public
focal_class.parameters: (CaseClauseTree tree)
focal_class.return: void
focal_class.signature: void visitCaseClause(CaseClauseTree tree)
focal_class.class_method_signature: ComplexityVisitor.visitWhileStatement(WhileStatementTree tree)
focal_class.full_signature: @Override public void visitWhileStatement(WhileStatementTree tree)
focal_class.identifier: visitWhileStatement
focal_class.modifiers: @Override public
focal_class.parameters: (WhileStatementTree tree)
focal_class.return: void
focal_class.signature: void visitWhileStatement(WhileStatementTree tree)
focal_class.class_method_signature: ComplexityVisitor.visitDoWhileStatement(DoWhileStatementTree tree)
focal_class.full_signature: @Override public void visitDoWhileStatement(DoWhileStatementTree tree)
focal_class.identifier: visitDoWhileStatement
focal_class.modifiers: @Override public
focal_class.parameters: (DoWhileStatementTree tree)
focal_class.return: void
focal_class.signature: void visitDoWhileStatement(DoWhileStatementTree tree)
focal_class.class_method_signature: ComplexityVisitor.visitIfStatement(IfStatementTree tree)
focal_class.full_signature: @Override public void visitIfStatement(IfStatementTree tree)
focal_class.identifier: visitIfStatement
focal_class.modifiers: @Override public
focal_class.parameters: (IfStatementTree tree)
focal_class.return: void
focal_class.signature: void visitIfStatement(IfStatementTree tree)
focal_class.class_method_signature: ComplexityVisitor.visitForStatement(ForStatementTree tree)
focal_class.full_signature: @Override public void visitForStatement(ForStatementTree tree)
focal_class.identifier: visitForStatement
focal_class.modifiers: @Override public
focal_class.parameters: (ForStatementTree tree)
focal_class.return: void
focal_class.signature: void visitForStatement(ForStatementTree tree)
focal_class.class_method_signature: ComplexityVisitor.visitForEachStatement(ForEachStatementTree tree)
focal_class.full_signature: @Override public void visitForEachStatement(ForEachStatementTree tree)
focal_class.identifier: visitForEachStatement
focal_class.modifiers: @Override public
focal_class.parameters: (ForEachStatementTree tree)
focal_class.return: void
focal_class.signature: void visitForEachStatement(ForEachStatementTree tree)
focal_class.class_method_signature: ComplexityVisitor.visitConditionalExpression(ConditionalExpressionTree tree)
focal_class.full_signature: @Override public void visitConditionalExpression(ConditionalExpressionTree tree)
focal_class.identifier: visitConditionalExpression
focal_class.modifiers: @Override public
focal_class.parameters: (ConditionalExpressionTree tree)
focal_class.return: void
focal_class.signature: void visitConditionalExpression(ConditionalExpressionTree tree)
focal_class.class_method_signature: ComplexityVisitor.visitBinaryExpression(BinaryExpressionTree tree)
focal_class.full_signature: @Override public void visitBinaryExpression(BinaryExpressionTree tree)
focal_class.identifier: visitBinaryExpression
focal_class.modifiers: @Override public
focal_class.parameters: (BinaryExpressionTree tree)
focal_class.return: void
focal_class.signature: void visitBinaryExpression(BinaryExpressionTree tree)
focal_class.class_method_signature: ComplexityVisitor.visitMethodDeclaration(MethodDeclarationTree tree)
focal_class.full_signature: @Override public void visitMethodDeclaration(MethodDeclarationTree tree)
focal_class.identifier: visitMethodDeclaration
focal_class.modifiers: @Override public
focal_class.parameters: (MethodDeclarationTree tree)
focal_class.return: void
focal_class.signature: void visitMethodDeclaration(MethodDeclarationTree tree)
focal_class.class_method_signature: ComplexityVisitor.visitFunctionDeclaration(FunctionDeclarationTree tree)
focal_class.full_signature: @Override public void visitFunctionDeclaration(FunctionDeclarationTree tree)
focal_class.identifier: visitFunctionDeclaration
focal_class.modifiers: @Override public
focal_class.parameters: (FunctionDeclarationTree tree)
focal_class.return: void
focal_class.signature: void visitFunctionDeclaration(FunctionDeclarationTree tree)
focal_class.class_method_signature: ComplexityVisitor.visitFunctionExpression(FunctionExpressionTree tree)
focal_class.full_signature: @Override public void visitFunctionExpression(FunctionExpressionTree tree)
focal_class.identifier: visitFunctionExpression
focal_class.modifiers: @Override public
focal_class.parameters: (FunctionExpressionTree tree)
focal_class.return: void
focal_class.signature: void visitFunctionExpression(FunctionExpressionTree tree)
focal_class.class_method_signature: ComplexityVisitor.visitArrowFunctionExpression(ArrowFunctionExpressionTree tree)
focal_class.full_signature: @Override public void visitArrowFunctionExpression(ArrowFunctionExpressionTree tree)
focal_class.identifier: visitArrowFunctionExpression
focal_class.modifiers: @Override public
focal_class.parameters: (ArrowFunctionExpressionTree tree)
focal_class.return: void
focal_class.signature: void visitArrowFunctionExpression(ArrowFunctionExpressionTree tree)
focal_class.class_method_signature: ComplexityVisitor.incrementComplexity(Tree tree)
focal_class.full_signature: private void incrementComplexity(Tree tree)
focal_class.identifier: incrementComplexity
focal_class.modifiers: private
focal_class.parameters: (Tree tree)
focal_class.return: void
focal_class.signature: void incrementComplexity(Tree tree)
focal_class.class_method_signature: ComplexityVisitor.complexity(Tree tree)
focal_class.full_signature: public static int complexity(Tree tree)
focal_class.identifier: complexity
focal_class.modifiers: public static
focal_class.parameters: (Tree tree)
focal_class.return: int
focal_class.signature: int complexity(Tree tree)
focal_class.class_method_signature: ComplexityVisitor.complexityTrees(Tree tree)
focal_class.full_signature: public static List<Tree> complexityTrees(Tree tree)
focal_class.identifier: complexityTrees
focal_class.modifiers: public static
focal_class.parameters: (Tree tree)
focal_class.return: List<Tree>
focal_class.signature: List<Tree> complexityTrees(Tree tree)
focal_class.class_method_signature: ComplexityVisitor.complexityNodesWithoutNestedFunctions(Tree tree)
focal_class.full_signature: public static List<Tree> complexityNodesWithoutNestedFunctions(Tree tree)
focal_class.identifier: complexityNodesWithoutNestedFunctions
focal_class.modifiers: public static
focal_class.parameters: (Tree tree)
focal_class.return: List<Tree>
focal_class.signature: List<Tree> complexityNodesWithoutNestedFunctions(Tree tree)
focal_class.superclass: extends PHPVisitorCheck
focal_method.body: public static int complexity(Tree tree) {
      return complexityTrees(tree).size();
    }
focal_method.class_method_signature: ComplexityVisitor.complexity(Tree tree)
focal_method.full_signature: public static int complexity(Tree tree)
focal_method.identifier: complexity
focal_method.invocations: size complexityTrees
focal_method.modifiers: public static
focal_method.parameters: (Tree tree)
focal_method.return: int
focal_method.signature: int complexity(Tree tree)