Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
8a8b2331
Commit
8a8b2331
authored
Aug 24, 2021
by
yann300
Committed by
Aniket
Aug 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
when resolving the file name, make sure we take care of aliases
parent
abcc5f0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
remix-ui-static-analyser.tsx
...x-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
+10
-5
No files found.
libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
View file @
8a8b2331
...
@@ -209,14 +209,14 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -209,14 +209,14 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
})
})
// Slither Analysis
// Slither Analysis
if
(
slitherEnabled
)
{
if
(
slitherEnabled
)
{
props
.
analysisModule
.
call
(
'solidity-logic'
,
'getCompilerState'
).
then
((
compilerState
)
=>
{
props
.
analysisModule
.
call
(
'solidity-logic'
,
'getCompilerState'
).
then
(
async
(
compilerState
)
=>
{
const
{
currentVersion
,
optimize
,
evmVersion
}
=
compilerState
const
{
currentVersion
,
optimize
,
evmVersion
}
=
compilerState
props
.
analysisModule
.
call
(
'terminal'
,
'log'
,
{
type
:
'info'
,
value
:
'[Slither Analysis]: Running...'
})
props
.
analysisModule
.
call
(
'terminal'
,
'log'
,
{
type
:
'info'
,
value
:
'[Slither Analysis]: Running...'
})
props
.
analysisModule
.
call
(
'slither'
,
'analyse'
,
state
.
file
,
{
currentVersion
,
optimize
,
evmVersion
}).
then
((
result
)
=>
{
props
.
analysisModule
.
call
(
'slither'
,
'analyse'
,
state
.
file
,
{
currentVersion
,
optimize
,
evmVersion
}).
then
(
async
(
result
)
=>
{
if
(
result
.
status
)
{
if
(
result
.
status
)
{
props
.
analysisModule
.
call
(
'terminal'
,
'log'
,
{
type
:
'info'
,
value
:
`[Slither Analysis]: Analysis Completed!!
${
result
.
count
}
warnings found.`
})
props
.
analysisModule
.
call
(
'terminal'
,
'log'
,
{
type
:
'info'
,
value
:
`[Slither Analysis]: Analysis Completed!!
${
result
.
count
}
warnings found.`
})
const
report
=
result
.
data
const
report
=
result
.
data
report
.
map
((
item
)
=>
{
for
(
const
item
of
report
)
{
let
location
:
any
=
{}
let
location
:
any
=
{}
let
locationString
=
'not available'
let
locationString
=
'not available'
let
column
=
0
let
column
=
0
...
@@ -224,7 +224,12 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -224,7 +224,12 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
let
fileName
=
currentFile
let
fileName
=
currentFile
if
(
item
.
sourceMap
&&
item
.
sourceMap
.
length
)
{
if
(
item
.
sourceMap
&&
item
.
sourceMap
.
length
)
{
const
fileIndex
=
Object
.
keys
(
lastCompilationResult
.
sources
).
indexOf
(
item
.
sourceMap
[
0
].
source_mapping
.
filename_relative
)
let
path
=
item
.
sourceMap
[
0
].
source_mapping
.
filename_relative
let
fileIndex
=
Object
.
keys
(
lastCompilationResult
.
sources
).
indexOf
(
path
)
if
(
fileIndex
===
-
1
)
{
path
=
await
props
.
analysisModule
.
call
(
'fileManager'
,
'getUrlFromPath'
,
path
)
fileIndex
=
Object
.
keys
(
lastCompilationResult
.
sources
).
indexOf
(
path
.
file
)
}
if
(
fileIndex
>=
0
)
{
if
(
fileIndex
>=
0
)
{
location
=
{
location
=
{
start
:
item
.
sourceMap
[
0
].
source_mapping
.
start
,
start
:
item
.
sourceMap
[
0
].
source_mapping
.
start
,
...
@@ -259,7 +264,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -259,7 +264,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
}
}
warningErrors
.
push
(
options
)
warningErrors
.
push
(
options
)
warningMessage
.
push
({
msg
,
options
,
hasWarning
:
true
,
warningModuleName
:
'Slither Analysis'
})
warningMessage
.
push
({
msg
,
options
,
hasWarning
:
true
,
warningModuleName
:
'Slither Analysis'
})
}
)
}
showWarnings
(
warningMessage
,
'warningModuleName'
)
showWarnings
(
warningMessage
,
'warningModuleName'
)
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment