@@ -67,7 +67,7 @@ class Client {
6767 * database using getIssues().
6868 *
6969 **/
70- async analyze ( options , timeout , initialDelay ) {
70+ async analyze ( options , timeout , initialDelay , debug ) {
7171 if ( options === undefined || options . data === undefined ) {
7272 // eslint-disable-next-line no-throw-literal
7373 throw 'Please provide analysis request JSON in a "data" attribute.'
@@ -115,22 +115,22 @@ class Client {
115115 )
116116 }
117117
118- if ( options . debug ) {
118+ if ( debug ) {
119119 console . log ( `now: ${ Math . trunc ( Date . now ( ) / 1000 ) } ` )
120120 }
121121
122122 let result
123123 if ( requestResponse . status === 'Finished' ) {
124124 result = await analysisPoller . getIssues ( requestResponse . uuid , this )
125- if ( options . debug ) {
125+ if ( debug ) {
126126 const util = require ( 'util' )
127- let depth = ( options . debug > 1 ) ? 10 : 2
127+ let depth = ( debug > 1 ) ? 10 : 2
128128 console . log ( `Cached Result:\n${ util . inspect ( result , { depth : depth } ) } \n------` )
129129 }
130130 } else {
131131 initialDelay = Math . max ( initialDelay || 0 , defaultInitialDelay )
132132 try {
133- result = await analysisPoller . do ( requestResponse . uuid , this , timeout , initialDelay , options . debug )
133+ result = await analysisPoller . do ( requestResponse . uuid , this , timeout , initialDelay , debug )
134134 } catch ( e ) {
135135 /*
136136 Normally requester passes back strings. However there is a spcial case for
@@ -143,7 +143,7 @@ class Client {
143143 this . accessToken = tokens . access
144144 this . refreshToken = tokens . refresh
145145 result = await analysisPoller . do ( requestResponse . uuid , this , timeout ,
146- initialDelay , options . debug )
146+ initialDelay , debug )
147147 }
148148 }
149149
0 commit comments