1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-18 14:26:40 +02:00

Lowered max-statements and complexity values in .eslintrc

This commit is contained in:
Max Guglielmi 2017-01-15 16:29:50 +11:00
parent 77e606cf12
commit c773927945
2 changed files with 10 additions and 11 deletions

View file

@ -11,8 +11,8 @@
"array-bracket-spacing": 2, "array-bracket-spacing": 2,
"keyword-spacing": ["error", { "after": true, "before": true }], "keyword-spacing": ["error", { "after": true, "before": true }],
"max-depth": [2, 7], "max-depth": [2, 7],
"max-statements": [2, 150], "max-statements": [2, 144],
"complexity": [2, 83], "complexity": [2, 78],
"no-unused-vars": 2, "no-unused-vars": 2,
"no-eval": 2, "no-eval": 2,
"no-underscore-dangle": 0, "no-underscore-dangle": 0,

View file

@ -149,17 +149,15 @@ export default class ColOps extends Feature {
2 : this.decimalPrecisions; 2 : this.decimalPrecisions;
//nuovella: determine unique list of columns to operate on //nuovella: determine unique list of columns to operate on
let uIndexes = [], let uIndexes = [];
nbCols = 0;
colIndexes.forEach((val) => { colIndexes.forEach((val) => {
if (uIndexes.indexOf(val) === -1) { if (uIndexes.indexOf(val) === -1) {
uIndexes.push(val); uIndexes.push(val);
} }
}); });
nbCols = uIndexes.length - 1;
let rows = tf.tbl.rows, let nbCols = uIndexes.length - 1,
rows = tf.tbl.rows,
colValues = []; colValues = [];
for (let u = 0; u <= nbCols; u++) { for (let u = 0; u <= nbCols; u++) {
@ -178,22 +176,21 @@ export default class ColOps extends Feature {
precisions = [], precisions = [],
labels = [], labels = [],
writeType, writeType,
idx = -1; idx = 0;
for (let k = 0; k < colIndexes.length; k++) { for (let k = 0; k < colIndexes.length; k++) {
if (colIndexes[k] !== uIndexes[u]) { if (colIndexes[k] !== uIndexes[u]) {
continue; continue;
} }
idx++;
operations[idx] = colOperations[k].toLowerCase(); operations[idx] = colOperations[k].toLowerCase();
precisions[idx] = decimalPrecisions[k]; precisions[idx] = decimalPrecisions[k];
labels[idx] = this.labelIds[k]; labels[idx] = this.labelIds[k];
writeType = isArray(outputTypes) ? outputTypes[k] : null; writeType = isArray(outputTypes) ? outputTypes[k] : null;
idx++;
} }
for (let i = 0; i <= idx; i++) { for (let i = 0; i <= idx; i++) {
// emit values before column calculation
this.emitter.emit( this.emitter.emit(
'before-column-calc', 'before-column-calc',
tf, tf,
@ -206,6 +203,7 @@ export default class ColOps extends Feature {
result = Number(this.calc(curValues, operations[i], null)); result = Number(this.calc(curValues, operations[i], null));
// emit column calculation result
this.emitter.emit( this.emitter.emit(
'column-calc', 'column-calc',
tf, tf,
@ -216,6 +214,7 @@ export default class ColOps extends Feature {
precisions[i] precisions[i]
); );
// write result in expected DOM element
this.writeResult( this.writeResult(
result, result,
labels[i], labels[i],