Documentation
¶
Index ¶
- func CapitalizeFirst(s string) string
- func LogFindings(summary Summary, level string)
- func WriteFile(report *Report, filename string) error
- type ArtifactLocation
- type CodeFlow
- type DefaultConfiguration
- type Driver
- type FullDescription
- type Help
- type Location
- type LogicalLocation
- type Message
- type PhysicalLocation
- type PrintableResult
- type Properties
- type Region
- type Report
- type Result
- type Rule
- type Run
- type ShortDescription
- type Summary
- type ThreadFlow
- type ThreadFlowLocation
- type Tool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CapitalizeFirst ¶
func LogFindings ¶ added in v1.0.1
Types ¶
type ArtifactLocation ¶
type ArtifactLocation struct {
URI string `json:"uri"`
URIBaseID *string `json:"uriBaseId,omitempty"`
}
ArtifactLocation specifies the location of an artifact
type CodeFlow ¶
type CodeFlow struct {
ThreadFlows []ThreadFlow `json:"threadFlows"`
}
CodeFlow represents a code flow in the analysis results
type DefaultConfiguration ¶
type DefaultConfiguration struct {
Level string `json:"level"`
}
type Driver ¶
type Driver struct {
Name *string `json:"name"`
Organization *string `json:"organization"`
Version *string `json:"version"`
Rules []*Rule `json:"rules,omitempty"`
}
Driver contains information about the tool's driver
type FullDescription ¶
type FullDescription struct {
Text string `json:"text"`
}
type Location ¶
type Location struct {
PhysicalLocation *PhysicalLocation `json:"physicalLocation"`
LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"`
Message *Message `json:"message,omitempty"`
}
Location represents a location in source code
type LogicalLocation ¶
type LogicalLocation struct {
FullyQualifiedName *string `json:"fullyQualifiedName,omitempty"`
DecoratedName *string `json:"decoratedName,omitempty"`
}
LogicalLocation represents a logical location in the code, such as a function or class
type Message ¶
type Message struct {
Text string `json:"text"`
}
Message contains the text of a result message
type PhysicalLocation ¶
type PhysicalLocation struct {
ArtifactLocation *ArtifactLocation `json:"artifactLocation"`
Region *Region `json:"region,omitempty"`
}
PhysicalLocation specifies the location of a result
type PrintableResult ¶
type Properties ¶
type Properties struct {
Tags []string `json:"tags"`
}
type Region ¶
type Region struct {
StartLine int `json:"startLine"`
StartColumn *int `json:"startColumn,omitempty"`
EndLine *int `json:"endLine,omitempty"`
EndColumn *int `json:"endColumn,omitempty"`
}
Region represents a region of an artifact's content
type Report ¶
type Report struct {
Version *string `json:"version"`
Schema *string `json:"$schema"`
Runs []*Run `json:"runs"`
}
Report represents a SARIF report
func (*Report) PrintSummary ¶
func (report *Report) PrintSummary()
PrintSummary prints a human-readable summary of the SARIF report
func (*Report) UpdateRuleId ¶
func (*Report) UpdateURIInfo ¶
UpdateURIInfo updates URI information in the SARIF report
type Result ¶
type Result struct {
Level string `json:"level"`
Message *Message `json:"message,omitempty"`
RuleId string `json:"ruleId"`
Locations []*Location `json:"locations,omitempty"`
CodeFlows []*CodeFlow `json:"codeFlows,omitempty"`
}
Result represents a single result produced by the tool
type Rule ¶
type Rule struct {
ID *string `json:"id"`
Name *string `json:"name,omitempty"`
DefaultConfiguration *DefaultConfiguration `json:"defaultConfiguration,omitempty"`
FullDescription *FullDescription `json:"fullDescription,omitempty"`
ShortDescription *ShortDescription `json:"shortDescription,omitempty"`
Properties *Properties `json:"properties,omitempty"`
}
Rule represents a rule that was run
type Run ¶
type Run struct {
Tool *Tool `json:"tool"`
Results []*Result `json:"results,omitempty"`
OriginalUriBaseIds map[string]ArtifactLocation `json:"originalUriBaseIds,omitempty"`
}
Run represents a single run of a static analysis tool
type ShortDescription ¶
type ShortDescription struct {
Text string `json:"text"`
}
type Summary ¶
type Summary struct {
TotalFindings int
TotalRulesRun int
TotalRulesTriggered int
FindingsByLevel map[string]int
}
Summary represents a summary of SARIF findings
func GenerateSummary ¶
GenerateSummary generates a summary of the SARIF report
type ThreadFlow ¶
type ThreadFlow struct {
Locations []ThreadFlowLocation `json:"locations"`
}
ThreadFlow represents a thread flow in the analysis results