Skip to content

Commit

Permalink
Added weighted suspicious cells.
Browse files Browse the repository at this point in the history
  • Loading branch information
emeryberger committed Jan 15, 2020
1 parent 58ca05c commit 6221e08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/excelint-cli.js
Expand Up @@ -207,6 +207,7 @@ for (var _i = 0, parameters_1 = parameters; _i < parameters_1.length; _i++) {
'formattingDiscount': formattingDiscount,
'proposedFixes': adjusted_fixes,
'suspiciousRanges': adjusted_fixes.length,
'weightedSuspiciousRanges': 0,
'suspiciousCells': 0,
'elapsedTimeSeconds': elapsed / 1e6,
'columns': columns,
Expand All @@ -229,6 +230,8 @@ for (var _i = 0, parameters_1 = parameters; _i < parameters_1.length; _i++) {
var foundBugsArray = Array.from(new Set(foundBugs.flat(1).map(JSON.stringify)));
foundBugs = foundBugsArray.map(JSON.parse);
out['suspiciousCells'] = foundBugs.length;
var weightedSuspiciousRanges = out['proposedFixes'].map(function (x) { return x[0]; }).reduce(function (x, y) { return x + y; }, 0);
out['weightedSuspiciousRanges'] = weightedSuspiciousRanges;
if (workbookBasename in bugs) {
if (sheet.sheetName in bugs[workbookBasename]) {
var trueBugs = bugs[workbookBasename][sheet.sheetName]['bugs'];
Expand Down
3 changes: 3 additions & 0 deletions src/components/excelint-cli.ts
Expand Up @@ -242,6 +242,7 @@ for (let parms of parameters) {
'formattingDiscount': formattingDiscount,
'proposedFixes': adjusted_fixes,
'suspiciousRanges': adjusted_fixes.length,
'weightedSuspiciousRanges' : 0, // actually calculated below.
'suspiciousCells': 0, // actually calculated below.
'elapsedTimeSeconds': elapsed / 1e6,
'columns': columns,
Expand All @@ -264,6 +265,8 @@ for (let parms of parameters) {
const foundBugsArray: any = Array.from(new Set(foundBugs.flat(1).map(JSON.stringify)));
foundBugs = foundBugsArray.map(JSON.parse);
out['suspiciousCells'] = foundBugs.length;
let weightedSuspiciousRanges = out['proposedFixes'].map(x => x[0]).reduce((x, y) => x + y, 0);
out['weightedSuspiciousRanges'] = weightedSuspiciousRanges;
if (workbookBasename in bugs) {
if (sheet.sheetName in bugs[workbookBasename]) {
const trueBugs = bugs[workbookBasename][sheet.sheetName]['bugs'];
Expand Down

0 comments on commit 6221e08

Please sign in to comment.