Class CoverageMetadataJson
java.lang.Object
org.ek9lang.compiler.ir.data.CoverageMetadataJson
THE serialisation of a source file's coverage metadata (IR tidy W3.9, INFRA-10) - the probes and functions a
CoverageProbePlacer registered, its module-level injection counts and file readability scores - as the JSON
the runtime computes coverage from. Never write this JSON anywhere else. Stateless: hold one.
The format is:
{
"probes": [
{"id": "0x1234...", "type": "FUNCTION_ENTRY", "line": 10, "functionId": "0xABCD..."},
{"id": "0x5678...", "type": "BRANCH_TRUE", "line": 15, "functionId": "0xABCD..."}
],
"functions": [
{"id": "0xABCD...", "name": "myFunction", "startLine": 10, "endLine": 20, "entryProbeId": "0x1234..."}
]
}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionof(List<CoverageProbeDetails> probes, List<CoverageFunctionDetails> functions, int fieldInjections, int registrations, Map<String, String> fileReadability) The JSON of this metadata, or null when there are no probes and no functions.
-
Constructor Details
-
CoverageMetadataJson
public CoverageMetadataJson()
-
-
Method Details
-
of
public String of(List<CoverageProbeDetails> probes, List<CoverageFunctionDetails> functions, int fieldInjections, int registrations, Map<String, String> fileReadability) The JSON of this metadata, or null when there are no probes and no functions.- Parameters:
probes- every probe registered, in registration orderfunctions- every function registered, in registration orderfieldInjections- module-level count of field injectionsregistrations- module-level count of register statementsfileReadability- readability score by source file
-