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★ 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
- Confirm the JVM build is Maven / Gradle (see When to use).
- Wire the
jacoco-maven-pluginwith the three primary goals -prepare-agent,report,check(below); Gradle's equivalent is in references/gradle-parsing-and-ci.md. - Run
mvn verify; read thecheckverdict and the HTML attarget/site/jacoco/index.html. - Gate on INSTRUCTION + BRANCH ratios, then parse
jacoco.xmlfor PR comments and convert to LCOV / Cobertura for cross-language aggregation - the parser, the counter-aware gating table, the format conversions, and the full MavenverifyCI 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. |
Установить jacoco-analysis в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
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), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic