Documentation
¶
Index ¶
Constants ¶
const (
// EffortMinutes effort to fix in minutes
EffortMinutes = 5
)
Variables ¶
This section is empty.
Functions ¶
func WriteReport ¶
WriteReport write a report in sonar format to the output writer
Types ¶
type Issue ¶
type Issue struct {
EngineID string `json:"engineId"`
RuleID string `json:"ruleId"`
PrimaryLocation *Location `json:"primaryLocation"`
Type string `json:"type"`
Severity string `json:"severity"`
EffortMinutes int `json:"effortMinutes"`
SecondaryLocations []*Location `json:"secondaryLocations,omitempty"`
}
Issue defines a sonar issue
type Location ¶
type Location struct {
Message string `json:"message"`
FilePath string `json:"filePath"`
TextRange *TextRange `json:"textRange,omitempty"`
}
Location defines a sonar issue's location
type Report ¶
type Report struct {
Issues []*Issue `json:"issues"`
}
Report defines a sonar report
func GenerateReport ¶
func GenerateReport(rootPaths []string, data *gosec.ReportInfo) (*Report, error)
GenerateReport Convert a gosec report to a Sonar Report
type TextRange ¶
type TextRange struct {
StartLine int `json:"startLine"`
EndLine int `json:"endLine"`
StartColumn int `json:"startColumn,omitempty"`
EtartColumn int `json:"endColumn,omitempty"`
}
TextRange defines the text range of an issue's location
func NewTextRange ¶
NewTextRange instantiate a TextRange