/* eslint-disable max-params Report the `results` if they’re reliably too hard for the `target` age.
777657
function report(file, node, threshold, target, results) {
  var length = results.length
  var index = -1
  var failCount = 0
  var confidence
  var message

  while (++index < length) {
    if (results[index] > target) {
      failCount++
    }
  }

  if (failCount / length >= threshold) {
    confidence = failCount + '/' + length

    message = file.warn(
      'Hard to read sentence (confidence: ' + confidence + ')',
      node,
      source
    )
    message.confidence = confidence
    message.source = source
    message.actual = toString(node)
    message.expected = null
  }
}
482447
function(results, options) {
        console.log('')
        console.log('Passes: ' + results.stats.passes + ' Failures: ' + results.stats.failures)
        each(results.allSuites, function(suite) {
          if (suite.ran) {
            console.group(suite.description)
            each(suite.specs, function(spec){
              var assertionCount = spec.assertions.length + ':'
              if (spec.requiresImplementation())
                console.warn(spec.description)
              else if (spec.passed())
                console.log(assertionCount + ' ' + spec.description)
              else 
                console.error(assertionCount + ' ' + spec.description + ', ' + spec.failure().message)
            })
            console.groupEnd()
          }
        })
      }
964806
function (err, results) {
    err && console.error(err);

    results.forEach(function (result) {
        var failures = result.run.failures;

        console.info(failures.length ? JSON.stringify(failures.failures, null, 2) :
            `${result.collection.name} ran successfully.`);
    });
}
740220
def valid_max_age(number):
    ""
    if isinstance(number, basestring):
        try:
            number = long(number)
        except (ValueError, TypeError):
            return False
    if number >= 0 and number % 1 == 0:
        return True
    return False
745026
function(results) {        
        for(var i = 0; i < results.rows.length; i++) {
            console.log("Result " + (i + 1) + ": ");
            var row = results.rows[i];
            for(var j = 0; j < results.fields.length; j++) {
                var field = results.fields[j];
                var value = row[j];
                
                console.log("  " + field + " = " + value);
            }
        }
    }
1225171
def get_aggregate_check(self, check, age=None):
        
        data = {}
        if age:
            data['max_age'] = age

        result = self._request('GET', '/aggregates/{}'.format(check),
                               data=json.dumps(data))
        return result.json()
1295288
function (value, min, max) {
        value = parseInt(value, 10);
        min = min | 0;
        if (isNaN(value) || value < min) {
            return false;
        }
        if (max && value > max) {
            return false;
        }
        return true;
    }
66216
function getMonthsByYear({ minDate, maxDate, year }) {
  const max = new Date(maxDate);
  const min = new Date(minDate);
  const maxYear = max.getFullYear();
  const minYear = min.getFullYear();
  let arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map((item, index) => ({
    text: index + 1,
    value: index,
  }));
  if (year > minYear && year < maxYear) {
    return arr;
  }
  const maxTime = max.getTime();
  const minTime = min.getTime();
  if (year === maxYear) {
    arr = arr.filter((item) => {
      const date = new Date(year, item.value, 1);
      return date.getTime() < maxTime;
    });
  }
  if (year === minYear) {
    arr = arr.filter((item) => {
      const date = new Date(year, item.value + 1, 0);
      return date.getTime() > minTime;
    });
  }
  return arr;
}
446098
function result (type, error) {
  if (count % 40 === 0) {
    log('\n  ')
  }

  count++
  stats[type]++
  log(SYMBOLS[type] + ' ')

  if (type === 'failure') {
    failures.push(error)
  }
}
551528
function(target, value, tween) {
			var i = value.length,
				a = this.a = [],
				start, end;
			this.target = target;
			this._round = false;
			if (!i) {
				return false;
			}
			while (--i > -1) {
				start = target[i];
				end = value[i];
				if (start !== end) {
					a.push({i:i, s:start, c:end - start});
				}
			}
			return true;
		}
150533
function map( result ) {
  const invalid = !result || result.length < 2;
  return invalid ? null : ( result.slice( 1 ).map( normalizeRegexResult ));
}
1188955
function (err, results) {

        if (!err) {

          self._startup(server);

          if (cb) cb();

        } else {

          for (var errNum in results) {
            if (results.hasOwnProperty(errNum)) {
              if (results[errNum]) {
                console.error('  - ' + results[errNum] + '\n');
              }
            }
          }

          process.exit(1);
        }
      }
609365
function calculateStatsPerRun(results) {
    return results.reduce((stat, result) => {
        stat.errorCount += result.errorCount;
        stat.warningCount += result.warningCount;
        stat.fixableErrorCount += result.fixableErrorCount;
        stat.fixableWarningCount += result.fixableWarningCount;
        return stat;
    }, {
        errorCount: 0,
        warningCount: 0,
        fixableErrorCount: 0,
        fixableWarningCount: 0
    });
}
788111
function hasErrors(results) {
  return  (results.dependencies && results.dependencies.length) ||
          (results.devDependencies && results.devDependencies.length)
}
915806
function calculateMaxValue(precision, scale) {
  const arr = _.fill(Array(precision), '9');

  if (scale) {
    arr.splice(precision - scale, 0, '.');
  }

  return parseFloat(arr.join(''));
}
1121803
function getAllResults() {
    var send_object = {
        "results":  {},
        "numMatches": 0,
        "foundMaximum":  foundMaximum,
        "exceedsMaximum":  exceedsMaximum
    };
    if (!savedSearchObject) {
        return send_object;
    }
    savedSearchObject.startFileIndex = 0;
    savedSearchObject.getAllResults = true;
    return doSearch(savedSearchObject);
}
169885
function passLintResultsThroughReporters(lintResults) {
    const warnings = lintResults
      .reduce((accumulated, res) => accumulated.concat(res.results), []);

    return Promise
      .all(reporters.map(reporter => reporter(warnings)))
      .then(() => lintResults);
  }