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
76d86764
Commit
76d86764
authored
Jun 24, 2021
by
aniket-engg
Committed by
Aniket
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show only slither analysis
parent
49e72424
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
remix-ui-static-analyser.tsx
...x-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
+17
-6
No files found.
libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
View file @
76d86764
...
...
@@ -57,8 +57,9 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
const
[
autoRun
,
setAutoRun
]
=
useState
(
true
)
const
[
slitherEnabled
,
setSlitherEnabled
]
=
useState
(
false
)
const
[
showSlither
,
setShowSlither
]
=
useState
(
'hidden'
)
// Show checkbox to select to display only Slither Analysis
const
[
showSlitherResult
,
setShowSlitherResult
]
=
useState
(
'hidden'
)
const
[
s
howSlitherResultEnabled
,
setShow
SlitherResultEnabled
]
=
useState
(
false
)
const
[
s
litherResultEnabled
,
set
SlitherResultEnabled
]
=
useState
(
false
)
const
[
categoryIndex
,
setCategoryIndex
]
=
useState
(
groupedModuleIndex
(
groupedModules
))
const
warningContainer
=
React
.
useRef
(
null
)
...
...
@@ -128,6 +129,14 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
setWarningState
(
groupedCategory
)
}
const
showWarningsByModule
=
(
showOnlyModule
:
string
)
=>
{
if
(
showOnlyModule
&&
warningState
[
showOnlyModule
])
{
const
newWarningState
=
{}
newWarningState
[
showOnlyModule
]
=
warningState
[
showOnlyModule
]
setWarningState
({[
showOnlyModule
]:
warningState
[
showOnlyModule
]})
}
}
const
run
=
(
lastCompilationResult
,
lastCompilationSource
,
currentFile
)
=>
{
if
(
state
.
data
!==
null
)
{
if
(
lastCompilationResult
&&
(
categoryIndex
.
length
>
0
||
slitherEnabled
))
{
...
...
@@ -243,6 +252,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
warningMessage
.
push
({
msg
,
options
,
hasWarning
:
true
,
warningModuleName
:
'Slither Analysis'
})
})
showWarnings
(
warningMessage
,
'warningModuleName'
)
setShowSlitherResult
(
'visible'
)
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
}
}).
catch
((
error
)
=>
{
...
...
@@ -291,7 +301,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
}
}
const
handleS
howSlitherResult
Enabled
=
()
=>
{
const
handleS
lither
Enabled
=
()
=>
{
if
(
slitherEnabled
)
{
setSlitherEnabled
(
false
)
}
else
{
...
...
@@ -299,11 +309,12 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
}
}
const
handleS
lither
Enabled
=
()
=>
{
if
(
s
howS
litherResultEnabled
)
{
setS
howS
litherResultEnabled
(
false
)
const
handleS
howSlitherResult
Enabled
=
()
=>
{
if
(
slitherResultEnabled
)
{
setSlitherResultEnabled
(
false
)
}
else
{
setShowSlitherResultEnabled
(
true
)
setSlitherResultEnabled
(
true
)
showWarningsByModule
(
'Slither Analysis'
)
}
}
...
...
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