File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33import * as vscode from 'vscode' ;
44import { ToolFinding } from '../models/toolFinding' ;
5+ import { relativePathToFull } from '../utils' ;
56
67class BanditParser {
78 static parse ( fileContent : string ) {
@@ -11,11 +12,7 @@ class BanditParser {
1112 const banditFindings = JSON . parse ( fileContent ) . results ;
1213 banditFindings . map ( ( banditFinding : any ) => {
1314 // uri
14- let fullPath = '' ;
15- if ( vscode . workspace . workspaceFolders ) {
16- fullPath = vscode . workspace . workspaceFolders [ 0 ] . uri . fsPath + '/' ;
17- }
18- const uri = vscode . Uri . file ( `${ fullPath } ${ banditFinding . filename } ` ) ;
15+ const uri = vscode . Uri . file ( relativePathToFull ( banditFinding . filename ) ) ;
1916
2017 // range
2118 const lineRange = banditFinding . line_range ;
Original file line number Diff line number Diff line change 22
33import * as vscode from 'vscode' ;
44import { ToolFinding } from '../models/toolFinding' ;
5+ import { relativePathToFull } from '../utils' ;
56
67class BrakemanParser {
78 static parse ( fileContent : string ) {
@@ -11,11 +12,7 @@ class BrakemanParser {
1112 const brakemanFindings = JSON . parse ( fileContent ) . warnings ;
1213 brakemanFindings . map ( ( brakemanFinding : any ) => {
1314 // uri
14- let fullPath = '' ;
15- if ( vscode . workspace . workspaceFolders ) {
16- fullPath = vscode . workspace . workspaceFolders [ 0 ] . uri . fsPath + '/' ;
17- }
18- const uri = vscode . Uri . file ( `${ fullPath } ${ brakemanFinding . file } ` ) ;
15+ const uri = vscode . Uri . file ( relativePathToFull ( brakemanFinding . file ) ) ;
1916
2017 // range
2118 const range = new vscode . Range (
Original file line number Diff line number Diff line change 22
33import * as vscode from 'vscode' ;
44import { ToolFinding } from '../models/toolFinding' ;
5+ import { relativePathToFull } from '../utils' ;
56
67class CheckovParser {
78 static parse ( fileContent : string ) {
@@ -13,11 +14,7 @@ class CheckovParser {
1314 const checkovFindings = checkovCheckType . results . failed_checks ;
1415 checkovFindings . map ( ( checkovFinding : any ) => {
1516 // uri
16- let fullPath = '' ;
17- if ( vscode . workspace . workspaceFolders ) {
18- fullPath = vscode . workspace . workspaceFolders [ 0 ] . uri . fsPath + '/' ;
19- }
20- const uri = vscode . Uri . file ( `${ fullPath } ${ checkovFinding . file_path } ` ) ;
17+ const uri = vscode . Uri . file ( relativePathToFull ( checkovFinding . file_path ) ) ;
2118
2219 // range
2320 const range = new vscode . Range (
Original file line number Diff line number Diff line change 22
33import * as vscode from 'vscode' ;
44import { ToolFinding } from '../models/toolFinding' ;
5+ import { relativePathToFull } from '../utils' ;
56
67class SemgrepParser {
78 static parse ( fileContent : string ) {
@@ -11,11 +12,7 @@ class SemgrepParser {
1112 const semgrepFindings = JSON . parse ( fileContent ) . results ;
1213 semgrepFindings . map ( ( semgrepFinding : any ) => {
1314 // uri
14- let fullPath = '' ;
15- if ( vscode . workspace . workspaceFolders ) {
16- fullPath = vscode . workspace . workspaceFolders [ 0 ] . uri . fsPath + '/' ;
17- }
18- const uri = vscode . Uri . file ( `${ fullPath } ${ semgrepFinding . path } ` ) ;
15+ const uri = vscode . Uri . file ( relativePathToFull ( semgrepFinding . path ) ) ;
1916
2017 // range
2118 const range = new vscode . Range (
You can’t perform that action at this time.
0 commit comments