context

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package context offers a set of methods which permit components to

add information about the context of each vulnerability
this information is highly depended on the actual vulnerability and the component.
For example for SAST components, context can be a call graph or
a few lines of code before and after the line that triggered the finding.
For DAST components it can be a serialised request/response.

Index

Constants

View Source
const DefaultLineRange = 10

DefaultLineRange controls how many lines of code context will be returned by default

Variables

This section is empty.

Functions

func ExtractCode

func ExtractCode(finding *v1.Issue) (string, error)

ExtractCode takes a path and line (or line range) for a vulnerable code segment and returns the DefaultLineRange lines above and the DefaultLineRange lines below the vulnerability. It does not take into account end of function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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