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
393c5215
Commit
393c5215
authored
May 04, 2018
by
soad003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Static Analysis: Naming as suggested by axic
parent
fd402799
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
assignAndCompare.js
remix-solidity/src/analysis/modules/assignAndCompare.js
+1
-1
staticAnalysisCommon.js
remix-solidity/src/analysis/modules/staticAnalysisCommon.js
+7
-7
No files found.
remix-solidity/src/analysis/modules/assignAndCompare.js
View file @
393c5215
...
...
@@ -8,7 +8,7 @@ function assignAndCompare () {
}
assignAndCompare
.
prototype
.
visit
=
function
(
node
)
{
if
(
common
.
is
Block
WithTopLevelUnAssignedBinOp
(
node
))
common
.
getUnAssignedTopLevelBinOps
(
node
).
forEach
((
n
)
=>
this
.
warningNodes
.
push
(
n
))
if
(
common
.
is
SubScope
WithTopLevelUnAssignedBinOp
(
node
))
common
.
getUnAssignedTopLevelBinOps
(
node
).
forEach
((
n
)
=>
this
.
warningNodes
.
push
(
n
))
}
assignAndCompare
.
prototype
.
report
=
function
(
compilationResults
)
{
...
...
remix-solidity/src/analysis/modules/staticAnalysisCommon.js
View file @
393c5215
...
...
@@ -386,8 +386,8 @@ function getFullQuallyfiedFuncDefinitionIdent (contract, func, paramTypes) {
return
getContractName
(
contract
)
+
'.'
+
getFunctionDefinitionName
(
func
)
+
'('
+
util
.
concatWithSeperator
(
paramTypes
,
','
)
+
')'
}
function
getUnAssignedTopLevelBinOps
(
blocklik
e
)
{
return
blocklik
e
.
children
.
filter
(
isBinaryOpInExpression
)
function
getUnAssignedTopLevelBinOps
(
subScop
e
)
{
return
subScop
e
.
children
.
filter
(
isBinaryOpInExpression
)
}
// #################### Trivial Node Identification
...
...
@@ -616,16 +616,16 @@ function isConstructor (node) {
}
/**
* True if is block has top level binops (e.g. that are not assigned to anything, most of the time confused compare instead of assign)
* True if is block
/ SubScope
has top level binops (e.g. that are not assigned to anything, most of the time confused compare instead of assign)
* @node {ASTNode} some AstNode
* @return {bool}
*/
function
is
Block
WithTopLevelUnAssignedBinOp
(
node
)
{
function
is
SubScope
WithTopLevelUnAssignedBinOp
(
node
)
{
return
nodeType
(
node
,
exactMatch
(
nodeTypes
.
BLOCK
))
&&
node
.
children
&&
node
.
children
.
some
(
isBinaryOpInExpression
)
||
is
BlockLik
eStatement
(
node
)
&&
node
.
children
&&
node
.
children
.
some
(
isBinaryOpInExpression
)
// Second Case for if without braces
is
SubScop
eStatement
(
node
)
&&
node
.
children
&&
node
.
children
.
some
(
isBinaryOpInExpression
)
// Second Case for if without braces
}
function
is
BlockLik
eStatement
(
node
)
{
function
is
SubScop
eStatement
(
node
)
{
return
(
nodeType
(
node
,
exactMatch
(
nodeTypes
.
IFSTATEMENT
))
||
nodeType
(
node
,
exactMatch
(
nodeTypes
.
FORSTATEMENT
))
||
nodeType
(
node
,
exactMatch
(
nodeTypes
.
WHILESTATEMENT
))
||
...
...
@@ -952,7 +952,7 @@ module.exports = {
isAbiNamespaceCall
:
isAbiNamespaceCall
,
isSpecialVariableAccess
:
isSpecialVariableAccess
,
isDynamicArrayAccess
:
isDynamicArrayAccess
,
is
BlockWithTopLevelUnAssignedBinOp
:
isBlock
WithTopLevelUnAssignedBinOp
,
is
SubScopeWithTopLevelUnAssignedBinOp
:
isSubScope
WithTopLevelUnAssignedBinOp
,
hasFunctionBody
:
hasFunctionBody
,
isInteraction
:
isInteraction
,
isEffect
:
isEffect
,
...
...
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