Skip to content
Permalink
Browse files

Added example fixes.

  • Loading branch information
emeryberger committed Feb 2, 2020
1 parent 6221e08 commit eb0f40914fe27e8ca871d07e35ba32588662c904
Showing with 37 additions and 0 deletions.
  1. +17 −0 src/components/excelint-cli.js
  2. +20 −0 src/components/excelint-cli.ts
@@ -190,6 +190,22 @@ for (var _i = 0, parameters_1 = parameters; _i < parameters_1.length; _i++) {
adjusted_fixes.push([adjusted_score, first, second]);
}
}
// console.log(sheet.formulas);
// console.log(JSON.stringify(adjusted_fixes));
var example_fixes = [];
if (adjusted_fixes.length > 0) {
for (var ind = 0; ind < adjusted_fixes.length; ind++) {
var formulas = [];
for (var i_1 = 0; i_1 < 2; i_1++) {
var formulaCoord = adjusted_fixes[ind][i_1 + 1][0];
var formulaX = formulaCoord[1] - 1;
var formulaY = formulaCoord[0] - 1;
var formula = sheet.formulas[formulaX][formulaY];
formulas.push(formula);
}
example_fixes.push(formulas);
}
}
var elapsed = myTimer.elapsedTime();
if (args.noElapsedTime) {
elapsed = 0; // Dummy value, used for regression testing.
@@ -206,6 +222,7 @@ for (var _i = 0, parameters_1 = parameters; _i < parameters_1.length; _i++) {
'suspiciousnessThreshold': reportingThreshold,
'formattingDiscount': formattingDiscount,
'proposedFixes': adjusted_fixes,
'exampleFixes': example_fixes,
'suspiciousRanges': adjusted_fixes.length,
'weightedSuspiciousRanges': 0,
'suspiciousCells': 0,
@@ -222,6 +222,25 @@ for (let parms of parameters) {
}
}

// console.log(sheet.formulas);
// console.log(JSON.stringify(adjusted_fixes));

let example_fixes = [];

if (adjusted_fixes.length > 0) {
for (let ind = 0; ind < adjusted_fixes.length; ind++) {
let formulas = [];
for (let i = 0; i < 2; i++) {
const formulaCoord = adjusted_fixes[ind][i+1][0];
const formulaX = formulaCoord[1]-1;
const formulaY = formulaCoord[0]-1;
const formula = sheet.formulas[formulaX][formulaY];
formulas.push(formula);
}
example_fixes.push(formulas);
}
}

let elapsed = myTimer.elapsedTime();
if (args.noElapsedTime) {
elapsed = 0; // Dummy value, used for regression testing.
@@ -241,6 +260,7 @@ for (let parms of parameters) {
'suspiciousnessThreshold': reportingThreshold,
'formattingDiscount': formattingDiscount,
'proposedFixes': adjusted_fixes,
'exampleFixes' : example_fixes,
'suspiciousRanges': adjusted_fixes.length,
'weightedSuspiciousRanges' : 0, // actually calculated below.
'suspiciousCells': 0, // actually calculated below.

0 comments on commit eb0f409

Please sign in to comment.
You can’t perform that action at this time.