codescan

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 24 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDataSourceIDForSemgrep added in v0.11.0

func GenerateDataSourceIDForSemgrep(f *SemgrepFinding) string

func GenerateGitHubURL added in v0.11.0

func GenerateGitHubURL(githubBaseURL, masterBranch string, f *SemgrepFinding) string

func GeneratePutFindingRequest added in v0.11.0

func GeneratePutFindingRequest(projectID uint32, f *SemgrepFinding) (*finding.PutFindingRequest, error)

func GetScoreSemgrep added in v0.11.0

func GetScoreSemgrep(serverity, likelihood, impact string) float32

func GetSemgrepRecommend added in v0.11.0

func GetSemgrepRecommend(repoName, fileName, rule, semgrepMessage, githubURL, line string) *recommend

func NewHandler

func NewHandler(
	ctx context.Context,
	fc finding.FindingServiceClient,
	ac alert.AlertServiceClient,
	cc code.CodeServiceClient,
	codeDataKey string,
	githubDefaultToken string,
	limitRepositorySizeKb int,
	l logging.Logger,
) (*sqsHandler, error)

Types

type SemgrepExtra added in v0.11.0

type SemgrepExtra struct {
	EngineKind    string      `json:"engine_kind,omitempty"`
	Fingerprint   string      `json:"fingerprint,omitempty"`
	IsIgnored     bool        `json:"is_ignored,omitempty"`
	Lines         string      `json:"lines,omitempty"`
	Message       string      `json:"message,omitempty"`
	Severity      string      `json:"severity,omitempty"`
	ValidateState string      `json:"validate_state,omitempty"`
	Metadata      interface{} `json:"metadata,omitempty"`
}

type SemgrepFinding added in v0.11.0

type SemgrepFinding struct {
	Repository     string        `json:"repository,omitempty"`
	RepoVisibility string        `json:"repo_visibility,omitempty"`
	GitHubURL      string        `json:"github_url,omitempty"`
	CheckID        string        `json:"check_id,omitempty"`
	Path           string        `json:"path,omitempty"`
	Start          *SemgrepLine  `json:"start,omitempty"`
	End            *SemgrepLine  `json:"end,omitempty"`
	Extra          *SemgrepExtra `json:"extra,omitempty"`
}

func ParseSemgrepResult added in v0.11.0

func ParseSemgrepResult(dir, scanResult, repository, masterBranch, githubBaseURL string) ([]*SemgrepFinding, error)

type SemgrepLine added in v0.11.0

type SemgrepLine struct {
	Line   int `json:"line,omitempty"`
	Column int `json:"col,omitempty"`
	Offset int `json:"offset,omitempty"`
}

type SemgrepMetadata added in v0.11.0

type SemgrepMetadata struct {
	Likelihood string `json:"likelihood,omitempty"`
	Impact     string `json:"impact,omitempty"`
}

SemgrepMetadata is a struct for semgrep metadata. If `security` category, a metadata has `likelihood` and `impact` fields(required fields). refs: https://semgrep.dev/docs/contributing/contributing-to-semgrep-rules-repository/#including-fields-required-by-security-category

type SemgrepResults added in v0.11.0

type SemgrepResults struct {
	Results []*SemgrepFinding `json:"results,omitempty"`
}

Jump to

Keyboard shortcuts

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