Showing 16 of 32 total issues
File angular-credit-cards.js
has 660 lines of code (exceeds 250 allowed). Consider refactoring. Open
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)
Function factory
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
Open
function factory ($parse, $timeout) {
return {
restrict: 'A',
require: ['ngModel', 'ccNumber'],
controller: function () {
- Read upRead up
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
Open
},{"creditcards":9,"function-bind":14}],28:[function(_dereq_,module,exports){
'use strict'
var expiration = _dereq_('creditcards').expiration
var month = expiration.month
Function 29
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"ap":1,"creditcards":9}],29:[function(_dereq_,module,exports){
'use strict'
var card = _dereq_('creditcards').card
var array = _dereq_('cast-array')
Function factory
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function factory ($parse, $timeout) {
return {
restrict: 'A',
require: ['ngModel', 'ccNumber'],
controller: function () {
Function factory
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function factory ($parse, $timeout) {
return {
restrict: 'A',
require: ['ngModel', 'ccNumber'],
controller: function () {
Function compile
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
compile: function ($element, $attributes) {
$attributes.$set('pattern', '[0-9]*')
$attributes.$set('xAutocompletetype', 'cc-number')
return function ($scope, $element, $attributes, controllers) {
Function compile
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
compile: function ($element, $attributes) {
$attributes.$set('pattern', '[0-9]*')
$attributes.$set('xAutocompletetype', 'cc-number')
return function ($scope, $element, $attributes, controllers) {
Function 5
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"xtend/mutable":25}],5:[function(_dereq_,module,exports){
'use strict'
var Type = _dereq_('./type')
Function 1
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function 13
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{}],13:[function(_dereq_,module,exports){
'use strict';
/* eslint no-invalid-this: 1 */
Function 6
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"./type":4}],6:[function(_dereq_,module,exports){
'use strict'
var luhn = _dereq_('fast-luhn')
var types = _dereq_('./types')
Function bind
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function bind(that) {
var target = this;
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
throw new TypeError(ERROR_MESSAGE + target);
}
Function 8
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"./types":10}],8:[function(_dereq_,module,exports){
'use strict'
var isValidMonth = _dereq_('is-valid-month')
var parseIntStrict = _dereq_('parse-int')
Function CcExpController
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function CcExpController ($scope, $element) {
var nullFormCtrl = {
$setValidity: noop
}
var parentForm = $element.inheritedData('$formController') || nullFormCtrl
Function CcExpController
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function CcExpController ($scope, $element) {
var nullFormCtrl = {
$setValidity: noop
}
var parentForm = $element.inheritedData('$formController') || nullFormCtrl