@@ -40,40 +40,40 @@ async function analyse(contracts, cfg, embark) {
4040 checkEnvVariables ( embark ) ;
4141
4242 const armletClient = new armlet . Client (
43- {
44- clientToolName : "embark-mythx" ,
45- password : process . env . MYTHX_PASSWORD ,
46- ethAddress : process . env . MYTHX_USERNAME ,
47- } )
48-
43+ {
44+ clientToolName : "embark-mythx" ,
45+ password : process . env . MYTHX_PASSWORD ,
46+ ethAddress : process . env . MYTHX_USERNAME ,
47+ } )
48+
4949 // Filter contracts based on parameter choice
5050 let toSubmit = { "contracts" : { } , "sources" : contracts . sources } ;
51- if ( ! ( "ignore" in embark . pluginConfig ) ) {
51+ if ( ! ( "ignore" in embark . pluginConfig ) ) {
5252 embark . pluginConfig . ignore = [ ]
5353 }
5454
5555 for ( let [ filename , contractObjects ] of Object . entries ( contracts . contracts ) ) {
5656 for ( let [ contractName , contract ] of Object . entries ( contractObjects ) ) {
57- if ( ! ( "contracts" in cfg ) ) {
57+ if ( ! ( "contracts" in cfg ) ) {
5858 if ( embark . pluginConfig . ignore . indexOf ( contractName ) == - 1 ) {
59- if ( ! toSubmit . contracts [ filename ] ) {
59+ if ( ! toSubmit . contracts [ filename ] ) {
6060 toSubmit . contracts [ filename ] = { }
6161 }
6262 toSubmit . contracts [ filename ] [ contractName ] = contract ;
6363 }
6464 } else {
6565 if ( cfg . contracts . indexOf ( contractName ) >= 0 && embark . pluginConfig . ignore . indexOf ( contractName ) == - 1 ) {
66- if ( ! toSubmit . contracts [ filename ] ) {
66+ if ( ! toSubmit . contracts [ filename ] ) {
6767 toSubmit . contracts [ filename ] = { }
6868 }
6969 toSubmit . contracts [ filename ] [ contractName ] = contract ;
7070 }
7171 }
7272 }
7373 }
74-
74+
7575 // Stop here if no contracts are left
76- if ( Object . keys ( toSubmit . contracts ) . length === 0 ) {
76+ if ( Object . keys ( toSubmit . contracts ) . length === 0 ) {
7777 embark . logger . info ( "No contracts to submit." ) ;
7878 return 0 ;
7979 }
@@ -114,7 +114,7 @@ const doAnalysis = async (armletClient, config, contracts, contractNames = null,
114114 const initialDelay = ( 'initial-delay' in config ) ? config [ 'initial-delay' ] * 1000 : undefined ;
115115
116116 const results = await asyncPool ( limit , contracts , async buildObj => {
117-
117+
118118 const obj = new MythXIssues ( buildObj , config ) ;
119119
120120 let analyzeOpts = {
@@ -126,7 +126,7 @@ const doAnalysis = async (armletClient, config, contracts, contractNames = null,
126126 analyzeOpts . data = mythXUtil . cleanAnalyzeDataEmptyProps ( obj . buildObj , config . debug , config . logger ) ;
127127 analyzeOpts . data . analysisMode = config . full ? "full" : "quick" ;
128128 if ( config . debug > 1 ) {
129- config . logger . debug ( "analyzeOpts: " + `${ util . inspect ( analyzeOpts , { depth : null } ) } ` ) ;
129+ config . logger . debug ( "analyzeOpts: " + `${ util . inspect ( analyzeOpts , { depth : null } ) } ` ) ;
130130 }
131131
132132 // request analysis to armlet.
@@ -142,7 +142,7 @@ const doAnalysis = async (armletClient, config, contracts, contractNames = null,
142142 } else {
143143 obj . setIssues ( issues ) ;
144144 }
145-
145+
146146 return [ null , obj ] ;
147147 } catch ( err ) {
148148 //console.log("catch", JSON.stringify(err));
@@ -156,7 +156,7 @@ const doAnalysis = async (armletClient, config, contracts, contractNames = null,
156156 }
157157
158158 if ( errStr . includes ( 'User or default timeout reached after' )
159- || errStr . includes ( 'Timeout reached after' ) ) {
159+ || errStr . includes ( 'Timeout reached after' ) ) {
160160 return [ ( buildObj . contractName + ": " ) . yellow + errStr , null ] ;
161161 } else {
162162 return [ ( buildObj . contractName + ": " ) . red + errStr , null ] ;
@@ -166,7 +166,7 @@ const doAnalysis = async (armletClient, config, contracts, contractNames = null,
166166 } ) ;
167167
168168 return results . reduce ( ( accum , curr ) => {
169- const [ err , obj ] = curr ;
169+ const [ err , obj ] = curr ;
170170 if ( err ) {
171171 accum . errors . push ( err ) ;
172172 } else if ( obj ) {
@@ -181,15 +181,15 @@ function ghettoReport(logger, results) {
181181 results . forEach ( ele => {
182182 issuesCount += ele . issues . length ;
183183 } ) ;
184-
184+
185185 if ( issuesCount === 0 ) {
186186 logger . info ( 'No issues found' ) ;
187187 return 0 ;
188188 }
189189 for ( const group of results ) {
190190 logger . info ( group . sourceList . join ( ', ' ) . underline ) ;
191191 for ( const issue of group . issues ) {
192- logger . info ( yaml . safeDump ( issue , { 'skipInvalid' : true } ) ) ;
192+ logger . info ( yaml . safeDump ( issue , { 'skipInvalid' : true } ) ) ;
193193 }
194194 }
195195 return 1 ;
0 commit comments