formatters

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 21 Imported by: 0 modules, 0 packages

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

This section is empty.

Types

type IFormatter

type IFormatter interface {
	StartAnalysis(projectSubPath string)
}

type IService

type IService interface {
	LogDebugWithReplace(msg string, tool tools.Tool)
	GetAnalysisID() string
	ExecuteContainer(data *dockerEntities.AnalysisData) (output string, err error)
	GetAnalysisIDErrorMessage(tool tools.Tool, output string) string
	GetCommitAuthor(line, filePath string) (commitAuthor horusec.CommitAuthor)
	AddWorkDirInCmd(cmd string, projectSubPath string, tool tools.Tool) string
	GetConfigProjectPath() string
	GetToolsConfig() toolsconfig.MapToolConfig
	GetAnalysis() *horusec.Analysis
	SetToolFinishedAnalysis()
	SetAnalysisError(err error, tool tools.Tool, projectSubPath string)
	SetMonitor(monitor *horusec.Monitor)
	RemoveSrcFolderFromPath(filepath string) string
	GetCodeWithMaxCharacters(code string, column int) string
	ToolIsToIgnore(tool tools.Tool) bool
	GetFilepathFromFilename(filename string) string
	GetProjectPathWithWorkdir(projectSubPath string) string
	SetCommitAuthor(vulnerability *horusec.Vulnerability) *horusec.Vulnerability
	ParseFindingsToVulnerabilities(findings []engine.Finding, tool tools.Tool, language languages.Language) error
	AddNewVulnerabilityIntoAnalysis(vulnerability *horusec.Vulnerability)
	IsDockerDisabled() bool
	GetCustomRulesByTool(tool tools.Tool) []engine.Rule
	GetConfigCMDYarnOrNpmAudit(projectSubPath, imageCmd string, tool tools.Tool) string
}

func NewFormatterService

func NewFormatterService(analysis *horusec.Analysis, docker dockerService.Interface, config cliConfig.IConfig,
	monitor *horusec.Monitor) IService

type Mock

type Mock struct {
	mock.Mock
}

func (*Mock) AddNewVulnerabilityIntoAnalysis added in v1.5.0

func (m *Mock) AddNewVulnerabilityIntoAnalysis(_ *horusec.Vulnerability)

func (*Mock) AddWorkDirInCmd

func (m *Mock) AddWorkDirInCmd(_ string, _ string, _ tools.Tool) string

func (*Mock) ExecuteContainer

func (m *Mock) ExecuteContainer(_ *dockerEntities.AnalysisData) (output string, err error)

func (*Mock) GetAnalysis

func (m *Mock) GetAnalysis() *horusec.Analysis

func (*Mock) GetAnalysisID

func (m *Mock) GetAnalysisID() string

func (*Mock) GetAnalysisIDErrorMessage

func (m *Mock) GetAnalysisIDErrorMessage(_ tools.Tool, _ string) string

func (*Mock) GetCodeWithMaxCharacters added in v1.0.1

func (m *Mock) GetCodeWithMaxCharacters(_ string, _ int) string

func (*Mock) GetCommitAuthor

func (m *Mock) GetCommitAuthor(_, _ string) (commitAuthor horusec.CommitAuthor)

func (*Mock) GetConfigCMDYarnOrNpmAudit added in v1.7.0

func (m *Mock) GetConfigCMDYarnOrNpmAudit(_, _ string, _ tools.Tool) string

func (*Mock) GetConfigProjectPath

func (m *Mock) GetConfigProjectPath() string

func (*Mock) GetCustomRulesByTool added in v1.5.0

func (m *Mock) GetCustomRulesByTool(_ tools.Tool) []engine.Rule

func (*Mock) GetFilepathFromFilename added in v1.5.0

func (m *Mock) GetFilepathFromFilename(_ string) string

func (*Mock) GetProjectPathWithWorkdir added in v1.5.0

func (m *Mock) GetProjectPathWithWorkdir(_ string) string

func (*Mock) GetToolsConfig added in v1.5.0

func (m *Mock) GetToolsConfig() toolsconfig.MapToolConfig

func (*Mock) IsDockerDisabled added in v1.5.0

func (m *Mock) IsDockerDisabled() bool

func (*Mock) LogDebugWithReplace

func (m *Mock) LogDebugWithReplace(_ string, _ tools.Tool)

