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 Impact ¶ added in v2.24.0
type Impact struct {
SoftwareQuality string `json:"softwareQuality"`
Severity string `json:"severity"`
}
Impact defines the impact for a rule.
type Issue ¶
type Issue struct {
RuleID string `json:"ruleId"`
PrimaryLocation *Location `json:"primaryLocation"`
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 ¶
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 Rule ¶ added in v2.24.0
type Rule struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
EngineID string `json:"engineId"`
CleanCodeAttribute string `json:"cleanCodeAttribute,omitempty"`
Impacts []*Impact `json:"impacts"`
}
Rule defines a sonar rule.
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