@ -44,24 +44,22 @@ export const compilation = (analysisModule: AnalysisTab,
* /
* /
// eslint-disable-next-line @typescript-eslint/no-unused-vars
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export async function run ( lastCompilationResult , lastCompilationSource , currentFile : string , state : RemixUiStaticAnalyserState , props : RemixUiStaticAnalyserProps , isSupportedVersion , showSlither , categoryIndex : number [ ] , groupedModules , runner , _paq , message , showWarnings , allWarnings : React.RefObject < any > , warningContainer : React.RefObject < any > , calculateWarningStateEntries : ( e : [ string , any ] [ ] ) = > { length : number , errors : any [ ] } , warningState , setHints : React.Dispatch < React.SetStateAction < SolHintReport [ ] > > , hints : SolHintReport [ ] , setSlitherWarnings : React.Dispatch < React.SetStateAction < any [ ] > > , setSsaWarnings : React.Dispatch < React.SetStateAction < any [ ] > > ,
export async function run ( lastCompilationResult , lastCompilationSource , currentFile : string , state : RemixUiStaticAnalyserState , props : RemixUiStaticAnalyserProps , isSupportedVersion , showSlither , categoryIndex : number [ ] , groupedModules , runner , _paq , message , showWarnings , allWarnings : React.RefObject < any > , warningContainer : React.RefObject < any > , calculateWarningStateEntries : ( e : [ string , any ] [ ] ) = > { length : number , errors : any [ ] } , warningState , setHints : React.Dispatch < React.SetStateAction < SolHintReport [ ] > > , hints : SolHintReport [ ] , setSlitherWarnings : React.Dispatch < React.SetStateAction < any [ ] > > , setSsaWarnings : React.Dispatch < React.SetStateAction < any [ ] > > ,
slitherEnabled : boolean , setStartAnalysis : React.Dispatch < React.SetStateAction < boolean > > ) {
slitherEnabled : boolean , setStartAnalysis : React.Dispatch < React.SetStateAction < boolean > > , solhintEnabled : boolean , basicEnabled : boolean ) {
setStartAnalysis ( true )
setStartAnalysis ( true )
setHints ( [ ] )
setHints ( [ ] )
setSsaWarnings ( [ ] )
setSsaWarnings ( [ ] )
setSlitherWarnings ( [ ] )
setSlitherWarnings ( [ ] )
if ( ! isSupportedVersion ) return
if ( ! isSupportedVersion ) return
if ( state . data !== null ) {
if ( state . data !== null ) {
if ( lastCompilationResult && ( categoryIndex . length > 0 || showSlither ) ) {
if ( lastCompilationResult && ( solhintEnabled || basicEnabled || showSlither ) ) {
const warningMessage = [ ]
const warningMessage = [ ]
const warningErrors = [ ]
const warningErrors = [ ]
props . analysisModule . hints = [ ]
// Run solhint
// Run solhint
_paq . push ( [ 'trackEvent' , 'solidityStaticAnalyzer' , 'analyze' , 'solHint' ] )
const hintsResult = await props . analysisModule . call ( 'solhint' , 'lint' , state . file )
const hintsResult = await props . analysisModule . call ( 'solhint' , 'lint' , state . file )
props . analysisModule . hints = solhintEnabled === false ? 0 : hintsResult
setHints ( hintsResult )
setHints ( hintsResult )
const warningResult = calculateWarningStateEntries ( Object . entries ( warningState ) )
props . analysisModule . emit ( 'statusChanged' , { key : hints.length + warningResult . length ,
title : ` ${ hints . length + warningResult . length } warning ${ hints . length + warningResult . length === 1 ? '' : 's' } ` , type : 'warning' } )
// Remix Analysis
// Remix Analysis
_paq . push ( [ 'trackEvent' , 'solidityStaticAnalyzer' , 'analyze' , 'remixAnalyzer' ] )
_paq . push ( [ 'trackEvent' , 'solidityStaticAnalyzer' , 'analyze' , 'remixAnalyzer' ] )
const results = runner . run ( lastCompilationResult , categoryIndex )
const results = runner . run ( lastCompilationResult , categoryIndex )