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
9aaa9135
Commit
9aaa9135
authored
Jul 05, 2021
by
Aniket-Engg
Committed by
Aniket
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
npm imports working without location
parent
d2184ccd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
+21
-18
remix-ui-static-analyser.tsx
...x-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
+18
-16
slitherClient.ts
libs/remixd/src/services/slitherClient.ts
+3
-2
No files found.
libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
View file @
9aaa9135
...
@@ -201,22 +201,24 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -201,22 +201,24 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
let
column
=
0
let
column
=
0
let
row
=
0
let
row
=
0
let
fileName
=
currentFile
let
fileName
=
currentFile
if
(
item
.
sourceMap
&&
item
.
sourceMap
.
length
)
{
// There are issues with location for imported contract
location
=
{
// which stops complete analysis including remix analyzer's
start
:
item
.
sourceMap
[
0
].
source_mapping
.
start
,
// if (item.sourceMap && item.sourceMap.length) {
length
:
item
.
sourceMap
[
0
].
source_mapping
.
length
// location = {
}
// start: item.sourceMap[0].source_mapping.start,
location
=
props
.
analysisModule
.
_deps
.
offsetToLineColumnConverter
.
offsetToLineColumn
(
// length: item.sourceMap[0].source_mapping.length
location
,
// }
Object
.
keys
(
lastCompilationResult
.
sources
).
indexOf
(
item
.
sourceMap
[
0
].
source_mapping
.
filename_relative
),
// location = props.analysisModule._deps.offsetToLineColumnConverter.offsetToLineColumn(
lastCompilationSource
.
sources
,
// location,
lastCompilationResult
.
sources
// Object.keys(lastCompilationResult.sources).indexOf(item.sourceMap[0].source_mapping.filename_relative),
)
// lastCompilationSource.sources,
row
=
location
.
start
.
line
// lastCompilationResult.sources
column
=
location
.
start
.
column
// )
locationString
=
row
+
1
+
':'
+
column
+
':'
// row = location.start.line
fileName
=
Object
.
keys
(
lastCompilationResult
.
contracts
)[
0
]
// column = location.start.column
}
// locationString = row + 1 + ':' + column + ':'
// fileName = Object.keys(lastCompilationResult.contracts)[0]
// }
warningCount
++
warningCount
++
const
msg
=
message
(
item
.
title
,
item
.
description
,
item
.
more
,
fileName
,
locationString
)
const
msg
=
message
(
item
.
title
,
item
.
description
,
item
.
more
,
fileName
,
locationString
)
const
options
=
{
const
options
=
{
...
...
libs/remixd/src/services/slitherClient.ts
View file @
9aaa9135
...
@@ -127,9 +127,10 @@ export class SlitherClient extends PluginClient {
...
@@ -127,9 +127,10 @@ export class SlitherClient extends PluginClient {
const
solcRemaps
=
remaps
?
`--solc-remaps "
${
remaps
}
"`
:
''
const
solcRemaps
=
remaps
?
`--solc-remaps "
${
remaps
}
"`
:
''
const
cmd
:
string
=
`slither
${
filePath
}
${
solcArgs
}
${
solcRemaps
}
--json
${
outputFile
}
`
const
cmd
:
string
=
`slither
${
filePath
}
${
solcArgs
}
${
solcRemaps
}
--json
${
outputFile
}
`
console
.
log
(
'command--->'
,
cmd
)
console
.
log
(
'
\
x1b[32m%s
\
x1b[0m'
,
'[Slither Analysis]: Running Slither...'
)
console
.
log
(
'
\
x1b[32m%s
\
x1b[0m'
,
'[Slither Analysis]: Running Slither...'
)
const
child
=
spawn
(
cmd
,
options
)
// Added `stdio: 'ignore'` as for contract with NPM imports analysis which is exported in 'stderr'
// get too big and hangs the process. We process analysis from the report file only
const
child
=
spawn
(
cmd
,
{
cwd
:
this
.
currentSharedFolder
,
shell
:
true
,
stdio
:
'ignore'
})
const
response
=
{}
const
response
=
{}
child
.
on
(
'close'
,
()
=>
{
child
.
on
(
'close'
,
()
=>
{
const
outputFileAbsPath
:
string
=
`
${
this
.
currentSharedFolder
}
/
${
outputFile
}
`
const
outputFileAbsPath
:
string
=
`
${
this
.
currentSharedFolder
}
/
${
outputFile
}
`
...
...
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