sarifutils

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AggregateMultipleRunsIntoSingle

func AggregateMultipleRunsIntoSingle(runs []*sarif.Run, destination *sarif.Run)

func CombineReports added in v1.8.0

func CombineReports(reports ...*sarif.Report) (combined *sarif.Report, err error)

func ConvertRunsPathsToRelative added in v1.8.0

func ConvertRunsPathsToRelative(runs ...*sarif.Run)

func CreateCodeFlow

func CreateCodeFlow(threadFlows ...*sarif.ThreadFlow) *sarif.CodeFlow

func CreateDummyDriver added in v1.8.0

func CreateDummyDriver(toolName, infoURI string, rules ...*sarif.ReportingDescriptor) *sarif.ToolComponent

func CreateDummyLocationInPath added in v1.8.0

func CreateDummyLocationInPath(fileName string) *sarif.Location

func CreateDummyLocationWithPathAndLogicalLocation added in v1.8.0

func CreateDummyLocationWithPathAndLogicalLocation(fileName, logicalName, kind, property, value string) *sarif.Location

func CreateDummyPassingResult

func CreateDummyPassingResult(ruleId string) *sarif.Result

func CreateDummyResult added in v1.8.0

func CreateDummyResult(markdown, msg, ruleId, level string) *sarif.Result

func CreateDummyResultInPath added in v1.8.0

func CreateDummyResultInPath(fileName string) *sarif.Result

func CreateDummyResultWithFingerprint added in v1.8.0

func CreateDummyResultWithFingerprint(markdown, msg, algorithm, value string, locations ...*sarif.Location) *sarif.Result

func CreateDummyResultWithPathAndLogicalLocation added in v1.8.0

func CreateDummyResultWithPathAndLogicalLocation(fileName, logicalName, kind, property, value string) *sarif.Result

func CreateLocation

func CreateLocation(fileName string, startLine, startCol, endLine, endCol int, snippet string) *sarif.Location

func CreateLogicalLocationWithProperty added in v1.8.0

func CreateLogicalLocationWithProperty(name, kind, property, value string) *sarif.LogicalLocation

func CreateResultWithDummyLocationAmdProperty added in v1.8.0

func CreateResultWithDummyLocationAmdProperty(fileName, property, value string) *sarif.Result

func CreateResultWithLocations

func CreateResultWithLocations(msg, ruleId, level string, locations ...*sarif.Location) *sarif.Result

func CreateResultWithOneLocation

func CreateResultWithOneLocation(fileName string, startLine, startCol, endLine, endCol int, snippet, ruleId, level string) *sarif.Result

func CreateResultWithProperties added in v1.10.0

func CreateResultWithProperties(msg, ruleId, level string, properties map[string]string, locations ...*sarif.Location) *sarif.Result

func CreateRunNameWithResults added in v1.8.0

func CreateRunNameWithResults(toolName string, results ...*sarif.Result) *sarif.Run

func CreateRunWithDummyResultAndRuleProperties

func CreateRunWithDummyResultAndRuleProperties(result *sarif.Result, properties, values []string) *sarif.Run

func CreateRunWithDummyResults

func CreateRunWithDummyResults(results ...*sarif.Result) *sarif.Run

func CreateRunWithDummyResultsInWd added in v1.8.0

func CreateRunWithDummyResultsInWd(wd string, results ...*sarif.Result) *sarif.Run

func CreateThreadFlow

func CreateThreadFlow(locations ...*sarif.Location) *sarif.ThreadFlow

func ExtractRelativePath

func ExtractRelativePath(resultPath string, projectRoot string) string

func GetFullLocationFileName

func GetFullLocationFileName(relative string, invocations []*sarif.Invocation) string

func GetInvocationWorkingDirectory

func GetInvocationWorkingDirectory(invocation *sarif.Invocation) string

func GetLocationEndColumn

func GetLocationEndColumn(location *sarif.Location) int

func GetLocationEndLine

func GetLocationEndLine(location *sarif.Location) int

func GetLocationFileName

func GetLocationFileName(location *sarif.Location) string

func GetLocationId

func GetLocationId(location *sarif.Location) string

func GetLocationRelatedCodeFlowsFromResult

func GetLocationRelatedCodeFlowsFromResult(location *sarif.Location, result *sarif.Result) (codeFlows []*sarif.CodeFlow)

func GetLocationSnippet

