-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
I'm continuing working on the HTML reporter and starting to get visual representation of our code coverage. There are some issues, mostly due to the fact that the lines
function in adana-analyze reports all lines between loc.start
and loc.end
as covered with coverage count of the parent node. This not only results in empty lines having coverage count, but also in the fact that empty lines have higher count than their neighboring lines with statements and the such (compare lines 18 and 19).
So, I changed the line counting loop to only include loc.start
and use Math.max
on counts. This solves two issues:
- The lines reported as covered are actually covered.
- Lines with function assignments actually show the count of function declaration, not the count of function executions. Same goes for a single line ternary expressions. If the falsy branch of a ternary is not covered, that doesn't mean that the ternary is not executed at all.
Below is the screenshot of the result. It's only a little bit better.
- I don't know what to do with functions. On one hand I think it's good that we're tracking the execution count for the "function" tag, but the visual representation is weird (see line 2).
- Method calls don't seem to be covered.
- Something wonky is going on with conditionals (see lines 11 and 13).
Metadata
Metadata
Assignees
Labels
No labels