Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCWEInvalidFormat = fmt.Errorf("invalid CWE format")
ErrCWEInvalidFormat is returned when the CWE field is not in the expected format.
View Source
var ErrCWEInvalidNumber = fmt.Errorf("invalid CWE number %w", ErrCWEInvalidFormat)
ErrCWEInvalidNumber is returned when the CWE number is not a valid number.
View Source
var ErrCWEMissingPrefix = fmt.Errorf("missing `CWE-` prefix %w", ErrCWEInvalidFormat)
ErrCWEMissingPrefix is returned when the CWE field is missing the `CWE-` prefix.
Functions ¶
This section is empty.
Types ¶
type Extra ¶
type Extra struct { Message string `json:"message"` Metavars Metavars `json:"metavars"` Metadata Metadata `json:"metadata"` Severity string `json:"severity"` Lines string `json:"lines"` }
Extra contains extra info needed for semgrep issue.
type FlexibleIntField ¶ added in v0.26.0
type FlexibleIntField []int32
FlexibleIntField is a field that can be either a single int or a list of ints.
func (*FlexibleIntField) UnmarshalJSON ¶ added in v0.26.0
func (f *FlexibleIntField) UnmarshalJSON(data []byte) error
type Metadata ¶
type Metadata struct {
CWE FlexibleIntField `json:"cwe"`
}
Metadata contains semgrep issue metadata
type Metavars ¶
type Metavars struct{}
Metavars currently is empty but could represent more metavariables for semgrep.
type SemgrepIssue ¶
type SemgrepIssue struct { CheckID string `json:"check_id"` Path string `json:"path"` Start Position `json:"start"` End Position `json:"end"` Extra Extra `json:"extra"` }
SemgrepIssue represents a semgrep issue.
type SemgrepResults ¶
type SemgrepResults struct {
Results []SemgrepIssue `'json:"results"`
}
SemgrepResults represents a series of semgrep issues.
Click to show internal directories.
Click to hide internal directories.