test_class.file: php-frontend/src/test/java/org/sonar/php/metrics/MetricsVisitorTest.java
test_class.identifier: MetricsVisitorTest
test_class.superclass: extends ParsingTestUtils
test_case.body: @Test
    public void test() {
      String filename = "metrics/lines_of_code.php";
      PhpFile file = FileTestUtils.getFile(new File("src/test/resources/"+filename));
  
      FileLinesContext fileLinesContext = mock(FileLinesContext.class);
      CompilationUnitTree ast = parse(filename);
      FileMeasures fileMeasures = new MetricsVisitor().getFileMeasures(file, ast, SymbolTableImpl.create(ast), fileLinesContext);
  
      assertThat(fileMeasures.getFileComplexity()).isEqualTo(1);
      assertThat(fileMeasures.getFileCognitiveComplexity()).isEqualTo(0);
  
      assertThat(fileMeasures.getFunctionNumber()).isEqualTo(1);
      assertThat(fileMeasures.getStatementNumber()).isEqualTo(2);
      assertThat(fileMeasures.getClassNumber()).isEqualTo(1);
  
      assertThat(fileMeasures.getLinesOfCodeNumber()).isEqualTo(7);
  
      assertThat(fileMeasures.getCommentLinesNumber()).isEqualTo(5);
  
      verify(fileLinesContext).setIntValue(CoreMetrics.EXECUTABLE_LINES_DATA_KEY, 21, 1);
    }
test_case.class_method_signature: MetricsVisitorTest.test()
test_case.full_signature: @Test public void test()
test_case.identifier: test
test_case.invocations: getFile mock parse getFileMeasures create isEqualTo assertThat getFileComplexity isEqualTo assertThat getFileCognitiveComplexity isEqualTo assertThat getFunctionNumber isEqualTo assertThat getStatementNumber isEqualTo assertThat getClassNumber isEqualTo assertThat getLinesOfCodeNumber isEqualTo assertThat getCommentLinesNumber setIntValue verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test()
focal_class.declarator: FUNCTION_NODES = {
      Kind.FUNCTION_DECLARATION,
      Kind.FUNCTION_EXPRESSION,
      Kind.ARROW_FUNCTION_EXPRESSION,
      Kind.METHOD_DECLARATION,
    }
focal_class.modifier: private static final
focal_class.original_string: private static final Kind[] FUNCTION_NODES = {
      Kind.FUNCTION_DECLARATION,
      Kind.FUNCTION_EXPRESSION,
      Kind.ARROW_FUNCTION_EXPRESSION,
      Kind.METHOD_DECLARATION,
    };
focal_class.type: Kind[]
focal_class.var_name: FUNCTION_NODES
focal_class.declarator: CLASS_NODES = {
      Kind.CLASS_DECLARATION,
      Kind.INTERFACE_DECLARATION,
      Kind.TRAIT_DECLARATION
    }
focal_class.modifier: private static final
focal_class.original_string: private static final Kind[] CLASS_NODES = {
      Kind.CLASS_DECLARATION,
      Kind.INTERFACE_DECLARATION,
      Kind.TRAIT_DECLARATION
    };
