Package org.ek9lang.cli.coverage
package org.ek9lang.cli.coverage
HTML coverage report generation components using functional interfaces.
This package provides focused, single-responsibility classes for generating HTML coverage reports, following patterns from compiler phases 1-6.
Design Philosophy
Each component implements a functional interface (Function,
BiFunction, Supplier) enabling:
- Single responsibility - one class, one job
- Easy testing - each component can be unit tested in isolation
- Composition - components can be combined via constructor injection
- Immutability - no shared mutable state
Available Components
Section Generators (return HTML strings)
StatusBannerHtml- Pass/fail status bannerAttentionSectionHtml- Modules below thresholdMetricsSectionHtml- Code quality metricsModuleTreeHtml- Hierarchical module listingModuleRowHtml- Single module rowFunctionRowsHtml- Function coverage rowsSourceLinesHtml- Line-by-line source viewComplexityBadgeHtml- Complexity indicator
Data Collection
SourceFileCoverageCollector- Collects coverage data
Model Records
See org.ek9lang.cli.coverage.model for data transfer records.
Future Work
These components are ready to be wired into the existing
CoverageOutputFormatter.HtmlCoverageFormatter to replace
its inline methods, further reducing the class size from ~1,800 lines.
- See Also:
-
ClassDescriptionGenerates the attention required section showing modules below coverage threshold.Generates HTML badge for branch coverage indicators.Generates HTML for a complexity badge with tooltip showing code quality metrics.Constants for coverage report generation.Centralized utility for building coverage report links.Supplies all covered probes as a unified ProbeData stream.Filters modules below coverage threshold and sorts by coverage (worst first).Generates HTML rows for covered and uncovered functions in a module.Generates the code quality metrics section using dial charts.Groups modules by their top-level package name.Calculates aggregate statistics for a group of modules.Collects ModuleInfo for all modules from CoverageRuntime.Extracts module name from EK9 source file.Generates HTML for a single module row in the coverage module tree.Generates the module tree HTML showing hierarchical grouping of modules.Processes coverage probes into file-based coverage maps.Detects if a source line is a return declaration with initialization.Determines severity level based on coverage percentage.Severity levels for coverage status.Maps severity level to CSS class and icon.Visual styling for a severity level.Resolves coverage for lines within function signatures.Collects coverage data from CoverageRuntime and scans source files.Builds SourceFileInfo objects from coverage data.Groups source files by their module name.Scans file system for EK9 source files.Generates HTML for line-by-line source code view with coverage highlighting.Generates the status banner HTML showing pass/fail state based on coverage threshold.Supplies all uncovered probes as a unified ProbeData stream.