Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion command/issues/list/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
10 changes: 6 additions & 4 deletions deepsource/issues/issues_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
11 changes: 7 additions & 4 deletions deepsource/issues/queries/list_issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const fetchAllIssuesQuery = `query GetAllIssues(
title
shortcode
category
severity
isRecommended
analyzer {
name
Expand Down Expand Up @@ -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"`
Expand Down Expand Up @@ -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{
Expand Down