sarif

package
v0.0.0-...-d1c953a Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFixFromIssue

func BuildFixFromIssue(issue testapi.Issue) map[string]string

BuildFixFromIssue builds SARIF fix from an issue (nil if the issue is not fixable)

func BuildHelpMarkdown

func BuildHelpMarkdown(issue testapi.Issue, findingType testapi.FindingType) string

BuildHelpMarkdown constructs the help markdown section for SARIF rules

func BuildLocation

func BuildLocation(issue testapi.Issue, targetFile string) map[string]interface{}

BuildLocation constructs a SARIF location object from issue data

func BuildRuleFullDescription

func BuildRuleFullDescription(issue testapi.Issue) string

BuildRuleFullDescription creates the full description for a SARIF rule

func BuildRuleShortDescription

func BuildRuleShortDescription(issue testapi.Issue) string

BuildRuleShortDescription creates the short description for a SARIF rule

func BuildRuleTags

func BuildRuleTags(issue testapi.Issue) []interface{}

BuildRuleTags creates the tags array for a SARIF rule

func ConvertTypeToDriverName

func ConvertTypeToDriverName(s string) string

func CreateCodeSummary

func CreateCodeSummary(input *sarif.SarifDocument, projectPath string) *json_schemas.TestSummary

CreateCodeSummary Iterates through the sarif data and create a summary out of it.

func FormatIssueMessage

func FormatIssueMessage(issue testapi.Issue) string

FormatIssueMessage creates the SARIF message text for an issue

func GetHighestSuppression

func GetHighestSuppression(suppressions []sarif.Suppression) (*sarif.Suppression, sarif.SuppresionStatus)

GetHighestSuppression returns the suppression details if any and its status. It prioritizes suppressions based on their status: Accepted > UnderReview > Rejected. If multiple suppressions exist, the one with the highest precedence is returned. An empty Status is treated as Accepted. If no suppressions are found, returns nil.

func GetRuleCVSSScore

func GetRuleCVSSScore(issue testapi.Issue) float32

GetRuleCVSSScore extracts the CVSS score from issue metadata

func IsHighestSuppressionStatus

func IsHighestSuppressionStatus(suppressions []sarif.Suppression, status sarif.SuppresionStatus) bool

IsHighestSuppressionStatus returns true if the suppression with the provided status exists and has the highest precedence.

func SarifLevelToSeverity

func SarifLevelToSeverity(level string) string

Convert Sarif Level to internal Severity

func SeverityToSarifLevel

func SeverityToSarifLevel(severity string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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