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
2864d6bf
Commit
2864d6bf
authored
Jun 24, 2021
by
aniket-engg
Committed by
Aniket
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
intermediate commit
parent
6b743f0a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
remix-ui-static-analyser.tsx
...x-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
+23
-3
No files found.
libs/remix-ui/static-analyser/src/lib/remix-ui-static-analyser.tsx
View file @
2864d6bf
...
@@ -57,6 +57,8 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -57,6 +57,8 @@ 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'
)
const
[
showSlitherResult
,
setShowSlitherResult
]
=
useState
(
'hidden'
)
const
[
showSlitherResultEnabled
,
setShowSlitherResultEnabled
]
=
useState
(
false
)
const
[
categoryIndex
,
setCategoryIndex
]
=
useState
(
groupedModuleIndex
(
groupedModules
))
const
[
categoryIndex
,
setCategoryIndex
]
=
useState
(
groupedModuleIndex
(
groupedModules
))
const
warningContainer
=
React
.
useRef
(
null
)
const
warningContainer
=
React
.
useRef
(
null
)
...
@@ -211,7 +213,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -211,7 +213,6 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
lastCompilationSource
.
sources
,
lastCompilationSource
.
sources
,
lastCompilationResult
.
sources
lastCompilationResult
.
sources
)
)
console
.
log
(
'location:'
,
location
)
row
=
location
.
start
.
line
row
=
location
.
start
.
line
column
=
location
.
start
.
column
column
=
location
.
start
.
column
locationString
=
row
+
1
+
':'
+
column
+
':'
locationString
=
row
+
1
+
':'
+
column
+
':'
...
@@ -233,7 +234,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -233,7 +234,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
location
:
location
location
:
location
}
}
warningErrors
.
push
(
options
)
warningErrors
.
push
(
options
)
warningMessage
.
push
({
msg
,
options
,
hasWarning
:
true
,
warningModuleName
:
item
.
title
})
warningMessage
.
push
({
msg
,
options
,
hasWarning
:
true
,
warningModuleName
:
'Slither Analysis'
})
})
})
showWarnings
(
warningMessage
,
'warningModuleName'
)
showWarnings
(
warningMessage
,
'warningModuleName'
)
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
props
.
event
.
trigger
(
'staticAnaysisWarning'
,
[
warningCount
])
...
@@ -282,7 +283,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -282,7 +283,7 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
}
}
}
}
const
handleS
lither
Enabled
=
()
=>
{
const
handleS
howSlitherResult
Enabled
=
()
=>
{
if
(
slitherEnabled
)
{
if
(
slitherEnabled
)
{
setSlitherEnabled
(
false
)
setSlitherEnabled
(
false
)
}
else
{
}
else
{
...
@@ -290,6 +291,14 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -290,6 +291,14 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
}
}
}
}
const
handleSlitherEnabled
=
()
=>
{
if
(
showSlitherResultEnabled
)
{
setShowSlitherResultEnabled
(
false
)
}
else
{
setShowSlitherResultEnabled
(
true
)
}
}
const
handleAutoRun
=
()
=>
{
const
handleAutoRun
=
()
=>
{
if
(
autoRun
)
{
if
(
autoRun
)
{
setAutoRun
(
false
)
setAutoRun
(
false
)
...
@@ -419,6 +428,17 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
...
@@ -419,6 +428,17 @@ export const RemixUiStaticAnalyser = (props: RemixUiStaticAnalyserProps) => {
{
state
.
file
}
{
state
.
file
}
</
span
>
</
span
>
</
div
>
</
div
>
<
div
className=
"d-flex"
id=
"onlySlitherResult"
>
<
RemixUiCheckbox
id=
"showOnlySlitherResult"
inputType=
"checkbox"
onClick=
{
handleShowSlitherResultEnabled
}
checked=
{
showSlitherResultEnabled
}
label=
"Show Slither result only"
onChange=
{
()
=>
{}
}
visibility
=
{
showSlitherResult
}
/>
</
div
>
{
Object
.
entries
(
warningState
).
length
>
0
&&
{
Object
.
entries
(
warningState
).
length
>
0
&&
<
div
id=
'staticanalysisresult'
>
<
div
id=
'staticanalysisresult'
>
<
div
className=
"mb-4"
>
<
div
className=
"mb-4"
>
...
...
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