igorescobar/jQuery-Mask-Plugin

View on GitHub

Showing 9 of 9 total issues

Function Mask has 348 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var Mask = function (el, mask, options) {

        var p = {
            invalid: [],
            getCaret: function () {
Severity: Major
Found in src/jquery.mask.js - About 1 day to fix

    File jquery.mask.js has 472 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * jquery.mask.js
     * @version: v1.14.16
     * @author: Igor Escobar
     *
    Severity: Minor
    Found in src/jquery.mask.js - About 7 hrs to fix

      Function getMasked has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  getMasked: function(skipMaskChars, val) {
                      var buf = [],
                          value = val === undefined ? p.val() : val + '',
                          m = 0, maskLen = mask.length,
                          v = 0, valLen = value.length,
      Severity: Major
      Found in src/jquery.mask.js - About 3 hrs to fix

        Function calculateCaretPosition has 51 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    calculateCaretPosition: function(oldVal) {
                        var newVal = p.getMasked(),
                            caretPosNew = p.getCaret();
                        if (oldVal !== newVal) {
                            var caretPosOld = el.data('mask-previus-caret-pos') || 0,
        Severity: Major
        Found in src/jquery.mask.js - About 2 hrs to fix

          Function exports has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function(grunt) {
            require('load-grunt-tasks')(grunt);
            require('time-grunt')(grunt);
          
            grunt.initConfig({
          Severity: Minor
          Found in Gruntfile.js - About 1 hr to fix

            Function events has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        events: function() {
                            el
                            .on('keydown.mask', function(e) {
                                el.data('mask-keycode', e.keyCode || e.which);
                                el.data('mask-previus-value', el.val());
            Severity: Minor
            Found in src/jquery.mask.js - About 1 hr to fix

              Function init has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                     jMask.init = function(onlyMask) {
                          onlyMask = onlyMask || false;
                          options = options || {};
              
                          jMask.clearIfNotMatch  = $.jMaskGlobals.clearIfNotMatch;
              Severity: Minor
              Found in src/jquery.mask.js - About 1 hr to fix

                Avoid deeply nested control flow statements.
                Open

                                                if (lastMaskChar === resetPos) {
                                                    m -= offset;
                                                }
                Severity: Major
                Found in src/jquery.mask.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                  if (resetPos === -1) {
                                                      resetPos = m;
                                                  } else if (m === lastMaskChar && m !== resetPos) {
                                                      m = resetPos - offset;
                                                  }
                  Severity: Major
                  Found in src/jquery.mask.js - About 45 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language