ourcities/panela-de-pressao

View on GitHub
app/assets/javascripts/lib/jquery.inputmask.js

Summary

Maintainability
F
2 wks
Test Coverage

Function inputmask has 864 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        $.fn.inputmask = function (fn, options) {
            var opts = $.extend(true, {}, $.inputmask.defaults, options);
            var pasteEvent = isInputEventSupported('paste') ? 'paste' : 'input';

            var iphone = navigator.userAgent.match(/iphone/i) != null;
Severity: Major
Found in app/assets/javascripts/lib/jquery.inputmask.js - About 4 days to fix

    Function mask has 455 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                function mask(el) {
                    var $input = $(el);
                    if (!$input.is(":input")) return;
    
                    //correct greedy setting if needed
    Severity: Major
    Found in app/assets/javascripts/lib/jquery.inputmask.js - About 2 days to fix

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

      /**
      * @license Input Mask plugin for jquery
      * http://github.com/RobinHerbots/jquery.inputmask
      * Copyright (c) 2010 - 2012 Robin Herbots
      * Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)
      Severity: Major
      Found in app/assets/javascripts/lib/jquery.inputmask.js - About 2 days to fix

        Function keydownEvent has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                        function keydownEvent(e) {
                            //Safari 5.1.x - modal dialog fires keypress twice workaround
                            skipKeyPressEvent = false;
        
                            var input = this, k = e.keyCode, pos = caret(input);
        Severity: Major
        Found in app/assets/javascripts/lib/jquery.inputmask.js - About 3 hrs to fix

          Consider simplifying this complex logical expression.
          Open

              if ($.fn.inputmask == undefined) {
                  $.inputmask = {
                      //options default
                      defaults: {
                          placeholder: "_",
          Severity: Critical
          Found in app/assets/javascripts/lib/jquery.inputmask.js - About 3 hrs to fix

            Function keypressEvent has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                            function keypressEvent(e) {
                                //Safari 5.1.x - modal dialog fires keypress twice workaround
                                if (skipKeyPressEvent) return false;
                                skipKeyPressEvent = true;
            
            
            Severity: Major
            Found in app/assets/javascripts/lib/jquery.inputmask.js - About 2 hrs to fix

              Function patchValueProperty has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                              function patchValueProperty(npt) {
                                  var valueProperty;
                                  if (Object.getOwnPropertyDescriptor)
                                      valueProperty = Object.getOwnPropertyDescriptor(npt, "value");
                                  if (valueProperty && valueProperty.get) {
              Severity: Major
              Found in app/assets/javascripts/lib/jquery.inputmask.js - About 2 hrs to fix

                Function checkVal has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            function checkVal(input, buffer, clearInvalid, skipRadixHandling) {
                                var isRTL = $(input).data('inputmask')['isRTL'],
                                    inputValue = truncateInput(input._valueGet(), isRTL).split('');
                
                                if (isRTL) { //align inputValue for RTL/numeric input
                Severity: Major
                Found in app/assets/javascripts/lib/jquery.inputmask.js - About 2 hrs to fix

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

                              function getTestingChain() {
                                  var isOptional = false, escaped = false;
                                  var newBlockMarker = false; //indicates wheter the begin/ending of a block should be indicated
                  
                                  return $.map(opts.mask.split(""), function (element, index) {
                  Severity: Minor
                  Found in app/assets/javascripts/lib/jquery.inputmask.js - About 1 hr to fix

                    Function caret has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                function caret(input, begin, end) {
                                    var npt = input.jquery && input.length > 0 ? input[0] : input;
                                    if (typeof begin == 'number') {
                                        end = (typeof end == 'number') ? end : begin;
                                        if (opts.insertMode == false && begin == end) end++; //set visualization for insert/overwrite mode
                    Severity: Minor
                    Found in app/assets/javascripts/lib/jquery.inputmask.js - About 1 hr to fix

                      Function getMaskTemplate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  function getMaskTemplate() {
                                      var escaped = false, outCount = 0;
                                      if (opts.mask.length == 1 && opts.greedy == false) { opts.placeholder = ""; } //hide placeholder with single non-greedy mask
                                      var singleMask = $.map(opts.mask.split(""), function (element, index) {
                                          var outElem = [];
                      Severity: Minor
                      Found in app/assets/javascripts/lib/jquery.inputmask.js - About 1 hr to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                    if ((np = isValid(pos, c, buffer, !clearInvalid)) !== false) {
                                                        if (np !== true) {
                                                            pos = np.pos || pos; //set new position from isValid
                                                            c = np.c || c; //set new char from isValid
                                                        }
                        Severity: Major
                        Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      } else if (c == undefined) break;
                          Severity: Major
                          Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                            if (isRTL) {
                                                                beginPos = shiftR(firstMaskPos, beginPos, getPlaceHolder(beginPos), true);
                                                                beginPos = (opts.numericInput && opts.greedy && k == opts.keyCode.BACKSPACE && buffer[beginPos + 1] == opts.radixPoint) ? beginPos + 1 : seekNext(buffer, beginPos);
                                                            } else beginPos = shiftL(beginPos, maskL);
                            Severity: Major
                            Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                          if (lastMatch == checkPosition) //once outsync the nonmask cannot be the lastmatch
                                                              lastMatch = pos;
                              Severity: Major
                              Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                            if (getPlaceHolder(pos) == buffer[pos] || !isMask(pos))
                                                                tmpBuffer.splice(0, 1);
                                                            else break;
                                Severity: Major
                                Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                              } else if (full !== true) break;
                                  Severity: Major
                                  Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                                    if ((np = isValid(p == maskL || getBufferElement(buffer, p) == opts.radixPoint ? seekPrevious(buffer, p) : p, c, buffer, false)) !== false) {
                                                                        if (np !== true) {
                                                                            p = np.pos || pos; //set new position from isValid
                                                                            c = np.c || c; //set new char from isValid
                                                                        }
                                    Severity: Major
                                    Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                                      if ((np = isValid(p, c, buffer, false)) !== false) {
                                                                          if (np !== true) {
                                                                              p = np.pos || p; //set new position from isValid
                                                                              c = np.c || c; //set new char from isValid
                                                                          }
                                      Severity: Major
                                      Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                        Avoid deeply nested control flow statements.
                                        Open

                                                                            if (Object.getOwnPropertyDescriptor)
                                                                                valueProperty = Object.getOwnPropertyDescriptor(input, "value");
                                        Severity: Major
                                        Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                              if (valueProperty && valueProperty.get) {
                                                                                  if (input._valueGet) {
                                                                                      Object.defineProperty(input, "value", {
                                                                                          get: input._valueGet,
                                                                                          set: input._valueSet
                                          Severity: Major
                                          Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                            if (isOptional == true) //reset newBlockMarker
                                                                                newBlockMarker = false;
                                            Severity: Major
                                            Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                                          if (inputValue[i] == getBufferElement(buffer, pos))
                                                                              break;
                                              Severity: Major
                                              Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                                Avoid deeply nested control flow statements.
                                                Open

                                                                                if (j < getMaskLength() && isValid(i, p, buffer, true) !== false && tests[determineTestPosition(i)].def == tests[determineTestPosition(j)].def) {
                                                                                    setBufferElement(buffer, i, getBufferElement(buffer, j));
                                                                                    setReTargetPlaceHolder(buffer, j); //cleanup next position
                                                                                } else {
                                                                                    if (isMask(i))
                                                Severity: Major
                                                Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                                  Avoid deeply nested control flow statements.
                                                  Open

                                                                                  if (arguments.length == 0) {
                                                                                      var $self = $(this);
                                                                                      if ($self.data('inputmask')) {
                                                                                          if ($self.data('inputmask')['autoUnmask'])
                                                                                              return $self.inputmask('unmaskedvalue');
                                                  Severity: Major
                                                  Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                                    Avoid deeply nested control flow statements.
                                                    Open

                                                                                    if (j < getMaskLength()) {
                                                                                        if (isValid(j, t, buffer, true) !== false && tests[determineTestPosition(i)].def == tests[determineTestPosition(j)].def)
                                                                                            c = t;
                                                                                        else {
                                                                                            if (isMask(j))
                                                    Severity: Major
                                                    Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                                      Avoid deeply nested control flow statements.
                                                      Open

                                                                                      if (opts.numericInput && opts.greedy && k == opts.keyCode.DELETE && buffer[beginPos] == opts.radixPoint) {
                                                                                          beginPos = seekNext(buffer, beginPos);
                                                                                          isRTL = false;
                                                                                      }
                                                      Severity: Major
                                                      Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                                        Avoid deeply nested control flow statements.
                                                        Open

                                                                                    if (getPlaceHolder(pos) == buffer[pos] || !isMask(pos))
                                                                                        tmpBuffer.pop();
                                                                                    else break;
                                                        Severity: Major
                                                        Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                                          Avoid deeply nested control flow statements.
                                                          Open

                                                                                  if (k == opts.keyCode.RIGHT) {//right
                                                                                      var caretPos = pos.begin == pos.end ? pos.end + 1 : pos.end;
                                                                                      caretPos = caretPos < getMaskLength() ? caretPos : pos.end;
                                                                                      caret(input, e.shiftKey ? pos.begin : caretPos, e.shiftKey ? caretPos + 1 : caretPos);
                                                                                      return false;
                                                          Severity: Major
                                                          Found in app/assets/javascripts/lib/jquery.inputmask.js - About 45 mins to fix

                                                            Avoid too many return statements within this function.
                                                            Open

                                                                                        return false;
                                                            Severity: Major
                                                            Found in app/assets/javascripts/lib/jquery.inputmask.js - About 30 mins to fix

                                                              Avoid too many return statements within this function.
                                                              Open

                                                                                      return false;
                                                              Severity: Major
                                                              Found in app/assets/javascripts/lib/jquery.inputmask.js - About 30 mins to fix

                                                                Avoid too many return statements within this function.
                                                                Open

                                                                                        else return "";
                                                                Severity: Major
                                                                Found in app/assets/javascripts/lib/jquery.inputmask.js - About 30 mins to fix

                                                                  Avoid too many return statements within this function.
                                                                  Open

                                                                                          return this.each(function () {
                                                                                              mask(this);
                                                                                          });
                                                                  Severity: Major
                                                                  Found in app/assets/javascripts/lib/jquery.inputmask.js - About 30 mins to fix

                                                                    Avoid too many return statements within this function.
                                                                    Open

                                                                                                return false;
                                                                    Severity: Major
                                                                    Found in app/assets/javascripts/lib/jquery.inputmask.js - About 30 mins to fix

                                                                      Avoid too many return statements within this function.
                                                                      Open

                                                                                      return this.each(function () {
                                                                                          mask(this);
                                                                                      });
                                                                      Severity: Major
                                                                      Found in app/assets/javascripts/lib/jquery.inputmask.js - About 30 mins to fix

                                                                        Avoid too many return statements within this function.
                                                                        Open

                                                                                                    return false;
                                                                        Severity: Major
                                                                        Found in app/assets/javascripts/lib/jquery.inputmask.js - About 30 mins to fix

                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                          Open

                                                                                                          get: function () {
                                                                                                              var $self = $(this), inputData = $(this).data('inputmask');
                                                                                                              return inputData && inputData['autoUnmask'] ? $self.inputmask('unmaskedvalue') : this._valueGet() != inputData['_buffer'].join('') ? this._valueGet() : '';
                                                                                                          },
                                                                          Severity: Major
                                                                          Found in app/assets/javascripts/lib/jquery.inputmask.js and 1 other location - About 3 hrs to fix
                                                                          app/assets/javascripts/lib/jquery.inputmask.js on lines 757..760

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 95.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                          Open

                                                                                                      npt.__defineGetter__("value", function () {
                                                                                                          var $self = $(this), inputData = $(this).data('inputmask');
                                                                                                          return inputData && inputData['autoUnmask'] ? $self.inputmask('unmaskedvalue') : this._valueGet() != inputData['_buffer'].join('') ? this._valueGet() : '';
                                                                                                      });
                                                                          Severity: Major
                                                                          Found in app/assets/javascripts/lib/jquery.inputmask.js and 1 other location - About 3 hrs to fix
                                                                          app/assets/javascripts/lib/jquery.inputmask.js on lines 743..746

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 95.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                          Open

                                                                                              if (!$input.hasClass('focus.inputmask') && opts.showMaskOnHover) {
                                                                                                  var nptL = input._valueGet().length;
                                                                                                  if (nptL == 0) {
                                                                                                      buffer = _buffer.slice();
                                                                                                      writeBuffer(input, buffer);
                                                                          Severity: Major
                                                                          Found in app/assets/javascripts/lib/jquery.inputmask.js and 1 other location - About 2 hrs to fix
                                                                          app/assets/javascripts/lib/jquery.inputmask.js on lines 619..626

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 76.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          Identical blocks of code found in 2 locations. Consider refactoring.
                                                                          Open

                                                                                              if (!$input.hasClass('focus.inputmask') && !opts.showMaskOnHover) {
                                                                                                  var nptL = input._valueGet().length;
                                                                                                  if (nptL == 0) {
                                                                                                      buffer = _buffer.slice();
                                                                                                      writeBuffer(input, buffer);
                                                                          Severity: Major
                                                                          Found in app/assets/javascripts/lib/jquery.inputmask.js and 1 other location - About 2 hrs to fix
                                                                          app/assets/javascripts/lib/jquery.inputmask.js on lines 585..592

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 76.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                          Open

                                                                                                          caret(input, clickPosition > lastPosition && (isValid(clickPosition, buffer[clickPosition], buffer, true) !== false || !isMask(clickPosition)) ? clickPosition : lastPosition);
                                                                          Severity: Minor
                                                                          Found in app/assets/javascripts/lib/jquery.inputmask.js and 1 other location - About 35 mins to fix
                                                                          app/assets/javascripts/lib/jquery.inputmask.js on lines 650..650

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 47.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                          Open

                                                                                                          if (np !== true) {
                                                                                                              pos = np.pos || pos; //set new position from isValid
                                                                                                              c = np.c || c; //set new char from isValid
                                                                                                          }
                                                                          Severity: Minor
                                                                          Found in app/assets/javascripts/lib/jquery.inputmask.js and 2 other locations - About 35 mins to fix
                                                                          app/assets/javascripts/lib/jquery.inputmask.js on lines 969..972
                                                                          app/assets/javascripts/lib/jquery.inputmask.js on lines 1001..1004

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 47.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          Similar blocks of code found in 2 locations. Consider refactoring.
                                                                          Open

                                                                                                          caret(input, clickPosition < lastPosition && (isValid(clickPosition, buffer[clickPosition], buffer, true) !== false || !isMask(clickPosition)) ? clickPosition : lastPosition);
                                                                          Severity: Minor
                                                                          Found in app/assets/javascripts/lib/jquery.inputmask.js and 1 other location - About 35 mins to fix
                                                                          app/assets/javascripts/lib/jquery.inputmask.js on lines 648..648

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 47.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                          Open

                                                                                                              if (np !== true) {
                                                                                                                  p = np.pos || p; //set new position from isValid
                                                                                                                  c = np.c || c; //set new char from isValid
                                                                                                              }
                                                                          Severity: Minor
                                                                          Found in app/assets/javascripts/lib/jquery.inputmask.js and 2 other locations - About 35 mins to fix
                                                                          app/assets/javascripts/lib/jquery.inputmask.js on lines 411..414
                                                                          app/assets/javascripts/lib/jquery.inputmask.js on lines 969..972

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 47.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          Similar blocks of code found in 3 locations. Consider refactoring.
                                                                          Open

                                                                                                              if (np !== true) {
                                                                                                                  p = np.pos || pos; //set new position from isValid
                                                                                                                  c = np.c || c; //set new char from isValid
                                                                                                              }
                                                                          Severity: Minor
                                                                          Found in app/assets/javascripts/lib/jquery.inputmask.js and 2 other locations - About 35 mins to fix
                                                                          app/assets/javascripts/lib/jquery.inputmask.js on lines 411..414
                                                                          app/assets/javascripts/lib/jquery.inputmask.js on lines 1001..1004

                                                                          Duplicated Code

                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                          Tuning

                                                                          This issue has a mass of 47.

                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                          Refactorings

                                                                          Further Reading

                                                                          There are no issues that match your filters.

                                                                          Category
                                                                          Status