bendrucker/angular-credit-cards

View on GitHub

Showing 16 of 32 total issues

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 factory has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    function factory ($parse, $timeout) {
      return {
        restrict: 'A',
        require: ['ngModel', 'ccNumber'],
        controller: function () {
    Severity: Minor
    Found in src/number.js - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    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 src/number.js - About 2 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 src/number.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 src/expiration.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
                                Severity
                                Category
                                Status
                                Source
                                Language