将错误等级的字符串转化为排序所用的权重
@param  {String} severity 错误等级
@return {Int}          排序权重
424892
function severity2num (severity) {
	if (!severity) {
		severity = 0;
	} else if (severity === 'error') {
		severity = 1;
	} else if (severity === 'warn') {
		severity = 2;
	} else if (severity === 'info') {
		severity = 3;
	} else {
		severity = 4;
	}
	return severity;
}
1108700
function getValueLength(value, constructed) {
  var lenValue = 0;
  
  if (constructed) {
    for (var i = 0; i < value.length; i++) {
      lenValue = lenValue + value[i].byteLength;
    }
  } else {
    lenValue = value.length;
  }    
  
  return lenValue;
}
1345527
function parameterCount (body, limit) {
  var count = 0
  var index = 0

  while ((index = body.indexOf('&', index)) !== -1) {
    count++
    index++

    if (count === limit) {
      return undefined
    }
  }

  return count
}
309785
function isSafePositiveInteger(x) {
  // https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER
  const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
  // Is it a number?
  return Object.prototype.toString.call(x) === '[object Number]' &&
    // Is it an integer?
    x % 1 === 0 &&
    // Is it positive?
    x > 0 &&
    // Is it less than the maximum safe integer?
    x <= MAX_SAFE_INTEGER;
}
756449
function() {
    var t = tokens.shift()
    var exp

    if (RE_NUMBER.test(t)) {
      exp = {type: 'n', val: t}
    } else {
      exp = parseExpression()
      tokens.shift()
    }
    return exp
  }
948617
function(attr) {
			// Get the numbers
			var arr = this.arr;

			// Go through each of the numbers and find the minimum
			var minimum = attr == null ? arr[0] : arr[0][attr];
			var minimumEl = attr == null ? arr[0] : arr[0];

			stats(arr).each(function(num, index) {
				if ((attr == null ? num : num[attr]) < minimum) {
					minimum = attr == null ? num : num[attr];
					minimumEl = num;
				}
			});

			return minimumEl;
		}
116933
function arity(min, max = Number.MAX_SAFE_INTEGER) {
  return (req, res, next) => {
    const foundArity = parsePath(req).length-1;
    if (foundArity < min ) {
      next(new ModofunError(400, 'InvalidInput',
        `This operation requires ${min} parameters. Received ${foundArity}.`));
    } else if (foundArity > max ) {
      next(new ModofunError(400, 'InvalidInput',
        `This operation doesn't accept more than ${max} parameters. Received ${foundArity}.`));
    } else {
      next();
    }
  }
}
930565
function(ruleConfig) {
			var severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;

			if (typeof severity === "string") {
				severity = severity.toLowerCase();
			}
			return VALID_SEVERITIES.indexOf(severity) !== -1;
		}
