Class AccuracyReportRenderer

java.lang.Object
org.egothor.methodatlas.eval.AccuracyReportRenderer

public final class AccuracyReportRenderer extends Object
Renders an AccuracyEvaluator.Evaluation as Markdown or JSON.

Determinism

The output is a pure function of the evaluation: lines end with \n on every platform (never the platform line separator), numbers are formatted with Locale.ROOT to four decimal places (never a locale decimal comma), tags are listed in sorted order, and the report contains no timestamp, path or host information. Two runs over the same inputs are therefore byte-identical on any operating system, in line with the cross-platform determinism contract of the scan output.

An undefined metric (zero denominator, see AccuracyMetrics) is rendered as n/a in Markdown and as JSON null.

This class is stateless and thread-safe.

Since:
6.1.0
See Also:
  • Field Details

    • JSON_SCHEMA_VERSION

      public static final int JSON_SCHEMA_VERSION
      JSON report schema version; bump on any breaking field change.
      See Also:
  • Method Details

    • markdown

      public static String markdown(AccuracyEvaluator.Evaluation ev)
      Renders the evaluation as a Markdown document.
      Parameters:
      ev - evaluation to render; must not be null
      Returns:
      Markdown text with \n line endings, ending in a newline
    • json

      public static String json(AccuracyEvaluator.Evaluation ev)
      Renders the evaluation as a JSON document.

      Keys appear in a fixed order. Undefined metrics are null.

      Parameters:
      ev - evaluation to render; must not be null
      Returns:
      JSON text with \n line endings, ending in a newline