Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid conditions with one line #1098

Closed
shargon opened this issue Sep 12, 2019 · 3 comments
Closed

Avoid conditions with one line #1098

shargon opened this issue Sep 12, 2019 · 3 comments
Labels
discussion Initial issue state - proposed but not yet accepted house-keeping Small enhancements that need to be done in order to keep the project organised

Comments

@shargon
Copy link
Member

shargon commented Sep 12, 2019

Summary
The current coverage engine think that the whole line is covered although the condition was not met, so maybe we have a wrong coverage percentage because some parts of the code are not tested.

For example

if (a==1) return -1;
return a;

In this case, if you test this method with the value a=2 full method will be covered, and is not. We should have test for a==1 too.

Do you have any solution you want to propose?
Avoid one line for conditions or change the coverage engine.

Where in software does this update applies to?

  • Other: All modules
@shargon shargon added discussion Initial issue state - proposed but not yet accepted house-keeping Small enhancements that need to be done in order to keep the project organised labels Sep 12, 2019
@eryeer
Copy link
Contributor

eryeer commented Sep 18, 2019

Maybe we need to define a writing rule to avoid the one line if conditional statement.

@shargon
Copy link
Member Author

shargon commented Nov 22, 2019

This will be closed when we migrate all projects to coveralls.io like neo-vm with neo-project/neo-vm#228 .

As you can see, the 'coveralls.io` distinguish a single line https://coveralls.io/builds/27171399/source?filename=src/neo-vm/ExecutionEngine.cs#L351

@lock9
Copy link
Contributor

lock9 commented Nov 25, 2019

Closing as requested by Shargon

@lock9 lock9 closed this as completed Nov 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Initial issue state - proposed but not yet accepted house-keeping Small enhancements that need to be done in order to keep the project organised
Projects
None yet
Development

No branches or pull requests

3 participants