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
1dd7cf40
Commit
1dd7cf40
authored
Jun 25, 2021
by
aniket-engg
Committed by
Aniket
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linting fix
parent
fe8b42a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
remix-ui-static-analyser.tsx
...x-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
+17
-17
No files found.
libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
View file @
1dd7cf40
...
@@ -134,10 +134,10 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -134,10 +134,10 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
const
showWarningsByModule
=
(
showOnlyModule
:
string
)
=>
{
const
showWarningsByModule
=
(
showOnlyModule
:
string
)
=>
{
let
count
=
0
let
count
=
0
if
(
allWarnings
[
showOnlyModule
])
{
if
(
allWarnings
[
showOnlyModule
])
{
const
newWarningState
=
{}
const
newWarningState
=
{}
newWarningState
[
showOnlyModule
]
=
allWarnings
[
showOnlyModule
]
newWarningState
[
showOnlyModule
]
=
allWarnings
[
showOnlyModule
]
setWarningState
({
[
showOnlyModule
]:
allWarnings
[
showOnlyModule
]
})
setWarningState
({
[
showOnlyModule
]:
allWarnings
[
showOnlyModule
]
})
count
=
allWarnings
[
showOnlyModule
].
length
count
=
allWarnings
[
showOnlyModule
].
length
}
else
if
(
showOnlyModule
===
'all'
)
{
}
else
if
(
showOnlyModule
===
'all'
)
{
setWarningState
(
allWarnings
)
setWarningState
(
allWarnings
)
...
@@ -153,7 +153,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -153,7 +153,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
const
warningMessage
=
[]
const
warningMessage
=
[]
const
warningErrors
=
[]
const
warningErrors
=
[]
/
******************** Remix Analysis ********************/
/
/ Remix Analysis
runner
.
run
(
lastCompilationResult
,
categoryIndex
,
results
=>
{
runner
.
run
(
lastCompilationResult
,
categoryIndex
,
results
=>
{
results
.
map
((
result
)
=>
{
results
.
map
((
result
)
=>
{
let
moduleName
let
moduleName
...
@@ -207,7 +207,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -207,7 +207,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
warningMessage
.
push
({
msg
,
options
,
hasWarning
:
true
,
warningModuleName
:
moduleName
})
warningMessage
.
push
({
msg
,
options
,
hasWarning
:
true
,
warningModuleName
:
moduleName
})
})
})
})
})
/
******************** Slither Analysis ********************/
/
/ Slither Analysis
if
(
slitherEnabled
)
{
if
(
slitherEnabled
)
{
props
.
analysisModule
.
call
(
'solidity-logic'
,
'getCompilerState'
).
then
((
compilerState
)
=>
{
props
.
analysisModule
.
call
(
'solidity-logic'
,
'getCompilerState'
).
then
((
compilerState
)
=>
{
const
{
currentVersion
,
optimize
,
evmVersion
}
=
compilerState
const
{
currentVersion
,
optimize
,
evmVersion
}
=
compilerState
...
@@ -245,7 +245,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -245,7 +245,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
fileName
,
fileName
,
errLine
:
row
,
errLine
:
row
,
errCol
:
column
,
errCol
:
column
,
item
:
{
warning
:
item
.
description
},
item
:
{
warning
:
item
.
description
},
name
:
item
.
title
,
name
:
item
.
title
,
locationString
,
locationString
,
more
:
item
.
more
,
more
:
item
.
more
,
...
@@ -265,8 +265,8 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -265,8 +265,8 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
setShowSlitherResult
(
'node'
)
setShowSlitherResult
(
'node'
)
if
(
categoryIndex
.
length
>
0
)
{
if
(
categoryIndex
.
length
>
0
)
{
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
}
}
}
}
})
})
}
else
{
}
else
{
if
(
categoryIndex
.
length
)
{
if
(
categoryIndex
.
length
)
{
...
@@ -451,15 +451,15 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -451,15 +451,15 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
</
span
>
</
span
>
</
div
>
</
div
>
<
div
className=
"d-flex"
id=
"onlySlitherResult"
>
<
div
className=
"d-flex"
id=
"onlySlitherResult"
>
<
RemixUiCheckbox
<
RemixUiCheckbox
id=
"showOnlySlitherResult"
id=
"showOnlySlitherResult"
inputType=
"checkbox"
inputType=
"checkbox"
onClick=
{
handleShowSlitherResultEnabled
}
onClick=
{
handleShowSlitherResultEnabled
}
checked=
{
slitherResultEnabled
}
checked=
{
slitherResultEnabled
}
label=
"Show Only Slither Analysis"
label=
"Show Only Slither Analysis"
onChange=
{
()
=>
{}
}
onChange=
{
()
=>
{}
}
display
=
{
showSlitherResult
}
display
=
{
showSlitherResult
}
/>
/>
</
div
>
</
div
>
<
br
/>
<
br
/>
{
Object
.
entries
(
warningState
).
length
>
0
&&
{
Object
.
entries
(
warningState
).
length
>
0
&&
...
@@ -469,8 +469,8 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -469,8 +469,8 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
(
Object
.
entries
(
warningState
).
map
((
element
,
index
)
=>
(
(
Object
.
entries
(
warningState
).
map
((
element
,
index
)
=>
(
<
div
key=
{
index
}
>
<
div
key=
{
index
}
>
<
span
className=
"text-dark h6"
>
{
element
[
0
]
}
</
span
>
<
span
className=
"text-dark h6"
>
{
element
[
0
]
}
</
span
>
{
element
[
1
][
'map'
]((
x
,
i
)
=>
(
{
element
[
1
][
'map'
]((
x
,
i
)
=>
(
// eslint-disable-line dot-notation
x
.
hasWarning
?
(
x
.
hasWarning
?
(
// eslint-disable-next-line dot-notation
<
div
id=
{
`staticAnalysisModule${element[1]['warningModuleName']}`
}
key=
{
i
}
>
<
div
id=
{
`staticAnalysisModule${element[1]['warningModuleName']}`
}
key=
{
i
}
>
<
ErrorRenderer
message=
{
x
.
msg
}
opt=
{
x
.
options
}
warningErrors=
{
x
.
warningErrors
}
editor=
{
props
.
analysisModule
}
/>
<
ErrorRenderer
message=
{
x
.
msg
}
opt=
{
x
.
options
}
warningErrors=
{
x
.
warningErrors
}
editor=
{
props
.
analysisModule
}
/>
</
div
>
</
div
>
...
...
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