run slither analysis by passing path

pull/1398/head
aniket-engg 3 years ago committed by Aniket
parent 0672234f5e
commit 6ef0671faf
  1. 2
      libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
  2. 4
      libs/remixd/src/services/slitherClient.ts

@ -108,7 +108,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
if (lastCompilationResult && categoryIndex.length > 0) { if (lastCompilationResult && categoryIndex.length > 0) {
let warningCount = 0 let warningCount = 0
const warningMessage = [] const warningMessage = []
props.analysisModule.call('slither', 'analyse', state.file).then(console.log)
runner.run(lastCompilationResult, categoryIndex, results => { runner.run(lastCompilationResult, categoryIndex, results => {
results.map((result) => { results.map((result) => {
let moduleName let moduleName

@ -26,8 +26,8 @@ export class SlitherClient extends PluginClient {
const errMsg = '[Slither Analysis]: Cannot analyse in read-only mode' const errMsg = '[Slither Analysis]: Cannot analyse in read-only mode'
return reject(new Error(errMsg)) return reject(new Error(errMsg))
} }
const outputFile = 'slither-report.json' const outputFile = 'remix-slitherReport_' + Date.now() + '.json'
const cmd = `slither ${filePath} --disable-solc-warnings --json ${outputFile}` const cmd = `slither ${filePath} --json ${outputFile}`
const options = { cwd: this.currentSharedFolder, shell: true } const options = { cwd: this.currentSharedFolder, shell: true }
const child = spawn(cmd, options) const child = spawn(cmd, options)
let result = '' let result = ''

Loading…
Cancel
Save