MCPcopy Create free account
hub / github.com/github/gh-aw / renderPrettyErrorTrend

Function renderPrettyErrorTrend

pkg/cli/audit_cross_run_render.go:292–306  ·  view source on GitHub ↗
(report *CrossRunAuditReport)

Source from the content-addressed store, hash-verified

290}
291
292func renderPrettyErrorTrend(report *CrossRunAuditReport) {
293 et := report.ErrorTrend
294 if et.TotalErrors == 0 && et.TotalWarnings == 0 {
295 return
296 }
297 fmt.Fprintln(os.Stderr, console.FormatInfoMessage("Error Trend"))
298 fmt.Fprintf(os.Stderr, " Runs with errors: %d/%d (%.0f%%)\n",
299 et.RunsWithErrors, report.RunsAnalyzed,
300 safePercent(et.RunsWithErrors, report.RunsAnalyzed))
301 fmt.Fprintf(os.Stderr, " Total errors: %d (avg=%.2f/run)\n", et.TotalErrors, et.AvgErrorsPerRun)
302 if et.TotalWarnings > 0 {
303 fmt.Fprintf(os.Stderr, " Total warnings: %d (%d runs)\n", et.TotalWarnings, et.RunsWithWarnings)
304 }
305 fmt.Fprintln(os.Stderr)
306}
307
308func renderPrettyDomainInventory(report *CrossRunAuditReport) {
309 if len(report.DomainInventory) == 0 {

Callers 1

Calls 2

FormatInfoMessageFunction · 0.92
safePercentFunction · 0.85

Tested by

no test coverage detected