@@ -106,12 +106,17 @@ func (rw *ResultsWriter) PrintScanResults() error {
106106 // Don't print if there are no results and only errors.
107107 return nil
108108 }
109+ // Helper for Debugging purposes, print the raw results to the log
110+ if err := rw .printRawResultsLog (); err != nil {
111+ return err
112+ }
113+
109114 switch rw .format {
110115 case format .Table :
111116 return rw .printTables ()
112117 case format .SimpleJson :
113118 // Helper for Debugging purposes, print the raw results to the log
114- if err := rw .printOrSaveRawResults ( false ); err != nil {
119+ if err := rw .printRawResultsLog ( ); err != nil {
115120 return err
116121 }
117122 simpleJson , err := rw .createResultsConvertor (false ).ConvertToSimpleJson (rw .commandResults )
@@ -123,7 +128,7 @@ func (rw *ResultsWriter) PrintScanResults() error {
123128 return PrintJson (rw .commandResults .GetScaScansXrayResults ())
124129 case format .Sarif :
125130 // Helper for Debugging purposes, print the raw results to the log
126- if err := rw .printOrSaveRawResults ( false ); err != nil {
131+ if err := rw .printRawResultsLog ( ); err != nil {
127132 return err
128133 }
129134 return rw .printSarif ()
@@ -166,22 +171,12 @@ func PrintJson(output interface{}) (err error) {
166171 return nil
167172}
168173
169- // If "CI" env var is true, print raw JSON of the results. Otherwise, save it as a file and print a link to it.
170- // If printMsg is true, print it to the console. Otherwise, print the message to the log.
171- func (rw * ResultsWriter ) printOrSaveRawResults (printMsg bool ) (err error ) {
174+ // Log (Debug) the inner results.SecurityCommandResults object object as a JSON string.
175+ func (rw * ResultsWriter ) printRawResultsLog () (err error ) {
172176 if ! rw .commandResults .HasInformation () {
173177 log .Debug ("No information to print" )
174178 return
175179 }
176- if printMsg && ! utils .IsCI () {
177- // Save the results to a file and print a link to it.
178- var resultsPath string
179- if resultsPath , err = WriteJsonResults (rw .commandResults ); err != nil {
180- return
181- }
182- printMessage (coreutils .PrintTitle ("The full scan results are available here: " ) + coreutils .PrintLink (resultsPath ))
183- return
184- }
185180 // Print the raw results to console.
186181 var msg string
187182 if msg , err = utils .GetAsJsonString (rw .commandResults , false , true ); err != nil {
@@ -198,9 +193,6 @@ func (rw *ResultsWriter) printTables() (err error) {
198193 return
199194 }
200195 printMessages (rw .messages )
201- if err = rw .printOrSaveRawResults (true ); err != nil {
202- return
203- }
204196 if utils .IsScanRequested (rw .commandResults .CmdType , utils .ScaScan , rw .subScansPerformed ... ) {
205197 if rw .hasViolationContext {
206198 if err = PrintViolationsTable (tableContent , rw .commandResults .CmdType , rw .printExtended ); err != nil {
0 commit comments