Skip to content

Commit

Permalink
Deploying to gh-pages from @ 8ce4921 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
shanemcd committed Mar 29, 2024
1 parent b2c1704 commit 3108165
Show file tree
Hide file tree
Showing 16 changed files with 82 additions and 82 deletions.
22 changes: 11 additions & 11 deletions coverage_html.js
Original file line number Diff line number Diff line change
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 d_0f7a0620dddb7237___init___py.html
Original file line number Diff line number Diff line change
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_0f7a0620dddb7237_base_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-07-06 19:28 +0000
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-03-29 20:46 +0000
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand All @@ -91,8 +91,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_0f7a0620dddb7237_base_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-07-06 19:28 +0000
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-03-29 20:46 +0000
</p>
</div>
</footer>
Expand Down
8 changes: 4 additions & 4 deletions d_0f7a0620dddb7237_base_py.html
Original file line number Diff line number Diff line change
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_0f7a0620dddb7237_distlib_manifest_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-07-06 19:28 +0000
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-03-29 20:46 +0000
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -170,8 +170,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_0f7a0620dddb7237_distlib_manifest_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-07-06 19:28 +0000
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-03-29 20:46 +0000
</p>
</div>
</footer>
Expand Down
8 changes: 4 additions & 4 deletions d_0f7a0620dddb7237_distlib_manifest_py.html
Original file line number Diff line number Diff line change
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_4483f565be4bc6ed_cli_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-07-06 19:28 +0000
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-03-29 20:46 +0000
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -137,8 +137,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_4483f565be4bc6ed_cli_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-07-06 19:28 +0000
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-03-29 20:46 +0000
</p>
</div>
</footer>
Expand Down
8 changes: 4 additions & 4 deletions d_4483f565be4bc6ed___init___py.html
Original file line number Diff line number Diff line change
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_a3fda3eac9be077a___init___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-07-06 19:28 +0000
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-03-29 20:46 +0000
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -106,8 +106,8 @@ <h2>
<a id="indexLink" class="nav" href="index.html">&Hat; index</a> &nbsp; &nbsp;
<a id="nextFileLink" class="nav" href="d_a3fda3eac9be077a___init___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-07-06 19:28 +0000
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-03-29 20:46 +0000
</p>
</div>
</footer>
Expand Down
Loading

0 comments on commit 3108165

Please sign in to comment.