diff --git a/libs/remix-ui/static-analyser/src/lib/actions/staticAnalysisActions.ts b/libs/remix-ui/static-analyser/src/lib/actions/staticAnalysisActions.ts index 694a517130..942c926feb 100644 --- a/libs/remix-ui/static-analyser/src/lib/actions/staticAnalysisActions.ts +++ b/libs/remix-ui/static-analyser/src/lib/actions/staticAnalysisActions.ts @@ -44,18 +44,20 @@ export const compilation = (analysisModule: AnalysisTab, */ // 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, warningContainer: React.RefObject, calculateWarningStateEntries: (e:[string, any][]) => {length: number, errors: any[] }, warningState, setHints: React.Dispatch>, hints: SolHintReport[], setSlitherWarnings: React.Dispatch>, setSsaWarnings: React.Dispatch>, -slitherEnabled: boolean, setStartAnalysis: React.Dispatch>, solhintEnabled: boolean) { +slitherEnabled: boolean, setStartAnalysis: React.Dispatch>, solhintEnabled: boolean, basicEnabled: boolean) { setStartAnalysis(true) setHints([]) setSsaWarnings([]) setSlitherWarnings([]) if (!isSupportedVersion) return if (state.data !== null) { - if (lastCompilationResult && (categoryIndex.length > 0 || showSlither)) { + if (lastCompilationResult && (solhintEnabled || basicEnabled || showSlither)) { + console.log('run analysis') const warningMessage = [] const warningErrors = [] props.analysisModule.hints = [] // Run solhint + console.log('solhint about to start') _paq.push(['trackEvent', 'solidityStaticAnalyzer', 'analyze', 'solHint']) const hintsResult = await props.analysisModule.call('solhint', 'lint', state.file) props.analysisModule.hints = solhintEnabled === false ? 0 : hintsResult diff --git a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx index 87df4ee98a..9fad2b494b 100644 --- a/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx +++ b/libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx @@ -730,14 +730,14 @@ useEffect(() => { buttonText={`Analyse ${state.file}`} classList="btn btn-sm btn-primary btn-block" onClick={async () => await run(state.data, state.source, state.file, state , props, isSupportedVersion, showSlither, categoryIndex, groupedModules, runner,_paq, - message, showWarnings, allWarnings, warningContainer, calculateWarningStateEntries, warningState, setHints, hints, setSlitherWarnings, setSsaWarnings, slitherEnabled, setStartAnalysis, solhintEnabled)} + message, showWarnings, allWarnings, warningContainer, calculateWarningStateEntries, warningState, setHints, hints, setSlitherWarnings, setSsaWarnings, slitherEnabled, setStartAnalysis, solhintEnabled, basicEnabled)} disabled={(state.data === null || !isSupportedVersion) || (!solhintEnabled && !basicEnabled) } /> :