types

package
v0.55.4 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

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 Position

type Position struct {
	Col  int `json:"col"`
	Line int `json:"line"`
}

Position represents where in the file the finding is located.

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.

Jump to

Keyboard shortcuts

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