GrafiteInc/Builder

View on GitHub
src/Packages/Billing/resources/assets/js/card.js

Summary

Maintainability
F
1 wk
Test Coverage

File card.js has 1709 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var card =
/******/ (function(modules) { // webpackBootstrap
/******/  // The module cache
/******/  var installedModules = {};

Severity: Major
Found in src/Packages/Billing/resources/assets/js/card.js - About 4 days to fix

    Function extend has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var extend = function extend() {
        var target = arguments[0] || {};
        var i = 1;
        var length = arguments.length;
        var deep = false;
    Severity: Minor
    Found in src/Packages/Billing/resources/assets/js/card.js - About 1 hr to fix

      Function equal has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        is.equal = function equal(value, other) {
          if (value === other) {
            return true;
          }
      
      
      Severity: Minor
      Found in src/Packages/Billing/resources/assets/js/card.js - About 1 hr to fix

        Function render has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Card.prototype.render = function() {
              var $cardContainer, baseWidth, name, obj, selector, ua, _ref, _ref1;
              QJ.append(this.$container, this.template(this.cardTemplate, extend({}, this.options.messages, this.options.placeholders)));
              _ref = this.options.cardSelectors;
              for (name in _ref) {
        Severity: Minor
        Found in src/Packages/Billing/resources/assets/js/card.js - About 1 hr to fix

          Function attachHandlers has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              Card.prototype.attachHandlers = function() {
                var expiryFilters, numberInputFilters;
                numberInputFilters = [this.validToggler('cardNumber')];
                if (this.options.masks.cardNumber) {
                  numberInputFilters.push(this.maskCardNumber);
          Severity: Minor
          Found in src/Packages/Billing/resources/assets/js/card.js - About 1 hr to fix

            Function addStyle has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function addStyle(obj, options) {
                var styleElement, update, remove;
            
                if (options.singleton) {
                  var styleIndex = singletonCounter++;
            Severity: Minor
            Found in src/Packages/Billing/resources/assets/js/card.js - About 1 hr to fix

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

                module.exports = function() {
                  var list = [];
              
                  // return the list of modules as css string
                  list.toString = function toString() {
              Severity: Minor
              Found in src/Packages/Billing/resources/assets/js/card.js - About 1 hr to fix

                Function validateCardExpiry has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        validateCardExpiry: function(month, year) {
                          var currentTime, expiry, prefix, ref, ref1;
                          if (typeof month === 'object' && 'month' in month) {
                            ref = month, month = ref.month, year = ref.year;
                          } else if (typeof month === 'string' && indexOf.call(month, '/') >= 0) {
                Severity: Minor
                Found in src/Packages/Billing/resources/assets/js/card.js - About 1 hr to fix

                  Function validToggler has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      Card.prototype.validToggler = function(validatorName) {
                        var isValid;
                        if (validatorName === "cardExpiry") {
                          isValid = function(val) {
                            var objVal;
                  Severity: Minor
                  Found in src/Packages/Billing/resources/assets/js/card.js - About 1 hr to fix

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

                      module.exports = function(list, options) {
                        if(false) {
                          if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
                        }
                    
                    
                    Severity: Minor
                    Found in src/Packages/Billing/resources/assets/js/card.js - About 1 hr to fix

                      Function on has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          QJ.on = function(element, eventName, callback) {
                            var el, i, j, len, len1, multEventName, originalCallback, ref;
                            if (element.length) {
                              for (i = 0, len = element.length; i < len; i++) {
                                el = element[i];
                      Severity: Minor
                      Found in src/Packages/Billing/resources/assets/js/card.js - About 1 hr to fix

                        Avoid deeply nested control flow statements.
                        Open

                                  } else if (typeof copy !== 'undefined') {
                                    target[name] = copy;
                                  }
                        Severity: Major
                        Found in src/Packages/Billing/resources/assets/js/card.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                      if (copyIsArray) {
                                        copyIsArray = false;
                                        clone = src && is.array(src) ? src : [];
                                      } else {
                                        clone = src && is.hash(src) ? src : {};
                          Severity: Major
                          Found in src/Packages/Billing/resources/assets/js/card.js - About 45 mins to fix

                            Consider simplifying this complex logical expression.
                            Open

                                } else if(obj.sourceMap &&
                                  typeof URL === "function" &&
                                  typeof URL.createObjectURL === "function" &&
                                  typeof URL.revokeObjectURL === "function" &&
                                  typeof Blob === "function" &&
                            Severity: Major
                            Found in src/Packages/Billing/resources/assets/js/card.js - About 40 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return true;
                              Severity: Major
                              Found in src/Packages/Billing/resources/assets/js/card.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return true;
                                Severity: Major
                                Found in src/Packages/Billing/resources/assets/js/card.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                      return false;
                                  Severity: Major
                                  Found in src/Packages/Billing/resources/assets/js/card.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return QJ.val(target, value.replace(/\s\/\s?\d?$/, ''));
                                    Severity: Major
                                    Found in src/Packages/Billing/resources/assets/js/card.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                              return QJ.val(target, value.replace(/\s\d?$/, ''));
                                      Severity: Major
                                      Found in src/Packages/Billing/resources/assets/js/card.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                return e.preventDefault();
                                        Severity: Major
                                        Found in src/Packages/Billing/resources/assets/js/card.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                    return expiry > currentTime;
                                          Severity: Major
                                          Found in src/Packages/Billing/resources/assets/js/card.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                    return QJ.trigger(target, 'change');
                                            Severity: Major
                                            Found in src/Packages/Billing/resources/assets/js/card.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                    return value.prototype === other.prototype;
                                              Severity: Major
                                              Found in src/Packages/Billing/resources/assets/js/card.js - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                        return false;
                                                Severity: Major
                                                Found in src/Packages/Billing/resources/assets/js/card.js - About 30 mins to fix

                                                  Avoid too many return statements within this function.
                                                  Open

                                                        return value.getTime() === other.getTime();
                                                  Severity: Major
                                                  Found in src/Packages/Billing/resources/assets/js/card.js - About 30 mins to fix

                                                    Avoid too many return statements within this function.
                                                    Open

                                                              return false;
                                                    Severity: Major
                                                    Found in src/Packages/Billing/resources/assets/js/card.js - About 30 mins to fix

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

                                                        is.minimum = function (value, others) {
                                                          if (isActualNaN(value)) {
                                                            throw new TypeError('NaN is not a valid value');
                                                          } else if (!is.arraylike(others)) {
                                                            throw new TypeError('second argument must be array-like');
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 3 hrs to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2239..2254

                                                      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 110.

                                                      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

                                                        is.maximum = function (value, others) {
                                                          if (isActualNaN(value)) {
                                                            throw new TypeError('NaN is not a valid value');
                                                          } else if (!is.arraylike(others)) {
                                                            throw new TypeError('second argument must be array-like');
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 3 hrs to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2266..2281

                                                      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 110.

                                                      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 (el.length) {
                                                              return (function() {
                                                                var i, len, results;
                                                                results = [];
                                                                for (i = 0, len = el.length; i < len; i++) {
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 2 other locations - About 3 hrs to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 939..949
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 987..997

                                                      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 107.

                                                      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 (el.length) {
                                                              return (function() {
                                                                var i, len, results;
                                                                results = [];
                                                                for (i = 0, len = el.length; i < len; i++) {
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 2 other locations - About 3 hrs to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 902..912
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 987..997

                                                      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 107.

                                                      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 (el.length) {
                                                              return (function() {
                                                                var i, len, results;
                                                                results = [];
                                                                for (i = 0, len = el.length; i < len; i++) {
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 2 other locations - About 3 hrs to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 902..912
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 939..949

                                                      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 107.

                                                      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

                                                              allTypes = (function() {
                                                                var i, len, results;
                                                                results = [];
                                                                for (i = 0, len = cards.length; i < len; i++) {
                                                                  card = cards[i];
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 3 hrs to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 383..391

                                                      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

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

                                                            outDefaults = (function() {
                                                              var _i, _len, _results;
                                                              _results = [];
                                                              for (_i = 0, _len = out.length; _i < _len; _i++) {
                                                                o = out[_i];
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 3 hrs to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 1437..1445

                                                      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

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

                                                            if (/\d(\s|\/)+$/.test(value)) {
                                                              e.preventDefault();
                                                              return QJ.val(target, value.replace(/\d(\s|\/)*$/, ''));
                                                            } else if (/\s\/\s?\d?$/.test(value)) {
                                                              e.preventDefault();
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 2 hrs to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 1252..1258

                                                      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 93.

                                                      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

                                                            if (/\d\s$/.test(value)) {
                                                              e.preventDefault();
                                                              return QJ.val(target, value.replace(/\d\s$/, ''));
                                                            } else if (/\s\d?$/.test(value)) {
                                                              e.preventDefault();
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 2 hrs to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 1334..1340

                                                      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 93.

                                                      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 4 locations. Consider refactoring.
                                                      Open

                                                        is.ge = function (value, other) {
                                                          if (isActualNaN(value) || isActualNaN(other)) {
                                                            throw new TypeError('NaN is not a valid value');
                                                          }
                                                          return !is.infinite(value) && !is.infinite(other) && value >= other;
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 3 other locations - About 2 hrs to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2349..2354
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2366..2371
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2383..2388

                                                      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 83.

                                                      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 4 locations. Consider refactoring.
                                                      Open

                                                        is.lt = function (value, other) {
                                                          if (isActualNaN(value) || isActualNaN(other)) {
                                                            throw new TypeError('NaN is not a valid value');
                                                          }
                                                          return !is.infinite(value) && !is.infinite(other) && value < other;
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 3 other locations - About 2 hrs to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2332..2337
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2349..2354
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2366..2371

                                                      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 83.

                                                      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 4 locations. Consider refactoring.
                                                      Open

                                                        is.gt = function (value, other) {
                                                          if (isActualNaN(value) || isActualNaN(other)) {
                                                            throw new TypeError('NaN is not a valid value');
                                                          }
                                                          return !is.infinite(value) && !is.infinite(other) && value > other;
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 3 other locations - About 2 hrs to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2332..2337
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2366..2371
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2383..2388

                                                      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 83.

                                                      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 4 locations. Consider refactoring.
                                                      Open

                                                        is.le = function (value, other) {
                                                          if (isActualNaN(value) || isActualNaN(other)) {
                                                            throw new TypeError('NaN is not a valid value');
                                                          }
                                                          return !is.infinite(value) && !is.infinite(other) && value <= other;
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 3 other locations - About 2 hrs to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2332..2337
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2349..2354
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2383..2388

                                                      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 83.

                                                      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

                                                        is.even = function (value) {
                                                          return is.infinite(value) || (is.number(value) && value === value && value % 2 === 0);
                                                        };
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 1 hr to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2318..2320

                                                      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 64.

                                                      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

                                                        is.odd = function (value) {
                                                          return is.infinite(value) || (is.number(value) && value === value && value % 2 !== 0);
                                                        };
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 1 hr to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2305..2307

                                                      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 64.

                                                      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

                                                              for (j = 0, len1 = ref.length; j < len1; j++) {
                                                                multEventName = ref[j];
                                                                QJ.on(element, multEventName, callback);
                                                              }
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 1 hr to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 871..874

                                                      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 56.

                                                      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

                                                              for (i = 0, len = element.length; i < len; i++) {
                                                                el = element[i];
                                                                QJ.on(el, eventName, callback);
                                                              }
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 1 hr to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 879..882

                                                      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 56.

                                                      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

                                                                if (year.length === 2) {
                                                                  prefix = (new Date).getFullYear();
                                                                  prefix = prefix.toString().slice(0, 2);
                                                                  year = prefix + year;
                                                                }
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 1 hr to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 1462..1466

                                                      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 55.

                                                      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

                                                                if ((year != null ? year.length : void 0) === 2 && /^\d+$/.test(year)) {
                                                                  prefix = (new Date).getFullYear();
                                                                  prefix = prefix.toString().slice(0, 2);
                                                                  year = prefix + year;
                                                                }
                                                      Severity: Major
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 1 hr to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 1508..1512

                                                      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 55.

                                                      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

                                                        is.hex = function (value) {
                                                          return is.string(value) && (!value.length || hexRegex.test(value));
                                                        };
                                                      Severity: Minor
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 40 mins to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2504..2506

                                                      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 49.

                                                      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

                                                        is.base64 = function (value) {
                                                          return is.string(value) && (!value.length || base64Regex.test(value));
                                                        };
                                                      Severity: Minor
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 40 mins to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2521..2523

                                                      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 49.

                                                      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

                                                            for (key in other) {
                                                              if (!is.equal(value[key], other[key]) || !(key in value)) {
                                                                return false;
                                                              }
                                                            }
                                                      Severity: Minor
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 40 mins to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 1863..1867

                                                      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 48.

                                                      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

                                                        is.args.empty = function (value) {
                                                          return is.args(value) && value.length === 0;
                                                        };
                                                      Severity: Minor
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 40 mins to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 2010..2012

                                                      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 48.

                                                      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

                                                        is.array.empty = function (value) {
                                                          return is.array(value) && value.length === 0;
                                                        };
                                                      Severity: Minor
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 40 mins to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 1998..2000

                                                      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 48.

                                                      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

                                                            for (key in value) {
                                                              if (!is.equal(value[key], other[key]) || !(key in other)) {
                                                                return false;
                                                              }
                                                            }
                                                      Severity: Minor
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 40 mins to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 1868..1872

                                                      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 48.

                                                      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

                                                        function createStyleElement(options) {
                                                          var styleElement = document.createElement("style");
                                                          styleElement.type = "text/css";
                                                          insertStyleElement(options, styleElement);
                                                          return styleElement;
                                                      Severity: Minor
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 35 mins to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 679..684

                                                      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 46.

                                                      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

                                                        function createLinkElement(options) {
                                                          var linkElement = document.createElement("link");
                                                          linkElement.rel = "stylesheet";
                                                          insertStyleElement(options, linkElement);
                                                          return linkElement;
                                                      Severity: Minor
                                                      Found in src/Packages/Billing/resources/assets/js/card.js and 1 other location - About 35 mins to fix
                                                      src/Packages/Billing/resources/assets/js/card.js on lines 672..677

                                                      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 46.

                                                      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