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 declarations() throws Exception {
      assertOneComplexityToken("function f() {}", "function");
      assertOneComplexityToken("$f = function() {};", "function");
      assertOneComplexityToken("$f = fn() => 0;", "fn");
      assertThat(complexity("class A {}")).isEqualTo(0);
      assertOneComplexityToken("class A { public function f() {} }", "function");
  
      assertThat(complexity("function f() { f(); return; }")).isEqualTo(1);
      assertThat(complexity("function f() { return; f(); }")).isEqualTo(1);
      assertThat(complexity("class A { abstract function f(); }")).isEqualTo(1);
      assertThat(expressionComplexity("function() { return $a && $b; };")).isEqualTo(2);
      assertThat(expressionComplexity("fn() => $a && $b;")).isEqualTo(2);
    }
test_case.class_method_signature: ComplexityVisitorTest.declarations()
test_case.full_signature: @Test public void declarations()
test_case.identifier: declarations
test_case.invocations: assertOneComplexityToken assertOneComplexityToken assertOneComplexityToken isEqualTo assertThat complexity assertOneComplexityToken isEqualTo assertThat complexity isEqualTo assertThat complexity isEqualTo assertThat complexity isEqualTo assertThat expressionComplexity isEqualTo assertThat expressionComplexity
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void declarations()
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)