Showing 5 of 5 total issues
Function exports
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(grunt) {
var config = {
// Clean folders ================================
Function toMoney
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
VMasker.toMoney = function(value, opts) {
opts = mergeMoneyOptions(opts);
if (opts.zeroCents) {
opts.lastOutput = opts.lastOutput || "";
var zeroMatcher = ("("+ opts.separator +"[0]{0,"+ opts.precision +"})"),
Function toPattern
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
VMasker.toPattern = function(value, opts) {
var pattern = (typeof opts === 'object' ? opts.pattern : opts),
patternChars = pattern.replace(/\W/g, ''),
output = pattern.split(""),
values = value.toString().replace(/\W/g, ""),
Consider simplifying this complex logical expression. Open
Open
if ((output[i] === DIGIT && values[index].match(/[0-9]/)) ||
(output[i] === ALPHA && values[index].match(/[a-zA-Z]/)) ||
(output[i] === ALPHANUM && values[index].match(/[0-9a-zA-Z]/))) {
output[i] = values[index++];
} else if (output[i] === DIGIT || output[i] === ALPHA || output[i] === ALPHANUM) {
Avoid too many return
statements within this function. Open
Open
return output.join("").substr(0, i);