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

What's the difference between statements and lines? #639

Closed
lobabob opened this issue Jun 4, 2016 · 3 comments
Closed

What's the difference between statements and lines? #639

lobabob opened this issue Jun 4, 2016 · 3 comments

Comments

@lobabob
Copy link

lobabob commented Jun 4, 2016

Please let me know if there is a more appropriate place to ask this.

Most other coverage tools I've used before have either had statements or lines, never both leading me to think that they were one and the same. Istanbul however has both statements and lines. Can anyone clarify the difference between the two for me?

@gotwarlost
Copy link
Owner

if you have a line of code that says var x= 10; console.log(x) that's one line and 2 statements.

Of the two statement coverage is more accurate - however line coverage exists for interop with line oriented coverage tools like lcov and backwards compatibility with YUI coverage (for when istanbul was written, no longer relevant now)

@fabianorodrigo
Copy link

if you have a line of code that says var x= 10; console.log(x) that's one line and 2 statements.

Of the two statement coverage is more accurate - however line coverage exists for interop with line oriented coverage tools like lcov and backwards compatibility with YUI coverage (for when istanbul was written, no longer relevant now)

I'm using solidity-coverage, that uses Istanbul. In many cases I've got more lines than statements. How is that possible?

@HelKyle
Copy link

HelKyle commented Oct 17, 2019

@fabianorodrigo like this return ; console.log('never run');, 2 statements in one line. while the second statement will never run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants