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
a2d85a9c
Commit
a2d85a9c
authored
Oct 24, 2017
by
yann300
Committed by
GitHub
Oct 24, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #883 from ethereum/fixAnalysis
Fix static analysis report && add test
parents
2f7d78ed
585c8b3a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
similarVariableNames.js
src/app/staticanalysis/modules/similarVariableNames.js
+2
-2
staticanalysis.js
test-browser/tests/staticanalysis.js
+7
-2
No files found.
src/app/staticanalysis/modules/similarVariableNames.js
View file @
a2d85a9c
...
...
@@ -29,11 +29,11 @@ function report (contracts, multipleContractsWithSameName) {
var
funcName
=
common
.
getFullQuallyfiedFuncDefinitionIdent
(
contract
.
node
,
func
.
node
,
func
.
parameters
)
var
hasModifiersComments
=
''
if
(
hasModifiers
)
{
hasModifiersComments
=
yo
`<span><br
/
><i>Note:</i> Modifiers are currently not considered by this static analysis.</span>`
hasModifiersComments
=
yo
`<span><br><i>Note:</i> Modifiers are currently not considered by this static analysis.</span>`
}
var
multipleContractsWithSameNameComments
=
''
if
(
multipleContractsWithSameName
)
{
multipleContractsWithSameNameComments
=
yo
`<span><br
/
><i>Note:</i> Import aliases are currently not supported by this static analysis.</span>`
multipleContractsWithSameNameComments
=
yo
`<span><br><i>Note:</i> Import aliases are currently not supported by this static analysis.</span>`
}
var
vars
=
getFunctionVariables
(
contract
,
func
).
map
(
common
.
getDeclaredVariableName
)
...
...
test-browser/tests/staticanalysis.js
View file @
a2d85a9c
...
...
@@ -11,7 +11,11 @@ contract test1 { address test = tx.origin; }
contract test2 {}
contract TooMuchGas {
uint x;
function() { x++; }
function() {
x++;
uint test;
uint test1;
}
}`
}
]
...
...
@@ -38,7 +42,8 @@ function runTests (browser) {
.
click
(
'#staticanalysisView button'
)
.
waitForElementPresent
(
'#staticanalysisresult .warning'
,
2000
,
true
,
function
()
{
dom
.
listSelectorContains
([
'browser/Untitled.sol:2:33: Use of tx.origin'
,
'Fallback function of contract browser/Untitled.sol:TooMuchGas requires too much gas'
],
'Fallback function of contract browser/Untitled.sol:TooMuchGas requires too much gas'
,
'TooMuchGas.(): Variables have very similar names test and test1.'
],
'#staticanalysisresult .warning'
,
browser
,
function
()
{
browser
.
end
()
...
...
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