742779
function getHookArgumentsLength (fn) {
  if (isUndef(fn)) {
    return false
  }
  var invokerFns = fn.fns;
  if (isDef(invokerFns)) {
    // invoker
    return getHookArgumentsLength(
      Array.isArray(invokerFns)
        ? invokerFns[0]
        : invokerFns
    )
  } else {
    return (fn._length || fn.length) > 1
  }
}
151053
private Integer getStrength(String password)  {
        ScriptEngineManager factory = new ScriptEngineManager();
        ScriptEngine engine = factory.getEngineByName("JavaScript");

        String js = "function getStrength(p) {var stringReverse = function(str) {for (var i = str.length - 1, out = ''; i >= 0; out += str[i--]) {}return out;},matches = {pos: {},neg: {}},counts = {pos: {},neg: {seqLetter: 0,seqNumber: 0,seqSymbol: 0}},tmp,strength = 0,letters = 'abcdefghijklmnopqrstuvwxyz',numbers = '01234567890',symbols = '\\\\!@#$%&/()=?¿',back,forth,i;if (p) {matches.pos.lower = p.match(/[a-z]/g);matches.pos.upper = p.match(/[A-Z]/g);matches.pos.numbers = p.match(/\\d/g);matches.pos.symbols = p.match(/[$-/:-?{-~!^_`\\[\\]]/g);matches.pos.middleNumber = p.slice(1, -1).match(/\\d/g);matches.pos.middleSymbol = p.slice(1, -1).match(/[$-/:-?{-~!^_`\\[\\]]/g);counts.pos.lower = matches.pos.lower ? matches.pos.lower.length : 0;counts.pos.upper = matches.pos.upper ? matches.pos.upper.length : 0;counts.pos.numbers = matches.pos.numbers ? matches.pos.numbers.length : 0;counts.pos.symbols = matches.pos.symbols ? matches.pos.symbols.length : 0;tmp = Object.keys(counts.pos).reduce(function(previous, key) {return previous + Math.min(1, counts.pos[key]);}, 0);counts.pos.numChars = p.length;tmp += (counts.pos.numChars >= 8) ? 1 : 0;counts.pos.requirements = (tmp >= 3) ? tmp : 0;counts.pos.middleNumber = matches.pos.middleNumber ? matches.pos.middleNumber.length : 0;counts.pos.middleSymbol = matches.pos.middleSymbol ? matches.pos.middleSymbol.length : 0;matches.neg.consecLower = p.match(/(?=([a-z]{2}))/g);matches.neg.consecUpper = p.match(/(?=([A-Z]{2}))/g);matches.neg.consecNumbers = p.match(/(?=(\\d{2}))/g);matches.neg.onlyNumbers = p.match(/^[0-9]*$/g);matches.neg.onlyLetters = p.match(/^([a-z]|[A-Z])*$/g);counts.neg.consecLower = matches.neg.consecLower ? matches.neg.consecLower.length : 0;counts.neg.consecUpper = matches.neg.consecUpper ? matches.neg.consecUpper.length : 0;counts.neg.consecNumbers = matches.neg.consecNumbers ? matches.neg.consecNumbers.length : 0;for (i = 0; i < letters.length - 2; i++) {var p2 = p.toLowerCase();forth = letters.substring(i, parseInt(i + 3));back = stringReverse(forth);if (p2.indexOf(forth) !== -1 || p2.indexOf(back) !== -1) {counts.neg.seqLetter++;}}for (i = 0; i < numbers.length - 2; i++) {forth = numbers.substring(i, parseInt(i + 3));back = stringReverse(forth);if (p.indexOf(forth) !== -1 || p.toLowerCase().indexOf(back) !== -1) {counts.neg.seqNumber++;}}for (i = 0; i < symbols.length - 2; i++) {forth = symbols.substring(i, parseInt(i + 3));back = stringReverse(forth);if (p.indexOf(forth) !== -1 || p.toLowerCase().indexOf(back) !== -1) {counts.neg.seqSymbol++;}}var repeats = {};var _p = p.toLowerCase();var arr = _p.split('');counts.neg.repeated = 0;for (i = 0; i < arr.length; i++) {var _reg = new RegExp(_p[i], 'g');var cnt = _p.match(_reg).length;if (cnt > 1 && !repeats[_p[i]]) {repeats[_p[i]] = cnt;counts.neg.repeated += cnt;}}strength += counts.pos.numChars * 4;if (counts.pos.upper) {strength += (counts.pos.numChars - counts.pos.upper) * 2;}if (counts.pos.lower) {strength += (counts.pos.numChars - counts.pos.lower) * 2;}if (counts.pos.upper || counts.pos.lower) {strength += counts.pos.numbers * 4;}strength += counts.pos.symbols * 6;strength += (counts.pos.middleSymbol + counts.pos.middleNumber) * 2;strength += counts.pos.requirements * 2;strength -= counts.neg.consecLower * 2;strength -= counts.neg.consecUpper * 2;strength -= counts.neg.consecNumbers * 2;strength -= counts.neg.seqNumber * 3;strength -= counts.neg.seqLetter * 3;strength -= counts.neg.seqSymbol * 3;if (matches.neg.onlyNumbers) {strength -= counts.pos.numChars;}if (matches.neg.onlyLetters) {strength -= counts.pos.numChars;}if (counts.neg.repeated) {strength -= (counts.neg.repeated / counts.pos.numChars) * 10;}}return Math.max(0, Math.min(100, Math.round(strength)));}";
        js += "var result = getStrength(password);";

        try {
            engine.put("password", password);
            engine.eval(js);
            Double result = (Double) engine.get("result");
            //throw new ScriptException("manally thrown");
            return result.intValue();
        } catch (ScriptException e) {
            logger.error("Javascript-based password validation mechanism failed. Make sure a proper JAVA implementation is used.", e);
            return null;
        }
    }
1319163
function parseLength (parser) {
  const length = parser.buffer.length - 1
  var offset = parser.offset
  var number = 0

  while (offset < length) {
    const c1 = parser.buffer[offset++]
    if (c1 === 13) {
      parser.offset = offset + 1
      return number
    }
    number = (number * 10) + (c1 - 48)
  }
}
988018
function num(elem, prop) {
	return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
}
1132074
function toNumber(value) {
        var _this = this;

        if (validateHelpers.isArray(value)) {
            return value.map(function (a) {
                return _this.toNumber(a);
            });
        }

        var number = parseFloat(value);

        if (number === undefined) {
            return value;
        }

        if (number.toString().length !== value.toString().length && !validateHelpers.isNumeric(value)) {
            return value;
        }

        return validateHelpers.isNumber(number) ? value : number;
    }
772808
public Level getSeverityLevel() {
        Level severity = Level.INFO;
        for (ValidationResultNotation note : notes) {
            Level noteLevel = note.getLevel();
            if (noteLevel.compareTo(severity) > 0) {
                severity = noteLevel;
            }
        }
        return severity;
    }
1254807
function getIntFromBuffer (buffer, start, end) {
  var sum = 0
  var sign = 1

  for (var i = start; i < end; i++) {
    var num = buffer[i]

    if (num < 58 && num >= 48) {
      sum = sum * 10 + (num - 48)
      continue
    }

    if (i === start && num === 43) { // +
      continue
    }

    if (i === start && num === 45) { // -
      sign = -1
      continue
    }

    if (num === 46) { // .
      // its a float. break here.
      break
    }

    throw new Error('not a number: buffer[' + i + '] = ' + num)
  }

  return sum * sign
}
303539
function (aqi) {
    'use strict';
    var level = 0;
    if (aqi >= 0 && aqi <= 50) {
      level = 1;
    } else if (aqi >= 51 && aqi <= 100) {
      level = 2;
    } else if (aqi >= 101 && aqi <= 150) {
      level = 3;
    } else if (aqi >= 151 && aqi <= 200) {
      level = 4;
    } else if (aqi >= 201 && aqi <= 300) {
      level = 5;
    } else if (aqi > 300) {
      level = 6;
    }
    return level;
  }
565079
public SeverityLevel getSeverity() {
        Severity severity = getAnnotation(Severity.class);
        return severity == null ? null : severity.value();
    }