func (*Mock) ParseFindingsToVulnerabilities added in v1.5.0

func (m *Mock) ParseFindingsToVulnerabilities(_ []engine.Finding, _ tools.Tool, _ languages.Language) error

func (*Mock) RemoveSrcFolderFromPath added in v1.0.1

func (m *Mock) RemoveSrcFolderFromPath(_ string) string

func (*Mock) SetAnalysisError

func (m *Mock) SetAnalysisError(_ error, _ tools.Tool, _ string)

func (*Mock) SetCommitAuthor added in v1.5.0

func (m *Mock) SetCommitAuthor(_ *horusec.Vulnerability) *horusec.Vulnerability

func (*Mock) SetMonitor

func (m *Mock) SetMonitor(_ *horusec.Monitor)

func (*Mock) SetToolFinishedAnalysis added in v1.5.0

func (m *Mock) SetToolFinishedAnalysis()

func (*Mock) ToolIsToIgnore added in v1.3.0

func (m *Mock) ToolIsToIgnore(_ tools.Tool) bool

type Service

type Service struct {
	// contains filtered or unexported fields
}

func (*Service) AddNewVulnerabilityIntoAnalysis added in v1.5.0

func (s *Service) AddNewVulnerabilityIntoAnalysis(vulnerability *horusec.Vulnerability)

func (*Service) AddWorkDirInCmd

func (s *Service) AddWorkDirInCmd(cmd, projectSubPath string, tool tools.Tool) string

func (*Service) ExecuteContainer

func (s *Service) ExecuteContainer(data *dockerEntities.AnalysisData) (output string, err error)

func (*Service) GetAnalysis

func (s *Service) GetAnalysis() *horusec.Analysis

func (*Service) GetAnalysisID

func (s *Service) GetAnalysisID() string

func (*Service) GetAnalysisIDErrorMessage

func (s *Service) GetAnalysisIDErrorMessage(tool tools.Tool, output string) string

func (*Service) GetCodeWithMaxCharacters added in v1.0.1

func (s *Service) GetCodeWithMaxCharacters(code string, column int) string

func (*Service) GetCommitAuthor

func (s *Service) GetCommitAuthor(line, filePath string) (commitAuthor horusec.CommitAuthor)

func (*Service) GetConfigCMDYarnOrNpmAudit added in v1.7.0

func (s *Service) GetConfigCMDYarnOrNpmAudit(projectSubPath, imageCmd string, tool tools.Tool) string

func (*Service) GetConfigProjectPath

func (s *Service) GetConfigProjectPath() string

func (*Service) GetCustomRulesByTool added in v1.5.0

func (s *Service) GetCustomRulesByTool(tool tools.Tool) []engine.Rule

func (*Service) GetFilepathFromFilename added in v1.4.1

func (s *Service) GetFilepathFromFilename(filename string) string

func (*Service) GetProjectPathWithWorkdir added in v1.5.0

func (s *Service) GetProjectPathWithWorkdir(projectSubPath string) string

func (*Service) GetToolsConfig added in v1.4.2

func (s *Service) GetToolsConfig() toolsconfig.MapToolConfig

func (*Service) IsDockerDisabled added in v1.5.0

func (s *Service) IsDockerDisabled() bool

func (*Service) LogDebugWithReplace

func (s *Service) LogDebugWithReplace(msg string, tool tools.Tool)

func (*Service) ParseFindingsToVulnerabilities added in v1.5.0

func (s *Service) ParseFindingsToVulnerabilities(findings []engine.Finding, tool tools.Tool,
	language languages.Language) error

func (*Service) RemoveSrcFolderFromPath

func (s *Service) RemoveSrcFolderFromPath(filepath string) string

func (*Service) SetAnalysisError

func (s *Service) SetAnalysisError(err error, tool tools.Tool, projectSubPath string)

func (*Service) SetCommitAuthor added in v1.5.0

func (s *Service) SetCommitAuthor(vulnerability *horusec.Vulnerability) *horusec.Vulnerability

func (*Service) SetMonitor

func (s *Service) SetMonitor(monitor *horusec.Monitor)

func (*Service) SetToolFinishedAnalysis added in v1.5.0

func (s *Service) SetToolFinishedAnalysis()

func (*Service) ToolIsToIgnore added in v1.3.0

func (s *Service) ToolIsToIgnore(tool tools.Tool) bool

Jump to

Keyboard shortcuts

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