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
deprecated
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.
Deprecated: This should not be used. Use ExtractCodeFromFileTarget instead.
func ExtractCodeFromFileTarget ¶
ExtractCodeFromFileTarget takes a filepath target and returns the code snippet. It expects the target to be in the format of producers.GetFileTarget
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.