fixing solhint no analysis for solhint

pull/3838/head
Joseph Izang 1 year ago
parent 84f4369c02
commit a92411bc6b
  1. 129
      libs/remix-ui/static-analyser/src/lib/actions/staticAnalysisActions.ts
  2. 104
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx

@ -23,7 +23,7 @@ export const compilation = (analysisModule: AnalysisTab,
} }
} }
export const runLinting = async (solhintEnabled, setHints, hints: SolHintReport[], warningResult, isSupportedVersion, state: RemixUiStaticAnalyserState, export const runLinting = async (solhintEnabled, setHints, hints: SolHintReport[], isSupportedVersion, state: RemixUiStaticAnalyserState,
props: RemixUiStaticAnalyserProps, setStartAnalysis: React.Dispatch<React.SetStateAction<boolean>>) => { props: RemixUiStaticAnalyserProps, setStartAnalysis: React.Dispatch<React.SetStateAction<boolean>>) => {
// Run solhint // Run solhint
setStartAnalysis(true) setStartAnalysis(true)
@ -31,13 +31,11 @@ export const runLinting = async (solhintEnabled, setHints, hints: SolHintReport[
if (!isSupportedVersion) return if (!isSupportedVersion) return
if (solhintEnabled === false) return if (solhintEnabled === false) return
if (state.data !== null) { if (state.data !== null) {
if (solhintEnabled) {
props.analysisModule.hints = [] props.analysisModule.hints = []
setHints([])
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 props.analysisModule.hints = solhintEnabled === false ? 0 : hintsResult
setHints(hintsResult)
return hintsResult return hintsResult
}
} }
} }
@ -70,7 +68,7 @@ slitherEnabled: boolean, setStartAnalysis: React.Dispatch<React.SetStateAction<b
props.analysisModule.hints = [] props.analysisModule.hints = []
if (!isSupportedVersion) return if (!isSupportedVersion) return
if (state.data !== null) { if (state.data !== null) {
if (lastCompilationResult && (categoryIndex.length > 0 || showSlither)) { if (lastCompilationResult && (categoryIndex.length > 0)) {
_paq.push(['trackEvent', 'solidityStaticAnalyzer', 'analyze', 'remixAnalyzer']) _paq.push(['trackEvent', 'solidityStaticAnalyzer', 'analyze', 'remixAnalyzer'])
const warningMessage = [] const warningMessage = []
const warningErrors = [] const warningErrors = []
@ -79,76 +77,71 @@ slitherEnabled: boolean, setStartAnalysis: React.Dispatch<React.SetStateAction<b
// 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 // props.analysisModule.hints = solhintEnabled === false ? 0 : hintsResult
// setHints(hintsResult) // setHints(hintsResult)
const warningResult = calculateWarningStateEntries(Object.entries(warningState)) const lintResult = await (await runLinting(solhintEnabled, setHints, hints, isSupportedVersion, state, props, setStartAnalysis))
// props.analysisModule.emit('statusChanged', { key: hints.length+warningResult.length, // props.analysisModule.emit('statusChanged', { key: hints.length+warningResult.length,
// title: `${hints.length+warningResult.length} warning${hints.length+warningResult.length === 1 ? '' : 's'}`, type: 'warning'}) // title: `${hints.length+warningResult.length} warning${hints.length+warningResult.length === 1 ? '' : 's'}`, type: 'warning'})
const lintResult = runLinting(solhintEnabled, setHints, hints, warningResult, isSupportedVersion, state, props, setStartAnalysis)
//---------------------------- RunLinting End ----------------------------
// Remix Analysis // Remix Analysis
const results = runner.run(lastCompilationResult, categoryIndex) const results = runner.run(lastCompilationResult, categoryIndex)
for (const result of results) { for (const result of results) {
let moduleName let moduleName
Object.keys(groupedModules).map(key => { Object.keys(groupedModules).map(key => {
groupedModules[key].forEach(el => { groupedModules[key].forEach(el => {
if (el.name === result.name) { if (el.name === result.name) {
moduleName = groupedModules[key][0].categoryDisplayName moduleName = groupedModules[key][0].categoryDisplayName
} }
})
}) })
}) // iterate over the warnings and create an object
// iterate over the warnings and create an object for (const item of result.report) {
for (const item of result.report) { let location: any = {}
let location: any = {} let locationString = 'not available'
let locationString = 'not available' let column = 0
let column = 0 let row = 0
let row = 0 let fileName = currentFile
let fileName = currentFile let isLibrary = false
let isLibrary = false
if (item.location) { if (item.location) {
const split = item.location.split(':') const split = item.location.split(':')
const file = split[2] const file = split[2]
location = { location = {
start: parseInt(split[0]), start: parseInt(split[0]),
length: parseInt(split[1]) length: parseInt(split[1])
}
location = props.analysisModule._deps.offsetToLineColumnConverter.offsetToLineColumn(
location,
parseInt(file),
lastCompilationSource.sources,
lastCompilationResult.sources
)
row = location.start.line
column = location.start.column
locationString = row + 1 + ':' + column + ':'
fileName = Object.keys(lastCompilationResult.sources)[file]
} }
location = props.analysisModule._deps.offsetToLineColumnConverter.offsetToLineColumn( if (fileName !== currentFile) {
location, const { file, provider } = await props.analysisModule.call('fileManager', 'getPathFromUrl', fileName)
parseInt(file), if (file.startsWith('.deps') || (provider.type === 'localhost' && file.startsWith('localhost/node_modules'))) isLibrary = true
lastCompilationSource.sources, }
lastCompilationResult.sources const msg = message(result.name, item.warning, item.more, fileName, locationString)
) const options = {
row = location.start.line type: 'warning',
column = location.start.column useSpan: true,
locationString = row + 1 + ':' + column + ':' errFile: fileName,
fileName = Object.keys(lastCompilationResult.sources)[file] fileName,
} isLibrary,
if(fileName !== currentFile) { errLine: row,
const {file, provider} = await props.analysisModule.call('fileManager', 'getPathFromUrl', fileName) errCol: column,
if (file.startsWith('.deps') || (provider.type === 'localhost' && file.startsWith('localhost/node_modules'))) isLibrary = true item: item,
} name: result.name,
const msg = message(result.name, item.warning, item.more, fileName, locationString) locationString,
const options = { more: item.more,
type: 'warning', location: location
useSpan: true, }
errFile: fileName, warningErrors.push(options)
fileName, warningMessage.push({ msg, options, hasWarning: true, warningModuleName: moduleName })
isLibrary, setSsaWarnings(warningMessage)
errLine: row, // setHints(lintResult)
errCol: column,
item: item,
name: result.name,
locationString,
more: item.more,
location: location
}
warningErrors.push(options)
warningMessage.push({ msg, options, hasWarning: true, warningModuleName: moduleName })
const newHints = await lintResult
setHints(newHints)
setSsaWarnings(warningMessage)
} }
} }
} else { } else {

@ -191,7 +191,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
return () => { } return () => { }
}, [props]) }, [props])
const hintErrors = hints.filter(hint => hint.type === 'error') const hintErrors = hints && hints.filter(hint => hint.type === 'error')
const noLibSlitherWarnings = slitherWarnings.filter(w => !w.options.isLibrary) const noLibSlitherWarnings = slitherWarnings.filter(w => !w.options.isLibrary)
const slitherErrors = noLibSlitherWarnings.filter(slitherError => slitherError.options.type === 'error') const slitherErrors = noLibSlitherWarnings.filter(slitherError => slitherError.options.type === 'error')
const remixAnalysisNoLibs = ssaWarnings.filter(ssa => ssa.options.isLibrary === false) const remixAnalysisNoLibs = ssaWarnings.filter(ssa => ssa.options.isLibrary === false)
@ -246,14 +246,14 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
} }
if (solhintEnabled && !basicEnabled && !slitherEnabled && state.data && state.source !== null) { if (solhintEnabled && !basicEnabled && !slitherEnabled && state.data && state.source !== null) {
props.analysisModule.internalCount = 0 props.analysisModule.internalCount = 0
props.event.trigger('staticAnaysisWarning', [hideWarnings ? hintErrors.length : hints.length]) props.event.trigger('staticAnaysisWarning', [hideWarnings ? hintErrors.length : hints?.length])
} }
if (solhintEnabled && basicEnabled && !slitherEnabled && !showLibsWarning if (solhintEnabled && basicEnabled && !slitherEnabled && !showLibsWarning
&& state.data && state.source !== null) { && state.data && state.source !== null) {
console.log('solhint and remix are enabled here') console.log('solhint and remix are enabled here')
props.analysisModule.internalCount = 0 props.analysisModule.internalCount = 0
props.event.trigger('staticAnaysisWarning', [hideWarnings props.event.trigger('staticAnaysisWarning', [hideWarnings
? hintErrors.length + remixAnalysisNoLibs.filter(x => x.options.type !== 'warning').length : hints.length + ssaWarnings.length]) ? hintErrors.length + remixAnalysisNoLibs.filter(x => x.options.type !== 'warning').length : hints?.length + ssaWarnings.length])
} }
if (slitherEnabled && !basicEnabled && !solhintEnabled && state.data && state.source !== null) { if (slitherEnabled && !basicEnabled && !solhintEnabled && state.data && state.source !== null) {
props.analysisModule.internalCount = 0 props.analysisModule.internalCount = 0
@ -263,7 +263,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
props.analysisModule.internalCount = 0 props.analysisModule.internalCount = 0
props.event.trigger('staticAnaysisWarning', [hideWarnings props.event.trigger('staticAnaysisWarning', [hideWarnings
? hintErrors.length + remixAnalysisLessWarnings.length + slitherErrors.length ? hintErrors.length + remixAnalysisLessWarnings.length + slitherErrors.length
: hints.length + ssaWarnings.length + slitherWarnings.length]) : hints?.length + ssaWarnings.length + slitherWarnings.length])
} }
// if showLibsWarning is true // if showLibsWarning is true
if(basicEnabled && !solhintEnabled && !slitherEnabled && !hideWarnings && state.data && state.source !== null ) { if(basicEnabled && !solhintEnabled && !slitherEnabled && !hideWarnings && state.data && state.source !== null ) {
@ -273,13 +273,13 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
} }
if (solhintEnabled && !basicEnabled && !slitherEnabled && !hideWarnings && state.data && state.source !== null) { if (solhintEnabled && !basicEnabled && !slitherEnabled && !hideWarnings && state.data && state.source !== null) {
props.analysisModule.internalCount = 0 props.analysisModule.internalCount = 0
props.event.trigger('staticAnaysisWarning', [showLibsWarning ? hints.length : hints.length]) props.event.trigger('staticAnaysisWarning', [showLibsWarning ? hints?.length : hints?.length])
} }
if (solhintEnabled && basicEnabled && !slitherEnabled && !hideWarnings && state.data && state.source !== null) { if (solhintEnabled && basicEnabled && !slitherEnabled && !hideWarnings && state.data && state.source !== null) {
console.log('solhint and remix are enabled here') console.log('solhint and remix are enabled here')
props.analysisModule.internalCount = 0 props.analysisModule.internalCount = 0
props.event.trigger('staticAnaysisWarning', [showLibsWarning props.event.trigger('staticAnaysisWarning', [showLibsWarning
? hints.length + ssaWarnings.length : hints.length + remixAnalysisNoLibs.length]) ? hints?.length + ssaWarnings.length : hints?.length + remixAnalysisNoLibs.length])
} }
if (slitherEnabled && !basicEnabled && !solhintEnabled && !hideWarnings && state.data && state.source !== null) { if (slitherEnabled && !basicEnabled && !solhintEnabled && !hideWarnings && state.data && state.source !== null) {
props.analysisModule.internalCount = 0 props.analysisModule.internalCount = 0
@ -288,42 +288,23 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
if (slitherEnabled && basicEnabled && solhintEnabled && !hideWarnings && state.data && state.source !== null) { if (slitherEnabled && basicEnabled && solhintEnabled && !hideWarnings && state.data && state.source !== null) {
props.analysisModule.internalCount = 0 props.analysisModule.internalCount = 0
props.event.trigger('staticAnaysisWarning', [showLibsWarning props.event.trigger('staticAnaysisWarning', [showLibsWarning
? hints.length + ssaWarnings.length + slitherWarnings.length : hints.length + remixAnalysisNoLibs.length + noLibSlitherWarnings.length]) ? hints?.length + ssaWarnings.length + slitherWarnings.length : hints?.length + remixAnalysisNoLibs.length + noLibSlitherWarnings.length])
}
if(solhintEnabled && basicEnabled && !slitherEnabled && !hideWarnings && !showLibsWarning) {
props.analysisModule.internalCount = 0
if(props.analysisModule.hints.length > 0) {
props.event.trigger('staticAnaysisWarning', [hints.length + remixAnalysisNoLibs.length])
}
}
if(solhintEnabled && !basicEnabled && !slitherEnabled && hideWarnings && showLibsWarning) {
props.analysisModule.internalCount = 0
if(remixAnalysisLessWarnings.length > 0) {
props.event.trigger('staticAnaysisWarning', [hints.length])
}
} }
if(basicEnabled && solhintEnabled && !slitherEnabled && !hideWarnings && !showLibsWarning) { if(basicEnabled && solhintEnabled && !slitherEnabled && !hideWarnings && !showLibsWarning) {
props.analysisModule.internalCount = 0 props.analysisModule.internalCount = 0
if(props.analysisModule.hints.length > 0) { props.event.trigger('staticAnaysisWarning', [hints?.length + remixAnalysisNoLibs.length])
props.event.trigger('staticAnaysisWarning', [hints.length + remixAnalysisNoLibs.length])
}
} }
if(solhintEnabled && basicEnabled && slitherEnabled && !hideWarnings && !showLibsWarning) { if(solhintEnabled && basicEnabled && slitherEnabled && !hideWarnings && !showLibsWarning) {
props.analysisModule.internalCount = 0 props.analysisModule.internalCount = 0
if(props.analysisModule.hints.length > 0) { props.analysisModule.hints = []
props.analysisModule.hints = [] props.event.trigger('staticAnaysisWarning', [hints?.length + remixAnalysisNoLibs.length + slitherWarnings.length])
props.event.trigger('staticAnaysisWarning', [hints.length + remixAnalysisNoLibs.length + slitherWarnings.length])
}
} }
if(solhintEnabled && basicEnabled && !slitherEnabled && hideWarnings && showLibsWarning) { if(solhintEnabled && basicEnabled && !slitherEnabled && hideWarnings && showLibsWarning) {
props.analysisModule.internalCount = 0 props.analysisModule.internalCount = 0
if(remixAnalysisLessWarnings.length > 0) { props.event.trigger('staticAnaysisWarning', [hintErrors.length + remixAnalysisLessWarnings.length])
props.event.trigger('staticAnaysisWarning', [hintErrors.length + remixAnalysisNoLibs
.filter(x => x.options.type === 'warning').length])
}
} }
}, [ssaWarnings.length, hints.length, hideWarnings, showLibsWarning, state]) }, [ssaWarnings.length, hints?.length, hideWarnings, showLibsWarning, state])
useEffect(() => { useEffect(() => {
if(solhintEnabled === false) { if(solhintEnabled === false) {
@ -491,12 +472,12 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
tabKey: "linter", tabKey: "linter",
child: ( child: (
<> <>
{hints.length > 0 ? ( {solhintEnabled && hints?.length > 0 ? (
<div id="solhintlintingresult" className="mb-5"> <div id="solhintlintingresult" className="mb-5">
<div className="mb-4 pt-2"> <div className="mb-4 pt-2">
<Fragment> <Fragment>
{!hideWarnings {!hideWarnings
? hints.map((hint, index) => ( ? hints?.map((hint, index) => (
<div <div
key={index} key={index}
className={`${ className={`${
@ -579,22 +560,22 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
</Fragment> </Fragment>
</div> </div>
</div> </div>
) : state.data && state.file.length > 0 && state.source && startAnalysis && hints.length > 0 ? <span className="ml-4 spinner-grow-sm d-flex justify-content-center">Loading...</span> : <span className="display-6 text-center">Nothing to report</span>} ) : state.data && state.file.length > 0 && state.source && startAnalysis && hints?.length > 0 ? <span className="ml-4 spinner-grow-sm d-flex justify-content-center">Loading...</span> : <span className="display-6 text-center">Nothing to report</span>}
</> </>
), ),
title: ( title: (
<span> <span>
Solhint Solhint
{hints.length > 0 ? ( {hints && hints?.length > 0 ? (
hideWarnings ? ( hideWarnings ? (
<i className={`badge ${hints.filter(x => x.type === 'error').length > 0 <i className={`badge ${hints?.filter(x => x.type === 'error').length > 0
? `badge-danger` : 'badge-warning'} badge-pill px-1 ml-1 text-center`}> ? `badge-danger` : 'badge-warning'} badge-pill px-1 ml-1 text-center`}>
{hintErrors.length} {hintErrors.length}
</i> </i>
) : ( ) : (
<i className={`badge ${hints.filter(x => x.type === 'error').length > 0 <i className={`badge ${hints?.filter(x => x.type === 'error').length > 0
? `badge-danger` : 'badge-warning'} badge-pill px-1 ml-1 text-center`}> ? `badge-danger` : 'badge-warning'} badge-pill px-1 ml-1 text-center`}>
{hints.length} {hints?.length}
</i> </i>
) )
) : null} ) : null}
@ -630,18 +611,18 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
title: ( title: (
<span> <span>
Slither Slither
{slitherWarnings.length > 0 ? ( {slitherWarnings && slitherWarnings?.length > 0 ? (
hideWarnings ? ( hideWarnings ? (
<i className="badge badge-warning badge-pill px-1 ml-1"> <i className="badge badge-warning badge-pill px-1 ml-1">
{slitherErrors.length} {slitherErrors?.length}
</i> </i>
) : showLibsWarning === true && hideWarnings === false ? ( ) : showLibsWarning === true && hideWarnings === false ? (
<i className={`badge ${slitherErrors.length > 0 ? `badge-danger` : 'badge-warning'} badge-pill px-1 ml-1 text-center`}> <i className={`badge ${slitherErrors.length > 0 ? `badge-danger` : 'badge-warning'} badge-pill px-1 ml-1 text-center`}>
{slitherWarnings.length} {slitherWarnings.length}
</i> </i>
) : ( ) : (
<i className={`badge ${slitherErrors.length > 0 ? `badge-danger` : 'badge-warning'} badge-pill px-1 ml-1 text-center`}> <i className={`badge ${slitherErrors?.length > 0 ? `badge-danger` : 'badge-warning'} badge-pill px-1 ml-1 text-center`}>
{noLibSlitherWarnings.length} {noLibSlitherWarnings?.length}
</i> </i>
) )
) : null} ) : null}
@ -649,12 +630,12 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
), ),
child: ( child: (
<> <>
{slitherWarnings.length > 0 ? ( {slitherWarnings?.length > 0 ? (
<div id="solhintlintingresult" className="mb-5"> <div id="solhintlintingresult" className="mb-5">
<div className="mb-4 pt-2"> <div className="mb-4 pt-2">
<Fragment> <Fragment>
{!hideWarnings {!hideWarnings
? showLibsWarning ? slitherWarnings.map((warning, index) => ( ? showLibsWarning ? slitherWarnings && slitherWarnings?.map((warning, index) => (
<div <div
data-id={`staticAnalysisModule${warning.warningModuleName}${index}`} data-id={`staticAnalysisModule${warning.warningModuleName}${index}`}
id={`staticAnalysisModule${warning.warningModuleName}${index}`} id={`staticAnalysisModule${warning.warningModuleName}${index}`}
@ -766,11 +747,16 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
buttonText={`Analyse ${state.file}`} buttonText={`Analyse ${state.file}`}
classList="btn btn-sm btn-primary btn-block" classList="btn btn-sm btn-primary btn-block"
onClick={async () => { onClick={async () => {
await run(state.data, state.source, state.file, state , props, isSupportedVersion, showSlither, categoryIndex, groupedModules, runner,_paq, await runLinting(solhintEnabled, setHints, hints, isSupportedVersion, state, props, setStartAnalysis)
message, showWarnings, allWarnings, warningContainer, calculateWarningStateEntries, warningState, setHints, hints, setSlitherWarnings, setSsaWarnings, slitherEnabled, setStartAnalysis, solhintEnabled, basicEnabled) if(basicEnabled) {
await run(state.data, state.source, state.file, state , props, isSupportedVersion, showSlither, categoryIndex, groupedModules, runner,_paq,
await runSlitherAnalysis(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, basicEnabled)
message, showWarnings, allWarnings, warningContainer, calculateWarningStateEntries, warningState, setHints, hints, setSlitherWarnings, setSsaWarnings, slitherEnabled, setStartAnalysis) }
if(slitherEnabled) {
await runSlitherAnalysis(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)
}
} }
} }
disabled={(state.data === null || !isSupportedVersion || !solhintEnabled && !basicEnabled) } disabled={(state.data === null || !isSupportedVersion || !solhintEnabled && !basicEnabled) }
@ -778,13 +764,23 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
buttonText={`Analyze ${state.file}`} buttonText={`Analyze ${state.file}`}
title={`${runButtonTitle}`} title={`${runButtonTitle}`}
classList="btn btn-sm btn-primary btn-block" 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, onClick={async () => {
message, showWarnings, allWarnings, warningContainer, calculateWarningStateEntries, warningState, setHints, hints, setSlitherWarnings, setSsaWarnings, slitherEnabled, setStartAnalysis, solhintEnabled, basicEnabled)} await runLinting(solhintEnabled, setHints, hints, isSupportedVersion, state, props, setStartAnalysis)
if(basicEnabled) {
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, basicEnabled)
}
if(slitherEnabled) {
await runSlitherAnalysis(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)
}
}}
disabled={(state.data === null || !isSupportedVersion) || (!solhintEnabled && !basicEnabled) } disabled={(state.data === null || !isSupportedVersion) || (!solhintEnabled && !basicEnabled) }
/>} />}
{state && state.data !== null && state.source !== null && state.file.length > 0 ? (<div className="d-flex border-top flex-column"> {state && state.data !== null && state.source !== null && state.file.length > 0 ? (<div className="d-flex border-top flex-column">
{slitherWarnings.length > 0 || hints.length > 0 || Object.entries(warningState).length > 0 ? ( {slitherWarnings?.length > 0 || hints?.length > 0 || Object.entries(warningState).length > 0 ? (
<div className={`mt-4 p-2 d-flex ${slitherWarnings.length > 0 || hints.length > 0 || Object.entries(warningState).length > 0 ? 'border-top' : ''} flex-column`}> <div className={`mt-4 p-2 d-flex ${slitherWarnings?.length > 0 || hints?.length > 0 || Object.entries(warningState).length > 0 ? 'border-top' : ''} flex-column`}>
<span>Last results for:</span> <span>Last results for:</span>
<span <span
className="text-break break-word word-break font-weight-bold" className="text-break break-word word-break font-weight-bold"
@ -822,7 +818,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
onSelect={(newKey) => setTabKey(newKey)} onSelect={(newKey) => setTabKey(newKey)}
> >
{ {
checkBasicStatus() ? <Tab basicEnabled ? <Tab
key={tabKeys[1].tabKey} key={tabKeys[1].tabKey}
title={tabKeys[1].title} title={tabKeys[1].title}
eventKey={tabKeys[1].tabKey} eventKey={tabKeys[1].tabKey}

Loading…
Cancel
Save