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
d9d5993e
Commit
d9d5993e
authored
Jul 02, 2021
by
Aniket-Engg
Committed by
Aniket
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show only checkbox removed
parent
a53d4667
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
36 deletions
+0
-36
remix-ui-static-analyser.tsx
...x-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
+0
-36
No files found.
libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
View file @
d9d5993e
...
@@ -57,14 +57,10 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -57,14 +57,10 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
const
[
autoRun
,
setAutoRun
]
=
useState
(
true
)
const
[
autoRun
,
setAutoRun
]
=
useState
(
true
)
const
[
slitherEnabled
,
setSlitherEnabled
]
=
useState
(
false
)
const
[
slitherEnabled
,
setSlitherEnabled
]
=
useState
(
false
)
const
[
showSlither
,
setShowSlither
]
=
useState
(
'hidden'
)
const
[
showSlither
,
setShowSlither
]
=
useState
(
'hidden'
)
// Show checkbox to select to display only Slither Analysis
const
[
showSlitherResult
,
setShowSlitherResult
]
=
useState
(
'none'
)
const
[
slitherResultEnabled
,
setSlitherResultEnabled
]
=
useState
(
false
)
const
[
categoryIndex
,
setCategoryIndex
]
=
useState
(
groupedModuleIndex
(
groupedModules
))
const
[
categoryIndex
,
setCategoryIndex
]
=
useState
(
groupedModuleIndex
(
groupedModules
))
const
warningContainer
=
React
.
useRef
(
null
)
const
warningContainer
=
React
.
useRef
(
null
)
const
[
warningState
,
setWarningState
]
=
useState
({})
const
[
warningState
,
setWarningState
]
=
useState
({})
const
[
allWarnings
,
setAllWarnings
]
=
useState
({})
const
[
state
,
dispatch
]
=
useReducer
(
analysisReducer
,
initialState
)
const
[
state
,
dispatch
]
=
useReducer
(
analysisReducer
,
initialState
)
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -73,7 +69,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -73,7 +69,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
setWarningState
({})
setWarningState
({})
setAllWarnings
({})
if
(
autoRun
)
{
if
(
autoRun
)
{
if
(
state
.
data
!==
null
)
{
if
(
state
.
data
!==
null
)
{
run
(
state
.
data
,
state
.
source
,
state
.
file
)
run
(
state
.
data
,
state
.
source
,
state
.
file
)
...
@@ -128,24 +123,9 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -128,24 +123,9 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
}
}
const
groupedCategory
=
groupBy
(
resultArray
,
groupByKey
)
const
groupedCategory
=
groupBy
(
resultArray
,
groupByKey
)
setAllWarnings
(
groupedCategory
)
setWarningState
(
groupedCategory
)
setWarningState
(
groupedCategory
)
}
}
const
showWarningsByModule
=
(
showOnlyModule
:
string
)
=>
{
let
count
=
0
if
(
allWarnings
[
showOnlyModule
])
{
const
newWarningState
=
{}
newWarningState
[
showOnlyModule
]
=
allWarnings
[
showOnlyModule
]
setWarningState
({
[
showOnlyModule
]:
allWarnings
[
showOnlyModule
]
})
count
=
allWarnings
[
showOnlyModule
].
length
}
else
if
(
showOnlyModule
===
'all'
)
{
setWarningState
(
allWarnings
)
for
(
const
e
in
allWarnings
)
count
+=
allWarnings
[
e
].
length
}
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
count
])
}
const
run
=
(
lastCompilationResult
,
lastCompilationSource
,
currentFile
)
=>
{
const
run
=
(
lastCompilationResult
,
lastCompilationSource
,
currentFile
)
=>
{
if
(
state
.
data
!==
null
)
{
if
(
state
.
data
!==
null
)
{
if
(
lastCompilationResult
&&
(
categoryIndex
.
length
>
0
||
slitherEnabled
))
{
if
(
lastCompilationResult
&&
(
categoryIndex
.
length
>
0
||
slitherEnabled
))
{
...
@@ -262,11 +242,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -262,11 +242,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
})
})
showWarnings
(
warningMessage
,
'warningModuleName'
)
showWarnings
(
warningMessage
,
'warningModuleName'
)
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
if
(
showSlitherResult
===
'none'
)
{
setShowSlitherResult
(
'block'
)
}
else
if
(
showSlitherResult
===
'block'
&&
slitherResultEnabled
)
{
showWarningsByModule
(
'Slither Analysis'
)
}
}
}
}).
catch
((
error
)
=>
{
}).
catch
((
error
)
=>
{
console
.
log
(
'Error found:'
,
error
)
// This should be removed once testing done
console
.
log
(
'Error found:'
,
error
)
// This should be removed once testing done
...
@@ -275,7 +250,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -275,7 +250,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
})
})
})
})
}
else
{
}
else
{
setShowSlitherResult
(
'none'
)
showWarnings
(
warningMessage
,
'warningModuleName'
)
showWarnings
(
warningMessage
,
'warningModuleName'
)
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
}
}
...
@@ -323,16 +297,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -323,16 +297,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
}
}
}
}
const
handleShowSlitherResultEnabled
=
()
=>
{
if
(
slitherResultEnabled
)
{
setSlitherResultEnabled
(
false
)
showWarningsByModule
(
'all'
)
}
else
{
setSlitherResultEnabled
(
true
)
showWarningsByModule
(
'Slither Analysis'
)
}
}
const
handleAutoRun
=
()
=>
{
const
handleAutoRun
=
()
=>
{
if
(
autoRun
)
{
if
(
autoRun
)
{
setAutoRun
(
false
)
setAutoRun
(
false
)
...
...
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