JaCoCo is a production-grade Java code coverage library that instruments JVM bytecode at runtime or offline to collect execution data, then analyzes and reports coverage metrics (lines, branches, instructions, methods, cyclomatic complexity). It is not a standalone application but a multi-module toolset: a Java agent (`jacocoagent.jar`) for on-the-fly instrumentation, a CLI (`jacococli.jar`) for offline operations, a Maven plugin (`jacoco-maven-plugin`) with goals like `prepare-agent`, `report`, `check`, and Ant tasks. The core library (`org.jacoco.core`) handles bytecode manipulation via ASM, probe insertion, and coverage analysis; the report module (`org.jacoco.report`) generates HTML, CSV, XML, and rule-based check outputs. The architecture follows a layered design: instrumentation → runtime data collection → analysis → reporting, with a visitor pattern for report generation and a filter framework to ignore compiler-generated bytecode (e.g., synthetic methods, Kotlin coroutines, try-with-resources). External dependencies include ASM for bytecode engineering, args4j for CLI parsing, and Google Code Prettify for HTML syntax highlighting. The project supports Java versions 5 through 28 (including preview features) and JVM languages like Kotlin, Groovy, and Scala through extensive compiler-specific filters.
This is a GitHub Action that parses JaCoCo XML coverage reports and posts a formatted coverage summary as a comment on pull requests. It supports single and multi-module projects, aggregate reports, multiple counter types (INSTRUCTION, BRANCH, LINE, COMPLEXITY, METHOD), custom emojis, and comment update strategies. The action fetches the list of changed files from the PR via the GitHub API, computes overall and per-file coverage percentages, and renders a markdown table with pass/fail indicators based on configurable thresholds. The codebase is written in TypeScript, well-structured with clear separation of concerns (action orchestration, XML parsing, coverage computation, markdown rendering), and includes a comprehensive test suite with fixtures covering various report structures and edge cases.