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
4b83cb4f
Commit
4b83cb4f
authored
Jul 19, 2021
by
Aniket-Engg
Committed by
Aniket
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
location only for non-imported contracts
parent
33b334ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
24 deletions
+25
-24
remix-ui-static-analyser.tsx
...x-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
+25
-24
No files found.
libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
View file @
4b83cb4f
...
...
@@ -197,30 +197,31 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
props
.
analysisModule
.
call
(
'terminal'
,
'log'
,
{
type
:
'info'
,
value
:
`[Slither Analysis]: Analysis Completed!!
${
result
.
count
}
warnings found.`
})
const
report
=
result
.
data
report
.
map
((
item
)
=>
{
const
location
:
any
=
{}
const
locationString
=
'not available'
const
column
=
0
const
row
=
0
const
fileName
=
currentFile
// There are issues with location for imported contract
// which stops complete analysis including remix analyzer's
// if (item.sourceMap && item.sourceMap.length) {
// location = {
// start: item.sourceMap[0].source_mapping.start,
// length: item.sourceMap[0].source_mapping.length
// }
// location = props.analysisModule._deps.offsetToLineColumnConverter.offsetToLineColumn(
// location,
// Object.keys(lastCompilationResult.sources).indexOf(item.sourceMap[0].source_mapping.filename_relative),
// lastCompilationSource.sources,
// lastCompilationResult.sources
// )
// row = location.start.line
// column = location.start.column
// locationString = row + 1 + ':' + column + ':'
// fileName = Object.keys(lastCompilationResult.contracts)[0]
// }
let
location
:
any
=
{}
let
locationString
=
'not available'
let
column
=
0
let
row
=
0
let
fileName
=
currentFile
if
(
item
.
sourceMap
&&
item
.
sourceMap
.
length
)
{
const
fileIndex
=
Object
.
keys
(
lastCompilationResult
.
sources
).
indexOf
(
item
.
sourceMap
[
0
].
source_mapping
.
filename_relative
)
if
(
fileIndex
>=
0
)
{
location
=
{
start
:
item
.
sourceMap
[
0
].
source_mapping
.
start
,
length
:
item
.
sourceMap
[
0
].
source_mapping
.
length
}
location
=
props
.
analysisModule
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
location
,
fileIndex
,
lastCompilationSource
.
sources
,
lastCompilationResult
.
sources
)
row
=
location
.
start
.
line
column
=
location
.
start
.
column
locationString
=
row
+
1
+
':'
+
column
+
':'
fileName
=
Object
.
keys
(
lastCompilationResult
.
sources
)[
fileIndex
]
}
}
warningCount
++
const
msg
=
message
(
item
.
title
,
item
.
description
,
item
.
more
,
fileName
,
locationString
)
const
options
=
{
...
...
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