@@ -172,7 +172,7 @@ export class CxWrapper {
172172 async getResultsList ( scanId : string ) {
173173 const exec = new ExecutionService ( ) ;
174174 const fileName = new Date ( ) . getTime ( ) . toString ( ) ;
175- const commands = this . createResultCommand ( scanId , CxConstants . FORMAT_JSON , fileName , os . tmpdir ( ) )
175+ const commands = this . resultsShow ( scanId , CxConstants . FORMAT_JSON , fileName , os . tmpdir ( ) )
176176 // Executes the command and creates a result file
177177 await exec . executeResultsCommands ( this . config . pathToExecutable , commands )
178178 // Reads the result file and retrieves the results
@@ -182,21 +182,21 @@ export class CxWrapper {
182182 async getResultsSummary ( scanId : string ) : Promise < CxCommandOutput > {
183183 const exec = new ExecutionService ( ) ;
184184 const fileName = new Date ( ) . getTime ( ) . toString ( ) ;
185- const commands = this . createResultCommand ( scanId , CxConstants . FORMAT_HTML_CLI , fileName , os . tmpdir ( ) ) ;
185+ const commands = this . resultsShow ( scanId , CxConstants . FORMAT_HTML_CLI , fileName , os . tmpdir ( ) ) ;
186186 // Executes the command and creates a result file
187187 await exec . executeResultsCommands ( this . config . pathToExecutable , commands ) ;
188188 // Reads the result file and retrieves the results
189189 return exec . executeResultsCommandsFile ( scanId , CxConstants . FORMAT_HTML , CxConstants . FORMAT_HTML_FILE , commands , this . config . pathToExecutable , fileName ) ;
190190 }
191191
192192 async getResults ( scanId : string , resultType :string , outputFileName : string , outputFilePath : string ) {
193- const commands = this . createResultCommand ( scanId , resultType , outputFileName , outputFilePath )
193+ const commands = this . resultsShow ( scanId , resultType , outputFileName , outputFilePath )
194194 const exec = new ExecutionService ( ) ;
195195 return await exec . executeCommands ( this . config . pathToExecutable , commands ) ;
196196 }
197197
198- createResultCommand ( scanId : string , reportFormat : string , outputFileName : string , outputPath : string ) : string [ ] {
199- const commands : string [ ] = [ CxConstants . CMD_RESULT , CxConstants . SCAN_ID , scanId , CxConstants . REPORT_FORMAT , reportFormat ] ;
198+ resultsShow ( scanId : string , reportFormat : string , outputFileName : string , outputPath : string ) : string [ ] {
199+ const commands : string [ ] = [ CxConstants . CMD_RESULT , CxConstants . SUB_CMD_SHOW , CxConstants . SCAN_ID , scanId , CxConstants . REPORT_FORMAT , reportFormat ] ;
200200 if ( outputFileName ) {
201201 commands . push ( CxConstants . OUTPUT_NAME ) ;
202202 commands . push ( outputFileName ) ;
0 commit comments