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
d002f963
Commit
d002f963
authored
Jun 25, 2021
by
aniket-engg
Committed by
Aniket
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
toggele analysis checkbox
parent
76d86764
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
remix-ui-static-analyser.tsx
...x-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
+9
-3
No files found.
libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
View file @
d002f963
...
...
@@ -64,6 +64,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
const
warningContainer
=
React
.
useRef
(
null
)
const
[
warningState
,
setWarningState
]
=
useState
({})
const
[
allWarnings
,
setAllWarnings
]
=
useState
({})
const
[
state
,
dispatch
]
=
useReducer
(
analysisReducer
,
initialState
)
useEffect
(()
=>
{
...
...
@@ -72,6 +73,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
useEffect
(()
=>
{
setWarningState
({})
setAllWarnings
({})
if
(
autoRun
)
{
if
(
state
.
data
!==
null
)
{
run
(
state
.
data
,
state
.
source
,
state
.
file
)
...
...
@@ -126,14 +128,17 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
}
const
groupedCategory
=
groupBy
(
resultArray
,
groupByKey
)
setAllWarnings
(
groupedCategory
)
setWarningState
(
groupedCategory
)
}
const
showWarningsByModule
=
(
showOnlyModule
:
string
)
=>
{
if
(
showOnlyModule
&&
warningState
[
showOnlyModule
])
{
if
(
allWarnings
[
showOnlyModule
])
{
const
newWarningState
=
{}
newWarningState
[
showOnlyModule
]
=
warningState
[
showOnlyModule
]
setWarningState
({[
showOnlyModule
]:
warningState
[
showOnlyModule
]})
newWarningState
[
showOnlyModule
]
=
allWarnings
[
showOnlyModule
]
setWarningState
({[
showOnlyModule
]:
allWarnings
[
showOnlyModule
]})
}
else
if
(
showOnlyModule
===
'all'
)
{
setWarningState
(
allWarnings
)
}
}
...
...
@@ -312,6 +317,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
const
handleShowSlitherResultEnabled
=
()
=>
{
if
(
slitherResultEnabled
)
{
setSlitherResultEnabled
(
false
)
showWarningsByModule
(
'all'
)
}
else
{
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