Record Class CoverageFunctionDetails

java.lang.Object
java.lang.Record
org.ek9lang.compiler.ir.data.CoverageFunctionDetails
Record Components:
functionId - Globally unique function identifier (FNV-1a 64-bit hash)
fullyQualifiedName - Full name including module (e.g., "mymodule::MyClass._add")
simpleName - Simple function/method name (e.g., "_add")
sourceFile - Source file containing this function
startLine - Starting line of the function definition
signatureEndLine - Last line of the function signature (including return declaration)
endLine - Ending line of the function definition (body end)
probeCount - Number of probes within this function
entryProbeId - GUID of the FUNCTION_ENTRY probe for this function
metrics - Code quality metrics (complexity, cognitive, nesting, etc.)

public record CoverageFunctionDetails(long functionId, String fullyQualifiedName, String simpleName, String sourceFile, int startLine, int signatureEndLine, int endLine, int probeCount, long entryProbeId, FunctionMetrics metrics) extends Record
Represents coverage information for a single function/method.

Used for function-level coverage reporting and mapping probes back to their containing functions. Now includes code quality metrics collected during Phase 5 for integrated coverage + quality reports.

Function IDs are globally unique GUIDs generated from a deterministic hash of the function's location context. This ensures uniqueness across all source files without coordination during parallel compilation.

  • Constructor Details

    • CoverageFunctionDetails

      public CoverageFunctionDetails(long functionId, String fullyQualifiedName, String simpleName, String sourceFile, int startLine, int signatureEndLine, int endLine, int probeCount, long entryProbeId, FunctionMetrics metrics)
      Canonical constructor with null-safety for metrics.
  • Method Details

    • hasProbes

      public boolean hasProbes()
      Check if this function has any coverage probes.
    • lineCount

      public int lineCount()
      Get the line count for this function.
    • needsQualityAttention

      public boolean needsQualityAttention()
      Check if this function needs quality attention based on metrics.
      Returns:
      true if complexity metrics exceed thresholds
    • hasHighComplexity

      public boolean hasHighComplexity()
      Check if this function has high complexity.
      Returns:
      true if cyclomatic or cognitive complexity is high
    • severityLevel

      @Nonnull public String severityLevel()
      Get severity level for display ("critical", "warning", or "ok").
      Returns:
      severity level string
    • toString

      @Nonnull public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • functionId

      public long functionId()
      Returns the value of the functionId record component.
      Returns:
      the value of the functionId record component
    • fullyQualifiedName

      public String fullyQualifiedName()
      Returns the value of the fullyQualifiedName record component.
      Returns:
      the value of the fullyQualifiedName record component
    • simpleName

      public String simpleName()
      Returns the value of the simpleName record component.
      Returns:
      the value of the simpleName record component
    • sourceFile

      public String sourceFile()
      Returns the value of the sourceFile record component.
      Returns:
      the value of the sourceFile record component
    • startLine

      public int startLine()
      Returns the value of the startLine record component.
      Returns:
      the value of the startLine record component
    • signatureEndLine

      public int signatureEndLine()
      Returns the value of the signatureEndLine record component.
      Returns:
      the value of the signatureEndLine record component
    • endLine

      public int endLine()
      Returns the value of the endLine record component.
      Returns:
      the value of the endLine record component
    • probeCount

      public int probeCount()
      Returns the value of the probeCount record component.
      Returns:
      the value of the probeCount record component
    • entryProbeId

      public long entryProbeId()
      Returns the value of the entryProbeId record component.
      Returns:
      the value of the entryProbeId record component
    • metrics

      public FunctionMetrics metrics()
      Returns the value of the metrics record component.
      Returns:
      the value of the metrics record component