Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

jacoco-analysis

БесплатноБез исполняемых скриптовНе проверен

Use for any question or task about Java, Kotlin, Scala or Groovy code coverage on Gradle or Maven, including a build that should fail below a minimum or a…

testlandот testland★ 18 звёзд на GitHub

Об этом скилле

jacoco-analysis

Overview

JaCoCo (the canonical JVM coverage tool) instruments Java bytecode at runtime via a Java agent, then aggregates execution data into per-class / per-method / per-line reports.

Per jacoco-counters, JaCoCo measures six counters:

Counter Definition
Instructions (C0) "The smallest unit JaCoCo counts are single Java byte code instructions."
Branches (C1) Coverage "for all if and switch statements."
Lines "A source line is considered executed when at least one instruction that is assigned to this line has been executed."
Methods "A method is considered as executed when at least one instruction has been executed."
Classes "A class is considered as executed when at least one of its methods has been executed."
Cyclomatic Complexity "v(G) = B - D + 1 (branches minus decision points plus one)" - minimum number of paths needed to cover all paths through a method.

This skill covers Maven (the primary deployment), with the bytecode-only key insight: "All counters work at bytecode level, making them available regardless of debug information presence" (jacoco-counters). Gradle, the XML parser, and the cross-language conversions live in the reference file.

When to use

  • A JVM project (Java / Kotlin / Scala / Groovy) needs coverage and the team is on Maven or Gradle.
  • A Cobertura-based pipeline is migrating to JaCoCo (typical: Cobertura is unmaintained for JDK 11+; JaCoCo handles modern bytecode).
  • Cross-language aggregation needs JaCoCo XML converted to LCOV / Cobertura.

How to use

  1. Confirm the JVM build is Maven / Gradle (see When to use).
  2. Wire the jacoco-maven-plugin with the three primary goals - prepare-agent, report, check (below); Gradle's equivalent is in references/gradle-parsing-and-ci.md.
  3. Run mvn verify; read the check verdict and the HTML at target/site/jacoco/index.html.
  4. Gate on INSTRUCTION + BRANCH ratios, then parse jacoco.xml for PR comments and convert to LCOV / Cobertura for cross-language aggregation - the parser, the counter-aware gating table, the format conversions, and the full Maven verify CI job are in references/gradle-parsing-and-ci.md.

Wire the Maven plugin

Per jacoco-maven, the plugin defines several goals; the three primary ones are prepare-agent, report, and check (jacoco-maven):

<plugin>
  <groupId>org.jacoco</groupId>
  <artifactId>jacoco-maven-plugin</artifactId>
  <version>0.8.13</version>
  <executions>
    <execution>
      <id>prepare-agent</id>
      <goals>
        <goal>prepare-agent</goal>
      </goals>
    </execution>
    <execution>
      <id>report</id>
      <phase>verify</phase>
      <goals>
        <goal>report</goal>
      </goals>
    </execution>
    <execution>
      <id>check</id>
      <phase>verify</phase>
      <goals>
        <goal>check</goal>
      </goals>
      <configuration>
        <rules>
          <rule>
            <element>BUNDLE</element>
            <limits>
              <limit>
                <counter>INSTRUCTION</counter>
                <value>COVEREDRATIO</value>
                <minimum>0.80</minimum>
              </limit>
              <limit>
                <counter>BRANCH</counter>
                <value>COVEREDRATIO</value>
                <minimum>0.70</minimum>
              </limit>
            </limits>
          </rule>
        </rules>
      </configuration>
    </execution>
  </executions>
</plugin>

prepare-agent configures the JaCoCo runtime agent for the forked test JVM; report generates HTML / XML / CSV from target/jacoco.exec; check enforces thresholds.

Per jacoco-maven: "Maven 3.0 or higher and Java 1.8 or higher for the Maven runtime, Java 1.5 or higher for the test executor."

Report formats

The report goal emits three artifacts under target/site/jacoco/:

File Format Use
index.html + assets HTML drill-down Human review.
jacoco.xml XML (with DTD) CI parsing; Cobertura-shape conversion.
jacoco.csv CSV per-class Spreadsheets; quick scripting.
Полный SKILL.md на GitHub

Установить jacoco-analysis в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

.tessl-plugin/plugin.jsonreferences/gradle-parsing-and-ci.md

FAQ

Что делает скилл jacoco-analysis?

Use for any question or task about Java, Kotlin, Scala or Groovy code coverage on Gradle or Maven, including a build that should fail below a minimum or a coverage report that comes out empty in CI: JaCoCo agent setup, HTML, XML and CSV reports, check rules such as 80% lines, the six counters, and JaCoCo XML to LCOV or Cobertura.

Как установить скилл jacoco-analysis?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл jacoco-analysis запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить jacoco-analysis с