helpers

package
v1.3.3 Latest Latest
Warning

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

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

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileAnalyzer

func FileAnalyzer(path string) (string, error)

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

func GetDefaultQueryPath(queriesPath string) (string, error)

GetDefaultQueryPath - returns the default query path

func GetExecutableDirectory

func GetExecutableDirectory() string

GetExecutableDirectory - returns the path to the directory containing KICS executable

func GetFullPath

func GetFullPath(partialPath string) (string, error)

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 GetNumCPU

func GetNumCPU() float32

GetNumCPU return the number of cpus available

func ResultsExitCodeWithConfig

func ResultsExitCodeWithConfig(config *ExitHandler, summary *model.Summary) int

Types

type ExitHandler

type ExitHandler struct {
	ShouldIgnore string
	ShouldFail   map[string]struct{}
}

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

Jump to

Keyboard shortcuts

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