forked from securego/gosec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c5e6c4a
commit ddfe54d
Showing
3 changed files
with
84 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package output | ||
|
||
type textRange struct { | ||
StartLine int `json:"startLine"` | ||
EndLine int `json:"endLine"` | ||
StartColumn int `json:"startColumn,omitempty"` | ||
EtartColumn int `json:"endColumn,omitempty"` | ||
} | ||
type location struct { | ||
Message string `json:"message"` | ||
FilePath string `json:"filePath"` | ||
TextRange textRange `json:"textRange,omitempty"` | ||
} | ||
|
||
type sonarIssue 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"` | ||
} | ||
|
||
func getSonarSeverity(s string) string { | ||
switch s { | ||
case "LOW": | ||
return "MINOR" | ||
case "MEDIUM": | ||
return "MAJOR" | ||
case "HIGH": | ||
return "BLOCKER" | ||
default: | ||
return "INFO" | ||
} | ||
} |