sarifutils

package
v1.13.4 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 6 Imported by: 1

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

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

func ConvertRunsPathsToRelative

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

func CopyLocation

func CopyLocation(location *sarif.Location) *sarif.Location

func CopyResult

func CopyResult(result *sarif.Result) *sarif.Result

func CopyRules added in v1.13.0

func CopyRules(rules ...*sarif.ReportingDescriptor) (copied []*sarif.ReportingDescriptor)

func CopyRun added in v1.13.0

func CopyRun(run *sarif.Run) *sarif.Run

func CopyRunMetadata

func CopyRunMetadata(run *sarif.Run) (copied *sarif.Run)

func CreateCodeFlow

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

func CreateDummyDriver

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

func CreateDummyLocationInPath

func CreateDummyLocationInPath(fileName string) *sarif.Location

func CreateDummyLocationWithPathAndLogicalLocation

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

func CreateDummyPassingResult

func CreateDummyPassingResult(ruleId string) *sarif.Result

func CreateDummyResult

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

func CreateDummyResultInPath

func CreateDummyResultInPath(fileName string) *sarif.Result

func CreateDummyResultWithFingerprint

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

func CreateDummyResultWithPathAndLogicalLocation

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

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

func CreateResultWithDummyLocationAmdProperty

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

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

func CreateRunNameWithResults

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

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) *sarif.ArtifactContent

func GetLocationSnippetText

func GetLocationSnippetText(location *sarif.Location) string

func GetLocationStartColumn

func GetLocationStartColumn(location *sarif.Location) int

func GetLocationStartLine

func GetLocationStartLine(location *sarif.Location) int

func GetLogicalLocation

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

func GetRelativeLocationFileName

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

func GetResultFileLocations

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

func GetResultFingerprint

func GetResultFingerprint(result *sarif.Result) string

func GetResultLevel

func GetResultLevel(result *sarif.Result) string

func GetResultLocationSnippets

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

func GetResultMsgText

func GetResultMsgText(result *sarif.Result) string

func GetResultProperty

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

func GetResultRuleId

func GetResultRuleId(result *sarif.Result) string

func GetResultsLocationCount

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

func GetRuleById

func GetRuleById(run *sarif.Run, ruleId string) *sarif.ReportingDescriptor

func GetRuleFullDescription

func GetRuleFullDescription(rule *sarif.ReportingDescriptor) string

func GetRuleFullDescriptionMarkdown

func GetRuleFullDescriptionMarkdown(rule *sarif.ReportingDescriptor) string

func GetRuleFullDescriptionText

func GetRuleFullDescriptionText(rule *sarif.ReportingDescriptor) string

func GetRuleHelp

func GetRuleHelp(rule *sarif.ReportingDescriptor) string

func GetRuleHelpMarkdown

func GetRuleHelpMarkdown(rule *sarif.ReportingDescriptor) string

func GetRuleProperty

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

func GetRuleShortDescription

func GetRuleShortDescription(rule *sarif.ReportingDescriptor) string

func GetRuleShortDescriptionText

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 GetRunToolFullDescription

func GetRunToolFullDescription(run *sarif.Run) string

func GetRunToolFullDescriptionMarkdown

func GetRunToolFullDescriptionMarkdown(run *sarif.Run) string

func GetRunToolFullDescriptionText

func GetRunToolFullDescriptionText(run *sarif.Run) string

func GetRunToolFullName

func GetRunToolFullName(run *sarif.Run) string

func GetRunToolInformationURI

func GetRunToolInformationURI(run *sarif.Run) string

func GetRunToolName

func GetRunToolName(run *sarif.Run) string

func GetRunsByToolName

func GetRunsByToolName(report *sarif.Report, toolName string) (filteredRuns []*sarif.Run)

func GetRunsByWorkingDirectory

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

func GetToolVersion

func GetToolVersion(run *sarif.Run) string

func IsFingerprintsExists

func IsFingerprintsExists(result *sarif.Result) bool

func IsResultKindNotPass

func IsResultKindNotPass(result *sarif.Result) bool

func NewLogicalLocation

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

func NewPhysicalLocation

func NewPhysicalLocation(physicalPath string) *sarif.PhysicalLocation

func NewPhysicalLocationWithRegion

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

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

func SetResultMsgMarkdown

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

func SetRuleShortDescriptionText

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

func SetRunToolFullDescriptionMarkdown

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

func SetRunToolFullDescriptionText

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

func SetRunToolName

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