report

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateScore

func CalculateScore(errors, warnings, infos int) int

func FormatHTML

func FormatHTML(result types.ScanResult) (string, error)

func FormatJSON

func FormatJSON(v interface{}) (string, error)

func ParseResult

func ParseResult(data []byte) *types.ScanResult

func ParseResultFromFile

func ParseResultFromFile(path string) (*types.ScanResult, error)

func WriteJSON

func WriteJSON(w io.Writer, v interface{}) error

func WriteSARIF

func WriteSARIF(w io.Writer, result *types.ScanResult) error

Types

type Reporter

type Reporter struct{}

func New

func New() *Reporter

func (*Reporter) BuildResult

func (r *Reporter) BuildResult(files []types.FileResult, summary types.ScanSummary, trustScore int, timestamp string, durationMs int64) types.ScanResult

type SARIFArtifactLocation

type SARIFArtifactLocation struct {
	URI string `json:"uri"`
}

type SARIFDriver

type SARIFDriver struct {
	Name           string      `json:"name"`
	InformationURI string      `json:"informationUri"`
	Rules          []SARIFRule `json:"rules,omitempty"`
}

type SARIFLocation

type SARIFLocation struct {
	PhysicalLocation SARIFPhysicalLocation `json:"physicalLocation"`
}

type SARIFLog

type SARIFLog struct {
	Version string     `json:"version"`
	Schema  string     `json:"$schema"`
	Runs    []SARIFRun `json:"runs"`
}

func NewSARIFLog

func NewSARIFLog(result *types.ScanResult) (*SARIFLog, error)

type SARIFMessage

type SARIFMessage struct {
	Text string `json:"text"`
}

type SARIFPhysicalLocation

type SARIFPhysicalLocation struct {
	ArtifactLocation SARIFArtifactLocation `json:"artifactLocation"`
	Region           SARIFRegion           `json:"region,omitempty"`
}

type SARIFRegion

type SARIFRegion struct {
	StartLine   int `json:"startLine"`
	StartColumn int `json:"startColumn,omitempty"`
}

type SARIFResult

type SARIFResult struct {
	RuleID    string          `json:"ruleId"`
	Level     string          `json:"level"`
	Message   SARIFMessage    `json:"message"`
	Locations []SARIFLocation `json:"locations,omitempty"`
}

type SARIFRule

type SARIFRule struct {
	ID               string       `json:"id"`
	Name             string       `json:"name"`
	ShortDescription SARIFMessage `json:"shortDescription"`
	DefaultLevel     string       `json:"defaultLevel"`
}

type SARIFRun

type SARIFRun struct {
	Tool       SARIFTool              `json:"tool"`
	Results    []SARIFResult          `json:"results"`
	Properties map[string]interface{} `json:"properties,omitempty"`
}

type SARIFTool

type SARIFTool struct {
	Driver SARIFDriver `json:"driver"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL