diff --git a/command/issues/list/list.go b/command/issues/list/list.go index 4e6e6064..fe89d117 100644 --- a/command/issues/list/list.go +++ b/command/issues/list/list.go @@ -213,10 +213,12 @@ func (opts *IssuesListOptions) showIssues() { beginLine := issue.Location.Position.BeginLine issueLocation := fmt.Sprintf("%s:%d", filePath, beginLine) analyzerShortcode := issue.Analyzer.Shortcode + issueCategory := issue.IssueCategory + issueSeverity := issue.IssueSeverity issueCode := issue.IssueCode issueTitle := issue.IssueText - opts.ptermTable[index] = []string{issueLocation, analyzerShortcode, issueCode, issueTitle} + opts.ptermTable[index] = []string{issueLocation, analyzerShortcode, issueCode, issueTitle, issueCategory, issueSeverity} } // Using pterm to render the list of list pterm.DefaultTable.WithSeparator("\t").WithData(opts.ptermTable).Render() diff --git a/deepsource/issues/issues_list.go b/deepsource/issues/issues_list.go index 1a1121fe..2f23b81b 100644 --- a/deepsource/issues/issues_list.go +++ b/deepsource/issues/issues_list.go @@ -15,8 +15,10 @@ type AnalyzerMeta struct { } type Issue struct { - IssueText string `json:"issue_title"` // The describing heading of the issue - IssueCode string `json:"issue_code"` // DeepSource code for the issue reported - Location Location `json:"location"` // The location data for the issue reported - Analyzer AnalyzerMeta // The Analyzer which raised the issue + IssueText string `json:"issue_title"` // The describing heading of the issue + IssueCode string `json:"issue_code"` // DeepSource code for the issue reported + IssueCategory string `json:"issue_category"` // Category of the issue reported + IssueSeverity string `json:"issue_severity"` // Severity of the issue reported + Location Location `json:"location"` // The location data for the issue reported + Analyzer AnalyzerMeta // The Analyzer which raised the issue } diff --git a/deepsource/issues/queries/list_issues.go b/deepsource/issues/queries/list_issues.go index 98a39418..61f69d4f 100644 --- a/deepsource/issues/queries/list_issues.go +++ b/deepsource/issues/queries/list_issues.go @@ -29,6 +29,7 @@ const fetchAllIssuesQuery = `query GetAllIssues( title shortcode category + severity isRecommended analyzer { name @@ -70,6 +71,7 @@ type IssuesListResponse struct { Title string `json:"title"` Shortcode string `json:"shortcode"` Category string `json:"category"` + Severity string `json:"severity"` IsRecommended bool `json:"isRecommended"` Analyzer struct { Name string `json:"name"` @@ -105,16 +107,17 @@ func (i IssuesListRequest) Do(ctx context.Context, client IGQLClient) ([]issues. } issuesData := []issues.Issue{} - issueData := issues.Issue{} for _, edge := range respData.Repository.Issues.Edges { if len(edge.Node.Occurrences.Edges) == 0 { continue } for _, occurenceEdge := range edge.Node.Occurrences.Edges { - issueData = issues.Issue{ - IssueText: occurenceEdge.Node.Issue.Title, - IssueCode: occurenceEdge.Node.Issue.Shortcode, + issueData := issues.Issue{ + IssueText: occurenceEdge.Node.Issue.Title, + IssueCode: occurenceEdge.Node.Issue.Shortcode, + IssueCategory: occurenceEdge.Node.Issue.Category, + IssueSeverity: occurenceEdge.Node.Issue.Severity, Location: issues.Location{ Path: occurenceEdge.Node.Path, Position: issues.Position{