diff --git a/domain/ide/converter/converter.go b/domain/ide/converter/converter.go index 09cdfdc47..5a363c7c8 100644 --- a/domain/ide/converter/converter.go +++ b/domain/ide/converter/converter.go @@ -235,7 +235,6 @@ func getOssIssue(issue snyk.Issue) types.ScanIssue { IsUpgradable: matchingIssue.IsUpgradable, ProjectName: matchingIssue.ProjectName, DisplayTargetFile: matchingIssue.DisplayTargetFile, - Details: matchingIssue.Details, } } @@ -272,7 +271,6 @@ func getOssIssue(issue snyk.Issue) types.ScanIssue { IsUpgradable: additionalData.IsUpgradable, ProjectName: additionalData.ProjectName, DisplayTargetFile: additionalData.DisplayTargetFile, - Details: additionalData.Details, MatchingIssues: matchingIssues, Lesson: additionalData.Lesson, }, @@ -297,16 +295,15 @@ func getIacIssue(issue snyk.Issue) types.ScanIssue { IsNew: issue.IsNew, FilterableIssueType: additionalData.GetFilterableIssueType(), AdditionalData: types.IacIssueData{ - Key: additionalData.Key, - PublicId: additionalData.PublicId, - Documentation: additionalData.Documentation, - LineNumber: additionalData.LineNumber, - Issue: additionalData.Issue, - Impact: additionalData.Impact, - Resolve: additionalData.Resolve, - Path: additionalData.Path, - References: additionalData.References, - CustomUIContent: additionalData.CustomUIContent, + Key: additionalData.Key, + PublicId: additionalData.PublicId, + Documentation: additionalData.Documentation, + LineNumber: additionalData.LineNumber, + Issue: additionalData.Issue, + Impact: additionalData.Impact, + Resolve: additionalData.Resolve, + Path: additionalData.Path, + References: additionalData.References, }, } @@ -319,22 +316,6 @@ func getCodeIssue(issue snyk.Issue) types.ScanIssue { return types.ScanIssue{} } - exampleCommitFixes := make([]types.ExampleCommitFix, 0, len(additionalData.ExampleCommitFixes)) - for i := range additionalData.ExampleCommitFixes { - lines := make([]types.CommitChangeLine, 0, len(additionalData.ExampleCommitFixes[i].Lines)) - for j := range additionalData.ExampleCommitFixes[i].Lines { - lines = append(lines, types.CommitChangeLine{ - Line: additionalData.ExampleCommitFixes[i].Lines[j].Line, - LineNumber: additionalData.ExampleCommitFixes[i].Lines[j].LineNumber, - LineChange: additionalData.ExampleCommitFixes[i].Lines[j].LineChange, - }) - } - exampleCommitFixes = append(exampleCommitFixes, types.ExampleCommitFix{ - CommitURL: additionalData.ExampleCommitFixes[i].CommitURL, - Lines: lines, - }) - } - markers := make([]types.Marker, 0, len(additionalData.Markers)) for _, marker := range additionalData.Markers { positions := make([]types.MarkerPosition, 0) @@ -374,23 +355,21 @@ func getCodeIssue(issue snyk.Issue) types.ScanIssue { IsNew: issue.IsNew, FilterableIssueType: additionalData.GetFilterableIssueType(), AdditionalData: types.CodeIssueData{ - Key: additionalData.Key, - Message: additionalData.Message, - Rule: additionalData.Rule, - RuleId: additionalData.RuleId, - RepoDatasetSize: additionalData.RepoDatasetSize, - ExampleCommitFixes: exampleCommitFixes, - CWE: additionalData.CWE, - IsSecurityType: additionalData.IsSecurityType, - Text: additionalData.Text, - Cols: additionalData.Cols, - Rows: additionalData.Rows, - PriorityScore: additionalData.PriorityScore, - Markers: markers, - LeadURL: "", - HasAIFix: additionalData.HasAIFix, - DataFlow: dataFlow, - Details: additionalData.Details, + Key: additionalData.Key, + Message: additionalData.Message, + Rule: additionalData.Rule, + RuleId: additionalData.RuleId, + RepoDatasetSize: additionalData.RepoDatasetSize, + CWE: additionalData.CWE, + IsSecurityType: additionalData.IsSecurityType, + Text: additionalData.Text, + Cols: additionalData.Cols, + Rows: additionalData.Rows, + PriorityScore: additionalData.PriorityScore, + Markers: markers, + LeadURL: "", + HasAIFix: additionalData.HasAIFix, + DataFlow: dataFlow, }, } if scanIssue.IsIgnored { diff --git a/infrastructure/code/code.go b/infrastructure/code/code.go index 847e8a954..5a25b430a 100644 --- a/infrastructure/code/code.go +++ b/infrastructure/code/code.go @@ -264,13 +264,6 @@ func (sc *Scanner) enhanceIssuesDetails(issues []snyk.Issue, folderPath string) } else if lesson != nil && lesson.Url != "" { issue.LessonUrl = lesson.Url } - - renderer, err := NewHtmlRenderer(sc.c) - if err != nil { - sc.c.Logger().Err(err).Msg("Cannot create Oss HTML render") - return - } - issueData.Details = renderer.GetDetailsHtml(*issue, folderPath) issue.AdditionalData = issueData } } diff --git a/internal/types/lsp.go b/internal/types/lsp.go index c4dda6e5c..f21fa154b 100644 --- a/internal/types/lsp.go +++ b/internal/types/lsp.go @@ -1118,7 +1118,6 @@ type OssIssueData struct { IsUpgradable bool `json:"isUpgradable"` ProjectName string `json:"projectName"` DisplayTargetFile string `json:"displayTargetFile"` - Details string `json:"details,omitempty"` MatchingIssues []OssIssueData `json:"matchingIssues"` Lesson string `json:"lessonUrl,omitempty"` } @@ -1136,32 +1135,25 @@ type DataflowElement struct { } type CodeIssueData struct { - Key string `json:"key,omitempty"` - Message string `json:"message"` - LeadURL string `json:"leadURL,omitempty"` - Rule string `json:"rule"` - RuleId string `json:"ruleId"` - RepoDatasetSize int `json:"repoDatasetSize"` - ExampleCommitFixes []ExampleCommitFix `json:"exampleCommitFixes"` - CWE []string `json:"cwe"` - Text string `json:"text"` - Markers []Marker `json:"markers,omitempty"` - Cols Point `json:"cols"` - Rows Point `json:"rows"` - IsSecurityType bool `json:"isSecurityType"` - PriorityScore int `json:"priorityScore"` - HasAIFix bool `json:"hasAIFix"` - DataFlow []DataflowElement `json:"dataFlow,omitempty"` - Details string `json:"details,omitempty"` + Key string `json:"key,omitempty"` + Message string `json:"message"` + LeadURL string `json:"leadURL,omitempty"` + Rule string `json:"rule"` + RuleId string `json:"ruleId"` + RepoDatasetSize int `json:"repoDatasetSize"` + CWE []string `json:"cwe"` + Text string `json:"text"` + Markers []Marker `json:"markers,omitempty"` + Cols Point `json:"cols"` + Rows Point `json:"rows"` + IsSecurityType bool `json:"isSecurityType"` + PriorityScore int `json:"priorityScore"` + HasAIFix bool `json:"hasAIFix"` + DataFlow []DataflowElement `json:"dataFlow,omitempty"` } type Point = [2]int -type ExampleCommitFix struct { - CommitURL string `json:"commitURL"` - Lines []CommitChangeLine `json:"lines"` -} - type CommitChangeLine struct { Line string `json:"line"` LineNumber int `json:"lineNumber"` @@ -1188,14 +1180,13 @@ type CodeActionOptions struct { } type IacIssueData struct { - Key string `json:"key,omitempty"` - PublicId string `json:"publicId"` - Documentation string `json:"documentation"` - LineNumber int `json:"lineNumber"` - Issue string `json:"issue"` - Impact string `json:"impact"` - Resolve string `json:"resolve,omitempty"` - Path []string `json:"path"` - References []string `json:"references,omitempty"` - CustomUIContent string `json:"customUIContent,omitempty"` + Key string `json:"key,omitempty"` + PublicId string `json:"publicId"` + Documentation string `json:"documentation"` + LineNumber int `json:"lineNumber"` + Issue string `json:"issue"` + Impact string `json:"impact"` + Resolve string `json:"resolve,omitempty"` + Path []string `json:"path"` + References []string `json:"references,omitempty"` }