Documentation ¶
Index ¶
- func IsNotExistError(err error) bool
- func WrapNotExistError(err error) error
- type ErrorDetails
- type ErrorType
- type Finding
- func (f *Finding) Exists(projectDir string) (bool, error)
- func (f *Finding) GetDetails() string
- func (f *Finding) GetSeedPath() string
- func (f *Finding) MoveInputFile(projectDir, seedCorpusDir string) error
- func (f *Finding) Save(projectDir string) error
- func (f *Finding) ShortDescription() string
- func (f *Finding) ShortDescriptionColumns() []string
- func (f *Finding) ShortDescriptionWithName() string
- type NotExistError
- type Severity
- type SeverityLevel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotExistError ¶ added in v0.1.4
func WrapNotExistError ¶ added in v0.1.4
WrapNotExistError wraps an existing error into a NotExistError to hint on disabling the sandbox when the error is handled.
Types ¶
type ErrorDetails ¶
type ErrorType ¶
type ErrorType string
const ( ErrorType_UNKNOWN_ERROR ErrorType = "UNKNOWN_ERROR" ErrorType_COMPILATION_ERROR ErrorType = "COMPILATION_ERROR" ErrorType_CRASH ErrorType = "CRASH" ErrorType_WARNING ErrorType = "WARNING" ErrorType_RUNTIME_ERROR ErrorType = "RUNTIME_ERROR" )
These constants must have this exact value (in uppercase) to be able to parse JSON-marshalled reports as protobuf reports which use an enum for this field.
type Finding ¶
type Finding struct { Name string `json:"name,omitempty"` Type ErrorType `json:"type,omitempty"` InputData []byte `json:"input_data,omitempty"` Logs []string `json:"logs,omitempty"` Details string `json:"details,omitempty"` HumanReadableInput string `json:"human_readable_input,omitempty"` MoreDetails *ErrorDetails `json:"more_details,omitempty"` Tag uint64 `json:"tag,omitempty"` InputFile string // Note: The following fields don't exist in the protobuf // representation used in the Code Intelligence core repository. CreatedAt time.Time `json:"created_at,omitempty"` StackTrace []*stacktrace.StackFrame `json:"stack_trace,omitempty"` // contains filtered or unexported fields }
func ListFindings ¶ added in v0.1.4
ListFindings parses the JSON files of all findings and returns the result.
func LoadFinding ¶ added in v0.1.4
LoadFinding parses the JSON file of the specified finding and returns the result. If the specified finding does not exist, a NotExistError is returned.
func (*Finding) Exists ¶ added in v0.1.5
Exists returns whether the JSON file of this finding already exists
func (*Finding) GetDetails ¶
func (*Finding) GetSeedPath ¶ added in v0.1.5
func (*Finding) MoveInputFile ¶ added in v0.1.5
MoveInputFile copies the input file to the finding directory and the seed corpus directory and adjusts the finding logs accordingly.
func (*Finding) ShortDescription ¶
func (*Finding) ShortDescriptionColumns ¶ added in v0.5.0
func (*Finding) ShortDescriptionWithName ¶ added in v0.5.0
type NotExistError ¶ added in v0.1.4
type NotExistError struct {
// contains filtered or unexported fields
}
A NotExistError indicates that the specified finding does not exist
func (NotExistError) Error ¶ added in v0.1.4
func (e NotExistError) Error() string
func (NotExistError) Unwrap ¶ added in v0.1.4
func (e NotExistError) Unwrap() error
type Severity ¶
type Severity struct { Level SeverityLevel `json:"description,omitempty"` Score float32 `json:"score,omitempty"` }
type SeverityLevel ¶ added in v0.1.5
type SeverityLevel string
const ( SeverityLevel_CRITICAL SeverityLevel = "CRITICAL" SeverityLevel_HIGH SeverityLevel = "HIGH" SeverityLevel_MEDIUM SeverityLevel = "MEDIUM" SeverityLevel_LOW SeverityLevel = "LOW" )