Documentation
¶
Overview ¶
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. * * This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. * * This product includes software developed at Datadog (https://www.datadoghq.com) Copyright 2024 Datadog, Inc.
Index ¶
- func FileAnalyzer(path string) (string, error)
- func GenerateReport(ctx context.Context, path, filename string, body interface{}, formats []string, ...) error
- func GetDefaultQueryPath(queriesPath string) (string, error)
- func GetExecutableDirectory() string
- func GetFullPath(partialPath string) (string, error)
- func GetNumCPU() float32
- func ResultsExitCodeWithConfig(config *ExitHandler, summary *model.Summary) int
- type ExitHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileAnalyzer ¶
FileAnalyzer determines the type of extension in the passed config file by its content
func GenerateReport ¶
func GenerateReport(ctx context.Context, path, filename string, body interface{}, formats []string, sciInfo *model.SCIInfo) error
GenerateReport execute each report function to generate report.
Suppressed findings are kept in the Summary so SARIF can emit them under `suppressions[]`; every other report format gets a filtered copy that drops them, matching the CLI counters and avoiding leaks into json/csv/gitlab/etc.
func GetDefaultQueryPath ¶
GetDefaultQueryPath - returns the default query path
func GetExecutableDirectory ¶
func GetExecutableDirectory() string
GetExecutableDirectory - returns the path to the directory containing KICS executable
func GetFullPath ¶
GetFullPath returns the full path of a partial path used for queries or experimental queries json path. The returned path is only used for logging/display purposes.
func ResultsExitCodeWithConfig ¶
func ResultsExitCodeWithConfig(config *ExitHandler, summary *model.Summary) int
Types ¶
type ExitHandler ¶
func NewExitHandler ¶
func NewExitHandler() *ExitHandler
func ResultsExitCode ¶
func ResultsExitCode(summary *model.Summary) (*ExitHandler, int)
ResultsExitCode calculate exit code base on severity of results, returns 0 if no results was reported nolint:gocritic
func (*ExitHandler) ShowError ¶
func (config *ExitHandler) ShowError(kind string) bool
ShowError returns true if should show error, otherwise returns false