lib/jacoco/plugin.rb
def report(path, report_url = '', delimiter = %r{\/java\/|\/kotlin\/})
      setup
      classes = classes(delimiter)

      parser = Jacoco::SAXParser.new(classes)
      Nokogiri::XML::SAX::Parser.new(parser).parse(File.open(path))

      total_covered = total_coverage(path)

      report_markdown = "### JaCoCO Code Coverage #{total_covered[:covered]}% #{total_covered[:status]}\n"
      report_markdown << "| Class | Covered | Meta | Status |\n"
      report_markdown << "|:---|:---:|:---:|:---:|\n"
      class_coverage_above_minimum = markdown_class(parser, report_markdown, report_url)
      markdown(report_markdown)

      report_fails(class_coverage_above_minimum, total_covered)
    end
def report(path, report_url = '', delimiter = %r{\/java\/|\/kotlin\/})
      setup
      classes = classes(delimiter)

      parser = Jacoco::SAXParser.new(classes)
      Nokogiri::XML::SAX::Parser.new(parser).parse(File.open(path))

      total_covered = total_coverage(path)

      report_markdown = "### JaCoCO Code Coverage #{total_covered[:covered]}% #{total_covered[:status]}\n"
      report_markdown << "| Class | Covered | Meta | Status |\n"
      report_markdown << "|:---|:---:|:---:|:---:|\n"
      class_coverage_above_minimum = markdown_class(parser, report_markdown, report_url)
      markdown(report_markdown)

      report_fails(class_coverage_above_minimum, total_covered)
    end
def report ( path , report_url = '' , delimiter = %r{ \/ \/ \/ \/ } ) setup classes = classes ( delimiter ) parser = Jacoco :: SAXParser . new ( classes ) Nokogiri :: XML :: SAX :: Parser . new ( parser ) . parse ( File . open ( path ) ) total_covered = total_coverage ( path ) report_markdown = "### JaCoCO Code Coverage #{total_covered[:covered]}% #{total_covered[:status]}\n" report_markdown << "| Class | Covered | Meta | Status |\n" report_markdown << "|:---|:---:|:---:|:---:|\n" class_coverage_above_minimum = markdown_class ( parser , report_markdown , report_url ) markdown ( report_markdown ) report_fails ( class_coverage_above_minimum , total_covered ) end
This is a fast report based on SAX parser

 @path path to the xml output of jacoco
 @report_url URL where html report hosted
 @delimiter git.modified_files returns full paths to the
 changed files. We need to get the class from this path to check the
 Jacoco report,

 e.g. src/java/com/example/SomeJavaClass.java -> com/example/SomeJavaClass
 e.g. src/kotlin/com/example/SomeKotlinClass.kt -> com/example/SomeKotlinClass

 The default value supposes that you're using gradle structure,
 that is your path to source files is something like

 Java => blah/blah/java/slashed_package/Source.java
 Kotlin => blah/blah/kotlin/slashed_package/Source.kt
This is a fast report based on SAX parser