focal_class.type: Kind[]
focal_class.var_name: CLASS_NODES
focal_class.declarator: fileMeasures
focal_class.modifier: private
focal_class.original_string: private FileMeasures fileMeasures;
focal_class.type: FileMeasures
focal_class.var_name: fileMeasures
focal_class.declarator: fileLinesContext
focal_class.modifier: private
focal_class.original_string: private FileLinesContext fileLinesContext;
focal_class.type: FileLinesContext
focal_class.var_name: fileLinesContext
focal_class.file: php-frontend/src/main/java/org/sonar/php/metrics/MetricsVisitor.java
focal_class.identifier: MetricsVisitor
focal_class.class_method_signature: MetricsVisitor.getClassNodes()
focal_class.full_signature: public static Kind[] getClassNodes()
focal_class.identifier: getClassNodes
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Kind[]
focal_class.signature: Kind[] getClassNodes()
focal_class.class_method_signature: MetricsVisitor.getFunctionNodes()
focal_class.full_signature: public static Kind[] getFunctionNodes()
focal_class.identifier: getFunctionNodes
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: Kind[]
focal_class.signature: Kind[] getFunctionNodes()
focal_class.class_method_signature: MetricsVisitor.nodesToVisit()
focal_class.full_signature: @Override public List<Kind> nodesToVisit()
focal_class.identifier: nodesToVisit
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<Kind>
focal_class.signature: List<Kind> nodesToVisit()
focal_class.class_method_signature: MetricsVisitor.visitNode(Tree tree)
focal_class.full_signature: @Override public void visitNode(Tree tree)
focal_class.identifier: visitNode
focal_class.modifiers: @Override public
focal_class.parameters: (Tree tree)
focal_class.return: void
focal_class.signature: void visitNode(Tree tree)
focal_class.class_method_signature: MetricsVisitor.getFileMeasures(
      PhpFile file,
      CompilationUnitTree tree,
      SymbolTable symbolTable,
      FileLinesContext fileLinesContext
    )
focal_class.full_signature: public FileMeasures getFileMeasures(
      PhpFile file,
      CompilationUnitTree tree,
      SymbolTable symbolTable,
      FileLinesContext fileLinesContext
    )
focal_class.identifier: getFileMeasures
focal_class.modifiers: public
focal_class.parameters: (
      PhpFile file,
      CompilationUnitTree tree,
      SymbolTable symbolTable,
      FileLinesContext fileLinesContext
    )
focal_class.return: FileMeasures
focal_class.signature: FileMeasures getFileMeasures(
      PhpFile file,
      CompilationUnitTree tree,
      SymbolTable symbolTable,
      FileLinesContext fileLinesContext
    )
focal_class.class_method_signature: MetricsVisitor.setCounterMeasures()
focal_class.full_signature: private void setCounterMeasures()
focal_class.identifier: setCounterMeasures
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void setCounterMeasures()
focal_class.class_method_signature: MetricsVisitor.setLineAndCommentMeasures()
focal_class.full_signature: private void setLineAndCommentMeasures()
focal_class.identifier: setLineAndCommentMeasures
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void setLineAndCommentMeasures()
focal_class.superclass: extends PHPSubscriptionCheck
focal_method.body: public FileMeasures getFileMeasures(
      PhpFile file,
      CompilationUnitTree tree,
      SymbolTable symbolTable,
      FileLinesContext fileLinesContext
    ) {
  
      this.fileMeasures = new FileMeasures();
      this.fileLinesContext = fileLinesContext;
  
      super.analyze(file, tree, symbolTable);
  
      setCounterMeasures();
      setLineAndCommentMeasures();
      return this.fileMeasures;
    }
focal_method.class_method_signature: MetricsVisitor.getFileMeasures(
      PhpFile file,
      CompilationUnitTree tree,
      SymbolTable symbolTable,
      FileLinesContext fileLinesContext
    )
focal_method.full_signature: public FileMeasures getFileMeasures(
      PhpFile file,
      CompilationUnitTree tree,
      SymbolTable symbolTable,
      FileLinesContext fileLinesContext
    )
focal_method.identifier: getFileMeasures
focal_method.invocations: analyze setCounterMeasures setLineAndCommentMeasures
focal_method.modifiers: public
focal_method.parameters: (
      PhpFile file,
      CompilationUnitTree tree,
      SymbolTable symbolTable,
      FileLinesContext fileLinesContext
    )
focal_method.return: FileMeasures
focal_method.signature: FileMeasures getFileMeasures(
      PhpFile file,
      CompilationUnitTree tree,
      SymbolTable symbolTable,
      FileLinesContext fileLinesContext
    )