This patch provided easy navigation to find the previous and next source file report. For each source file view, three hyperlinks (index, prev and next links) are given below the report create time. By clicking the index link, the coverage report will go back to index.html page. The prev/next links will go to the previous/next source report. The prev link is disabled if the source file is the first source file link in the index page. The next link is disabled if the source file is the last source file link in the index page.
Diff Detail
Event Timeline
On a low level, I'm concerned about the unnecessary quadratic behavior in this patch. If "N = |SourceFiles|", then renderPageNavigation() does O(N) work and it's called O(N) times. Given that llvm+clang has over 2,400 source files, this could actually be noticeable. We already get user reports about llvm-cov being slow...
On a high level, I'm not convinced that this is a significant usability improvement (as opposed to the "Go to first unexecuted line" feature). You can emulate this functionality by clicking the "Back" button in your browser and picking the next interesting file. Note that users are generally uninterested in looking at the coverage report for *every* file -- they usually just care about the ones with low coverage.
I have some alternate ideas for how to improve the html reports if you're interested: 1) include a list of unexecuted functions in a file with links to the right source locations, 2) implement a function whitelist (e.g, the "dump()" function in llvm is never executed, but shouldn't be marked as uncovered).
test/tools/llvm-cov/showProjectSummary.cpp | ||
---|---|---|
35 | I don't think we should display "Prev" or "Next" if they aren't links. | |
35 | We're missing tests for the case where there is a prev link but no next link, and a next link but no prev link. Maybe you could reuse the multiple-inputs.covmapping file to test this? |
Thanks for pointing this out. I have updated the patch and removed unnecessary execution time in the renderPageNavigation() function. After reducing the cost of running time, will it be considered as an acceptable feature?
On a high level, I'm not convinced that this is a significant usability improvement (as opposed to the "Go to first unexecuted line" feature). You can emulate this functionality by clicking the "Back" button in your browser and picking the next interesting file. Note that users are generally uninterested in looking at the coverage report for *every* file -- they usually just care about the ones with low coverage.
I will add filter and sort table functions to the index page to only show the source files that the users are interested in. In the long term, the previous and next links could then automatically update when using the filter function.
test/tools/llvm-cov/showProjectSummary.cpp | ||
---|---|---|
35 | Thanks, I have followed your advice to add the missing tests. |
I didn't mean to request changes to this diff with my inline comments. Sorry for the confusion. Let's figure out whether the feature is needed and worry about the code later.
On a high level, I'm not convinced that this is a significant usability improvement (as opposed to the "Go to first unexecuted line" feature). You can emulate this functionality by clicking the "Back" button in your browser and picking the next interesting file. Note that users are generally uninterested in looking at the coverage report for *every* file -- they usually just care about the ones with low coverage.
I will add filter and sort table functions to the index page to only show the source files that the users are interested in. In the long term, the previous and next links could then automatically update when using the filter function.
Being able to sort the entries of the index file by, e.g function coverage percentage would be nice. However, I don't think the Next/Prev links would be compelling even in this context. It just makes the difference between two clicks (back button + next file report link) versus one, for a relatively infrequent action. I don't think we should go ahead with this patch.
I don't think we should display "Prev" or "Next" if they aren't links.