func GetLocationSnippet(location *sarif.Location) string

func GetLocationStartColumn

func GetLocationStartColumn(location *sarif.Location) int

func GetLocationStartLine

func GetLocationStartLine(location *sarif.Location) int

func GetLogicalLocation added in v1.8.0

func GetLogicalLocation(kind string, location *sarif.Location) *sarif.LogicalLocation

func GetRelativeLocationFileName

func GetRelativeLocationFileName(location *sarif.Location, invocations []*sarif.Invocation) string

func GetResultFileLocations added in v1.8.0

func GetResultFileLocations(result *sarif.Result) []string

func GetResultFingerprint added in v1.8.1

func GetResultFingerprint(result *sarif.Result) string

func GetResultLevel

func GetResultLevel(result *sarif.Result) string

func GetResultLocationSnippets added in v1.8.0

func GetResultLocationSnippets(result *sarif.Result) []string

func GetResultMsgText

func GetResultMsgText(result *sarif.Result) string

func GetResultProperty added in v1.10.0

func GetResultProperty(key string, result *sarif.Result) string

func GetResultRuleId added in v1.8.0

func GetResultRuleId(result *sarif.Result) string

func GetResultsLocationCount

func GetResultsLocationCount(runs ...*sarif.Run) (count int)

func GetRuleFullDescriptionText added in v1.8.0

func GetRuleFullDescriptionText(rule *sarif.ReportingDescriptor) string

func GetRuleProperty added in v1.9.0

func GetRuleProperty(key string, rule *sarif.ReportingDescriptor) string

func GetRuleShortDescriptionText added in v1.8.0

func GetRuleShortDescriptionText(rule *sarif.ReportingDescriptor) string

func GetRulesPropertyCount

func GetRulesPropertyCount(property, value string, runs ...*sarif.Run) (count int)

func GetRunRules

func GetRunRules(run *sarif.Run) []*sarif.ReportingDescriptor

func GetRunToolFullDescriptionMarkdown added in v1.8.0

func GetRunToolFullDescriptionMarkdown(run *sarif.Run) string

func GetRunToolFullDescriptionText added in v1.8.0

func GetRunToolFullDescriptionText(run *sarif.Run) string

func GetRunToolName added in v1.8.0

func GetRunToolName(run *sarif.Run) string

func GetRunsByWorkingDirectory

func GetRunsByWorkingDirectory(workingDirectory string, runs ...*sarif.Run) (filteredRuns []*sarif.Run)

func IsFingerprintsExists added in v1.8.0

func IsFingerprintsExists(result *sarif.Result) bool

func IsResultKindNotPass

func IsResultKindNotPass(result *sarif.Result) bool

func NewLogicalLocation added in v1.8.0

func NewLogicalLocation(name, kind string) *sarif.LogicalLocation

func NewPhysicalLocation added in v1.8.0

func NewPhysicalLocation(physicalPath string) *sarif.PhysicalLocation

func NewPhysicalLocationWithRegion added in v1.8.0

func NewPhysicalLocationWithRegion(physicalPath string, startRow, endRow, startCol, endCol int) *sarif.PhysicalLocation

func NewReport

func NewReport() (*sarif.Report, error)

func ReadScanRunsFromFile

func ReadScanRunsFromFile(fileName string) (sarifRuns []*sarif.Run, err error)

func SetLocationFileName

func SetLocationFileName(location *sarif.Location, fileName string)

func SetLocationSnippet

func SetLocationSnippet(location *sarif.Location, snippet string)

func SetResultFingerprint added in v1.8.0

func SetResultFingerprint(algorithm, value string, result *sarif.Result)

func SetResultMsgMarkdown added in v1.8.0

func SetResultMsgMarkdown(markdown string, result *sarif.Result)

func SetRuleShortDescriptionText added in v1.8.0

func SetRuleShortDescriptionText(value string, rule *sarif.ReportingDescriptor)

func SetRunToolFullDescriptionMarkdown added in v1.8.0

func SetRunToolFullDescriptionMarkdown(markdown string, run *sarif.Run)

func SetRunToolFullDescriptionText added in v1.8.0

func SetRunToolFullDescriptionText(txt string, run *sarif.Run)

func SetRunToolName added in v1.8.0

func SetRunToolName(toolName string, run *sarif.Run)

Types

This section is empty.

Jump to

Keyboard shortcuts

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