bendrucker/angular-credit-cards

View on GitHub
release/angular-credit-cards.js

Summary

Maintainability
F
2 wks
Test Coverage

File angular-credit-cards.js has 660 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.angularCreditCards = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){
exports = module.exports = ap;
function ap (args, fn) {
    return function () {
        var rest = [].slice.call(arguments)
Severity: Major
Found in release/angular-credit-cards.js - About 1 day to fix

    Function 28 has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    },{"creditcards":9,"function-bind":14}],28:[function(_dereq_,module,exports){
    'use strict'
    
    var expiration = _dereq_('creditcards').expiration
    var month = expiration.month
    Severity: Major
    Found in release/angular-credit-cards.js - About 3 hrs to fix

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

      },{"ap":1,"creditcards":9}],29:[function(_dereq_,module,exports){
      'use strict'
      
      var card = _dereq_('creditcards').card
      var array = _dereq_('cast-array')
      Severity: Major
      Found in release/angular-credit-cards.js - About 3 hrs to fix

        Function factory has 70 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function factory ($parse, $timeout) {
          return {
            restrict: 'A',
            require: ['ngModel', 'ccNumber'],
            controller: function () {
        Severity: Major
        Found in release/angular-credit-cards.js - About 2 hrs to fix

          Function compile has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              compile: function ($element, $attributes) {
                $attributes.$set('pattern', '[0-9]*')
                $attributes.$set('xAutocompletetype', 'cc-number')
          
                return function ($scope, $element, $attributes, controllers) {
          Severity: Major
          Found in release/angular-credit-cards.js - About 2 hrs to fix

            Function 5 has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            },{"xtend/mutable":25}],5:[function(_dereq_,module,exports){
            'use strict'
            
            var Type = _dereq_('./type')
            
            
            Severity: Major
            Found in release/angular-credit-cards.js - About 2 hrs to fix

              Function 1 has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.angularCreditCards = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){
              exports = module.exports = ap;
              function ap (args, fn) {
                  return function () {
                      var rest = [].slice.call(arguments)
              Severity: Minor
              Found in release/angular-credit-cards.js - About 1 hr to fix

                Function 13 has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                },{}],13:[function(_dereq_,module,exports){
                'use strict';
                
                /* eslint no-invalid-this: 1 */
                
                
                Severity: Minor
                Found in release/angular-credit-cards.js - About 1 hr to fix

                  Function 6 has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  },{"./type":4}],6:[function(_dereq_,module,exports){
                  'use strict'
                  
                  var luhn = _dereq_('fast-luhn')
                  var types = _dereq_('./types')
                  Severity: Minor
                  Found in release/angular-credit-cards.js - About 1 hr to fix

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

                    module.exports = function bind(that) {
                        var target = this;
                        if (typeof target !== 'function' || toStr.call(target) !== funcType) {
                            throw new TypeError(ERROR_MESSAGE + target);
                        }
                    Severity: Minor
                    Found in release/angular-credit-cards.js - About 1 hr to fix

                      Function 8 has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      },{"./types":10}],8:[function(_dereq_,module,exports){
                      'use strict'
                      
                      var isValidMonth = _dereq_('is-valid-month')
                      var parseIntStrict = _dereq_('parse-int')
                      Severity: Minor
                      Found in release/angular-credit-cards.js - About 1 hr to fix

                        Function CcExpController has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function CcExpController ($scope, $element) {
                          var nullFormCtrl = {
                            $setValidity: noop
                          }
                          var parentForm = $element.inheritedData('$formController') || nullFormCtrl
                        Severity: Minor
                        Found in release/angular-credit-cards.js - About 1 hr to fix

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

                          function factory ($parse, $timeout) {
                            return {
                              restrict: 'A',
                              require: ['ngModel', 'ccNumber'],
                              controller: function () {
                          Severity: Major
                          Found in release/angular-credit-cards.js and 1 other location - About 4 days to fix
                          src/number.js on lines 10..93

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

                          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

                          exports.year = function ccExpYear () {
                            return {
                              restrict: 'A',
                              require: ['ngModel', '^?ccExp'],
                              compile: function (element, attributes) {
                          Severity: Major
                          Found in release/angular-credit-cards.js and 1 other location - About 1 day to fix
                          src/expiration.js on lines 82..111

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

                          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 CcExpController ($scope, $element) {
                            var nullFormCtrl = {
                              $setValidity: noop
                            }
                            var parentForm = $element.inheritedData('$formController') || nullFormCtrl
                          Severity: Major
                          Found in release/angular-credit-cards.js and 1 other location - About 1 day to fix
                          src/expiration.js on lines 20..52

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

                          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

                          exports.month = function ccExpMonth () {
                            return {
                              restrict: 'A',
                              require: ['ngModel', '^?ccExp'],
                              compile: function (element, attributes) {
                          Severity: Major
                          Found in release/angular-credit-cards.js and 1 other location - About 1 day to fix
                          src/expiration.js on lines 59..80

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

                          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

                          function factory ($parse) {
                            return {
                              restrict: 'A',
                              require: 'ngModel',
                              compile: function (element, attributes) {
                          Severity: Major
                          Found in release/angular-credit-cards.js and 1 other location - About 7 hrs to fix
                          src/cvc.js on lines 9..29

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

                          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

                          module.exports = angular
                            .module('credit-cards', [])
                            .value('creditcards', creditcards)
                            .directive('ccNumber', number)
                            .directive('ccExp', expiration)
                          Severity: Major
                          Found in release/angular-credit-cards.js and 1 other location - About 2 hrs to fix
                          src/index.js on lines 9..17

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

                          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 (var i = 0; i < arguments.length; i++) {
                                  var source = arguments[i]
                          
                                  for (var key in source) {
                                      if (hasOwnProperty.call(source, key)) {
                          Severity: Major
                          Found in release/angular-credit-cards.js and 1 other location - About 2 hrs to fix
                          release/angular-credit-cards.js on lines 598..606

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

                          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 (var i = 1; i < arguments.length; i++) {
                                  var source = arguments[i]
                          
                                  for (var key in source) {
                                      if (hasOwnProperty.call(source, key)) {
                          Severity: Major
                          Found in release/angular-credit-cards.js and 1 other location - About 2 hrs to fix
                          release/angular-credit-cards.js on lines 579..587

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

                          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

                          exports = module.exports = function ccExp () {
                            return {
                              restrict: 'AE',
                              require: 'ccExp',
                              controller: CcExpController,
                          Severity: Major
                          Found in release/angular-credit-cards.js and 1 other location - About 1 hr to fix
                          src/expiration.js on lines 8..17

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

                          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