From 034d3e9e42da21aeb7b06fd3b09bdf3c9f6ff6de Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 25 Jan 2024 12:11:31 -0800 Subject: [PATCH] Prevent Chrome from crashing on large function lists. (#858) --------- Co-authored-by: Tyler Mace Co-authored-by: Spacetown <40258682+spacetown@users.noreply.github.com> --- CHANGELOG.rst | 3 ++- .../html/default/functions_page.content.html | 6 ++++-- .../html/github/functions_page.content.html | 14 ++++++++------ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 11d25a178..eb35ab741 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -39,8 +39,8 @@ New features and notable changes: - Use different color for partial covered lines in HTML report. (:issue:`839`) - Add support to generate LCOV info files. (:issue:`830`) - Add support for FIPS enabled OS when used with Python 3.9. (:issue:`850`) -- Reduce file size for detailed HTML reports by using CSS to link the function lists. (:issue:`840`) - Ignore all negative hits if :option:`--gcov-ignore-parse-errors` is used. (:issue:`852`) +- Reduce file size for detailed HTML reports by merging columns the function lists. (:issue:`840`) - Use literal options for sorting and TXT metric. (:issue:`867`) - The :option:`-b`, :option:`--txt-branches` and :option:`--branches` are deprecated, use :option:`--txt-metric` instead. @@ -49,6 +49,7 @@ New features and notable changes: - The :option:`--sort-uncovered` and :option:`--sort-percentage` are deprecated, use :option:`--sort` instead. The reason for this is that only one sorting order shall be selectable and and an enumeration is easier to handle than several flags. +- Split list of functions into tables with maximum 10000 rows to fix rendering issues. (:issue:`858`) - The development branch is renamed from ``master`` to ``main``. (:issue:`829`, :issue:`873`) - Add support for decision coverage metric in text report (:issue:`864`) diff --git a/gcovr/formats/html/default/functions_page.content.html b/gcovr/formats/html/default/functions_page.content.html index 0637e6c8c..d9b570339 100644 --- a/gcovr/formats/html/default/functions_page.content.html +++ b/gcovr/formats/html/default/functions_page.content.html @@ -1,11 +1,12 @@ {# -*- engine: jinja -*- #} +{% for function_batch in all_functions | batch(10000) %} -{% for entry in all_functions %} + {% for entry in function_batch %} {#- #} {#- #} {#- -#} -{% endfor %} + {% endfor %}
Function (File:Line) Call count Block coverage
{{ entry["name"] }} ({{ entry["filename"] }}:{{ entry["line"] }}) @@ -19,5 +20,6 @@ {#- #}{{ entry["blocks"] }}%
+{% endfor %} diff --git a/gcovr/formats/html/github/functions_page.content.html b/gcovr/formats/html/github/functions_page.content.html index 985354777..6c2684bfb 100644 --- a/gcovr/formats/html/github/functions_page.content.html +++ b/gcovr/formats/html/github/functions_page.content.html @@ -1,11 +1,12 @@ {# -*- engine: jinja -*- #} +{% for function_batch in all_functions | batch(10000) %} - - - - + + + + -{% for entry in all_functions %} + {% for entry in function_batch %} {#- #} {#- #} {#- -#} -{% endfor %} + {% endfor %}
Function (File:Line)Call countBlock coverage
Function (File:Line)Call countBlock coverage
{{ entry["name"] }} ({{ entry["filename"] }}:{{ entry["line"] }}) @@ -19,5 +20,6 @@ {#- #}{{ entry["blocks"] }}%
+{% endfor %}