Skip to content

Commit

Permalink
docs: sample HTML for 7.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Aug 12, 2023
1 parent 0421fdb commit 9c2f924
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 48 deletions.
22 changes: 11 additions & 11 deletions doc/sample_html/coverage_html.js
Expand Up @@ -34,7 +34,7 @@ function on_click(sel, fn) {

// Helpers for table sorting
function getCellValue(row, column = 0) {
const cell = row.cells[column]
const cell = row.cells[column] // nosemgrep: eslint.detect-object-injection
if (cell.childElementCount == 1) {
const child = cell.firstElementChild
if (child instanceof HTMLTimeElement && child.dateTime) {
Expand Down Expand Up @@ -100,7 +100,7 @@ coverage.wire_up_filter = function () {
// Keep running total of each metric, first index contains number of shown rows
const totals = new Array(table.rows[0].cells.length).fill(0);
// Accumulate the percentage as fraction
totals[totals.length - 1] = { "numer": 0, "denom": 0 };
totals[totals.length - 1] = { "numer": 0, "denom": 0 }; // nosemgrep: eslint.detect-object-injection

// Hide / show elements.
table_body_rows.forEach(row => {
Expand All @@ -116,14 +116,14 @@ coverage.wire_up_filter = function () {

for (let column = 1; column < totals.length; column++) {
// Accumulate dynamic totals
cell = row.cells[column]
cell = row.cells[column] // nosemgrep: eslint.detect-object-injection
if (column === totals.length - 1) {
// Last column contains percentage
const [numer, denom] = cell.dataset.ratio.split(" ");
totals[column]["numer"] += parseInt(numer, 10);
totals[column]["denom"] += parseInt(denom, 10);
totals[column]["numer"] += parseInt(numer, 10); // nosemgrep: eslint.detect-object-injection
totals[column]["denom"] += parseInt(denom, 10); // nosemgrep: eslint.detect-object-injection
} else {
totals[column] += parseInt(cell.textContent, 10);
totals[column] += parseInt(cell.textContent, 10); // nosemgrep: eslint.detect-object-injection
}
}
});
Expand All @@ -144,22 +144,22 @@ coverage.wire_up_filter = function () {
// Calculate new dynamic sum values based on visible rows.
for (let column = 1; column < totals.length; column++) {
// Get footer cell element.
const cell = footer.cells[column];
const cell = footer.cells[column]; // nosemgrep: eslint.detect-object-injection

// Set value into dynamic footer cell element.
if (column === totals.length - 1) {
// Percentage column uses the numerator and denominator,
// and adapts to the number of decimal places.
const match = /\.([0-9]+)/.exec(cell.textContent);
const places = match ? match[1].length : 0;
const { numer, denom } = totals[column];
const { numer, denom } = totals[column]; // nosemgrep: eslint.detect-object-injection
cell.dataset.ratio = `${numer} ${denom}`;
// Check denom to prevent NaN if filtered files contain no statements
cell.textContent = denom
? `${(numer * 100 / denom).toFixed(places)}%`
: `${(100).toFixed(places)}%`;
} else {
cell.textContent = totals[column];
cell.textContent = totals[column]; // nosemgrep: eslint.detect-object-injection
}
}
}));
Expand All @@ -184,7 +184,7 @@ coverage.index_ready = function () {

if (stored_list) {
const {column, direction} = JSON.parse(stored_list);
const th = document.querySelector("[data-sortable]").tHead.rows[0].cells[column];
const th = document.querySelector("[data-sortable]").tHead.rows[0].cells[column]; // nosemgrep: eslint.detect-object-injection
th.setAttribute("aria-sort", direction === "ascending" ? "descending" : "ascending");
th.click()
}
Expand Down Expand Up @@ -250,7 +250,7 @@ coverage.pyfile_ready = function () {
}

for (cls in coverage.filters) {
coverage.set_line_visibilty(cls, coverage.filters[cls]);
coverage.set_line_visibilty(cls, coverage.filters[cls]); // nosemgrep: eslint.detect-object-injection
}

coverage.assign_shortkeys();
Expand Down
8 changes: 4 additions & 4 deletions doc/sample_html/d_7b071bdc2a35fa80___init___py.html
Expand Up @@ -66,8 +66,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80___main___py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -97,8 +97,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80___main___py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
</div>
</footer>
Expand Down
8 changes: 4 additions & 4 deletions doc/sample_html/d_7b071bdc2a35fa80___main___py.html
Expand Up @@ -66,8 +66,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80_cogapp_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -97,8 +97,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80_cogapp_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
</div>
</footer>
Expand Down
8 changes: 4 additions & 4 deletions doc/sample_html/d_7b071bdc2a35fa80_cogapp_py.html
Expand Up @@ -66,8 +66,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80_makefiles_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -938,8 +938,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80_makefiles_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
</div>
</footer>
Expand Down
8 changes: 4 additions & 4 deletions doc/sample_html/d_7b071bdc2a35fa80_makefiles_py.html
Expand Up @@ -66,8 +66,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80_test_cogapp_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -126,8 +126,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80_test_cogapp_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
</div>
</footer>
Expand Down
8 changes: 4 additions & 4 deletions doc/sample_html/d_7b071bdc2a35fa80_test_cogapp_py.html
Expand Up @@ -66,8 +66,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80_test_makefiles_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -2713,8 +2713,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80_test_makefiles_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
</div>
</footer>
Expand Down
8 changes: 4 additions & 4 deletions doc/sample_html/d_7b071bdc2a35fa80_test_makefiles_py.html
Expand Up @@ -66,8 +66,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80_test_whiteutils_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -207,8 +207,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80_test_whiteutils_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
</div>
</footer>
Expand Down
8 changes: 4 additions & 4 deletions doc/sample_html/d_7b071bdc2a35fa80_test_whiteutils_py.html
Expand Up @@ -66,8 +66,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80_whiteutils_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -187,8 +187,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_7b071bdc2a35fa80_whiteutils_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
</div>
</footer>
Expand Down
8 changes: 4 additions & 4 deletions doc/sample_html/d_7b071bdc2a35fa80_whiteutils_py.html
Expand Up @@ -66,8 +66,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="index.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -157,8 +157,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="index.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
</div>
</footer>
Expand Down
8 changes: 4 additions & 4 deletions doc/sample_html/index.html
Expand Up @@ -46,8 +46,8 @@ <h1>Cog coverage:
<input id="filter" type="text" value="" placeholder="filter..." />
</form>
<p class="text">
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
</div>
</header>
Expand Down Expand Up @@ -157,8 +157,8 @@ <h1>Cog coverage:
<footer>
<div class="content">
<p>
<a class="nav" href="https://coverage.readthedocs.io/en/7.2.7">coverage.py v7.2.7</a>,
created at 2023-05-29 15:26 -0400
<a class="nav" href="https://coverage.readthedocs.io/en/7.3.0">coverage.py v7.3.0</a>,
created at 2023-08-12 11:46 -0400
</p>
</div>
<aside class="hidden">
Expand Down
2 changes: 1 addition & 1 deletion doc/sample_html/status.json
@@ -1 +1 @@
{"format":2,"version":"7.2.7","globals":"2b43fc00a84f1e7415bbd5a0e2a010d6","files":{"d_7b071bdc2a35fa80___init___py":{"hash":"70ef41e14b11d599cdbcf53f562ebb16","index":{"nums":[2,1,1,0,0,0,0,0],"html_filename":"d_7b071bdc2a35fa80___init___py.html","relative_filename":"cogapp/__init__.py"}},"d_7b071bdc2a35fa80___main___py":{"hash":"6d9d0d551879aa3e73791f40c5739845","index":{"nums":[2,1,3,0,3,0,0,0],"html_filename":"d_7b071bdc2a35fa80___main___py.html","relative_filename":"cogapp/__main__.py"}},"d_7b071bdc2a35fa80_cogapp_py":{"hash":"7428c811d741c23b10655ff6c20fb85f","index":{"nums":[2,1,500,1,224,210,30,138],"html_filename":"d_7b071bdc2a35fa80_cogapp_py.html","relative_filename":"cogapp/cogapp.py"}},"d_7b071bdc2a35fa80_makefiles_py":{"hash":"4b73eaf76fbb53af575b40165e831aac","index":{"nums":[2,1,22,0,18,14,0,14],"html_filename":"d_7b071bdc2a35fa80_makefiles_py.html","relative_filename":"cogapp/makefiles.py"}},"d_7b071bdc2a35fa80_test_cogapp_py":{"hash":"34099de695d2cac204436597408d33d2","index":{"nums":[2,1,845,2,591,24,1,21],"html_filename":"d_7b071bdc2a35fa80_test_cogapp_py.html","relative_filename":"cogapp/test_cogapp.py"}},"d_7b071bdc2a35fa80_test_makefiles_py":{"hash":"63fd1bdc011935abfd11301da94b383e","index":{"nums":[2,1,70,0,53,6,0,6],"html_filename":"d_7b071bdc2a35fa80_test_makefiles_py.html","relative_filename":"cogapp/test_makefiles.py"}},"d_7b071bdc2a35fa80_test_whiteutils_py":{"hash":"ec69457cbd6dfbc85eefabdfc0931c99","index":{"nums":[2,1,68,0,50,0,0,0],"html_filename":"d_7b071bdc2a35fa80_test_whiteutils_py.html","relative_filename":"cogapp/test_whiteutils.py"}},"d_7b071bdc2a35fa80_whiteutils_py":{"hash":"6dbf59193ab1bdcba86b017c86bb4724","index":{"nums":[2,1,43,0,5,34,4,4],"html_filename":"d_7b071bdc2a35fa80_whiteutils_py.html","relative_filename":"cogapp/whiteutils.py"}}}}
{"format":2,"version":"7.3.0","globals":"cf57432bd60c5c7fe95381f735604410","files":{"d_7b071bdc2a35fa80___init___py":{"hash":"391b1397701ef9b315be7bc127f18b9b","index":{"nums":[2,1,1,0,0,0,0,0],"html_filename":"d_7b071bdc2a35fa80___init___py.html","relative_filename":"cogapp/__init__.py"}},"d_7b071bdc2a35fa80___main___py":{"hash":"6d9d0d551879aa3e73791f40c5739845","index":{"nums":[2,1,3,0,3,0,0,0],"html_filename":"d_7b071bdc2a35fa80___main___py.html","relative_filename":"cogapp/__main__.py"}},"d_7b071bdc2a35fa80_cogapp_py":{"hash":"c10a37b4e8f437912d511bf85f633a1c","index":{"nums":[2,1,500,1,224,210,30,138],"html_filename":"d_7b071bdc2a35fa80_cogapp_py.html","relative_filename":"cogapp/cogapp.py"}},"d_7b071bdc2a35fa80_makefiles_py":{"hash":"e73ea90ac9a2e7af9d1fdb188ea22dfe","index":{"nums":[2,1,22,0,18,14,0,14],"html_filename":"d_7b071bdc2a35fa80_makefiles_py.html","relative_filename":"cogapp/makefiles.py"}},"d_7b071bdc2a35fa80_test_cogapp_py":{"hash":"9e5dd5bc1ab396b467852befcb944445","index":{"nums":[2,1,845,2,591,24,1,21],"html_filename":"d_7b071bdc2a35fa80_test_cogapp_py.html","relative_filename":"cogapp/test_cogapp.py"}},"d_7b071bdc2a35fa80_test_makefiles_py":{"hash":"ade09a0bc261e3a45b7cbd6bd9c006c2","index":{"nums":[2,1,70,0,53,6,0,6],"html_filename":"d_7b071bdc2a35fa80_test_makefiles_py.html","relative_filename":"cogapp/test_makefiles.py"}},"d_7b071bdc2a35fa80_test_whiteutils_py":{"hash":"4511a89ca54b865d6397d6b7d315c35c","index":{"nums":[2,1,68,0,50,0,0,0],"html_filename":"d_7b071bdc2a35fa80_test_whiteutils_py.html","relative_filename":"cogapp/test_whiteutils.py"}},"d_7b071bdc2a35fa80_whiteutils_py":{"hash":"c68cfd051fc76896fdb23127cf2ca0ea","index":{"nums":[2,1,43,0,5,34,4,4],"html_filename":"d_7b071bdc2a35fa80_whiteutils_py.html","relative_filename":"cogapp/whiteutils.py"}}}}

0 comments on commit 9c2f924

Please sign in to comment.