mirror of
https://github.com/securego/gosec.git
synced 2024-11-06 03:55:50 +00:00
30 lines
774 B
Go
30 lines
774 B
Go
package sonar
|
|
|
|
//NewLocation instantiate a Location
|
|
func NewLocation(message string, filePath string, textRange *TextRange) *Location {
|
|
return &Location{
|
|
Message: message,
|
|
FilePath: filePath,
|
|
TextRange: textRange,
|
|
}
|
|
}
|
|
|
|
//NewTextRange instantiate a TextRange
|
|
func NewTextRange(startLine int, endLine int) *TextRange {
|
|
return &TextRange{
|
|
StartLine: startLine,
|
|
EndLine: endLine,
|
|
}
|
|
}
|
|
|
|
//NewIssue instantiate an Issue
|
|
func NewIssue(engineID string, ruleID string, primaryLocation *Location, issueType string, severity string, effortMinutes int) *Issue {
|
|
return &Issue{
|
|
EngineID: engineID,
|
|
RuleID: ruleID,
|
|
PrimaryLocation: primaryLocation,
|
|
Type: issueType,
|
|
Severity: severity,
|
|
EffortMinutes: effortMinutes,
|
|
}
|
|
}
|