File Angular.js
has 834 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/* We need to tell ESLint what variables are being exported */
/* exported
angular,
Function copy
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
function copy(source, destination, maxDepth) {
var stackSource = [];
var stackDest = [];
maxDepth = isValidObjectMaxDepth(maxDepth) ? maxDepth : NaN;
- 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 equals
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
function equals(o1, o2) {
if (o1 === o2) return true;
if (o1 === null || o2 === null) return false;
// eslint-disable-next-line no-self-compare
if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
- 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 forEach
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function forEach(obj, iterator, context) {
var key, length;
if (obj) {
if (isFunction(obj)) {
for (key in obj) {
- 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 baseExtend
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
function baseExtend(dst, objs, deep) {
var h = dst.$$hashKey;
for (var i = 0, ii = objs.length; i < ii; ++i) {
var obj = objs[i];
- 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 copy
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
function copy(source, destination, maxDepth) {
var stackSource = [];
var stackDest = [];
maxDepth = isValidObjectMaxDepth(maxDepth) ? maxDepth : NaN;
Function bootstrap
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bootstrap(element, modules, config) {
if (!isObject(config)) config = {};
var defaultConfig = {
strictDi: false
};
Function bindJQuery
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function bindJQuery() {
var originalCleanData;
if (bindJQueryFired) {
return;
- 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 equals
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function equals(o1, o2) {
if (o1 === o2) return true;
if (o1 === null || o2 === null) return false;
// eslint-disable-next-line no-self-compare
if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
Function forEach
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function forEach(obj, iterator, context) {
var key, length;
if (obj) {
if (isFunction(obj)) {
for (key in obj) {
Function bootstrap
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function bootstrap(element, modules, config) {
if (!isObject(config)) config = {};
var defaultConfig = {
strictDi: false
};
- 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 copyType
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function copyType(source) {
switch (toString.call(source)) {
case '[object Int8Array]':
case '[object Int16Array]':
case '[object Int32Array]':
Function allowAutoBootstrap
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function allowAutoBootstrap(document) {
var script = document.currentScript;
if (!script) {
// Support: IE 9-11 only
Function bindJQuery
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bindJQuery() {
var originalCleanData;
if (bindJQueryFired) {
return;
Function baseExtend
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function baseExtend(dst, objs, deep) {
var h = dst.$$hashKey;
for (var i = 0, ii = objs.length; i < ii; ++i) {
var obj = objs[i];
Function copyRecurse
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function copyRecurse(source, destination, maxDepth) {
maxDepth--;
if (maxDepth < 0) {
return '...';
}
Function doBootstrap
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var doBootstrap = function() {
element = jqLite(element);
if (element.injector()) {
var tag = (element[0] === window.document) ? 'document' : startingTag(element);
Function angularInit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function angularInit(element, bootstrap) {
var appElement,
module,
config = {};
Function csp
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var csp = function() {
if (!isDefined(csp.rules)) {
var ngCspElement = (window.document.querySelector('[ng-csp]') ||
Consider simplifying this complex logical expression. Open
if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||
isArray(o2) || isDate(o2) || isRegExp(o2)) return false;
Avoid deeply nested control flow statements. Open
for (key in o2) {
if (!(key in keySet) &&
key.charAt(0) !== '$' &&
isDefined(o2[key]) &&
!isFunction(o2[key])) return false;
Avoid deeply nested control flow statements. Open
if (isPrimitive || key in obj) {
iterator.call(context, obj[key], key, obj);
}
Avoid deeply nested control flow statements. Open
if (source.hasOwnProperty(key)) {
destination[key] = copyElement(source[key], maxDepth);
}
Avoid deeply nested control flow statements. Open
} else if (typeof obj.hasOwnProperty === 'function') {
// Slow path for objects inheriting Object.prototype, hasOwnProperty check needed
for (key in obj) {
if (obj.hasOwnProperty(key)) {
iterator.call(context, obj[key], key, obj);
Avoid deeply nested control flow statements. Open
for (key in obj) {
iterator.call(context, obj[key], key, obj);
}
Avoid deeply nested control flow statements. Open
if (hasOwnProperty.call(source, key)) {
destination[key] = copyElement(source[key], maxDepth);
}
Avoid deeply nested control flow statements. Open
if (!equals(o1[key], o2[key])) return false;
Avoid deeply nested control flow statements. Open
if (!isRegExp(o2)) return false;
Avoid deeply nested control flow statements. Open
for (key in o1) {
if (key.charAt(0) === '$' || isFunction(o1[key])) continue;
if (!equals(o1[key], o2[key])) return false;
keySet[key] = true;
}
Avoid deeply nested control flow statements. Open
if (key !== '__proto__') {
if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {};
baseExtend(dst[key], [src], true);
}
Avoid deeply nested control flow statements. Open
if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||
isArray(o2) || isDate(o2) || isRegExp(o2)) return false;
Function getBlockNodes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getBlockNodes(nodes) {
// TODO(perf): update `nodes` instead of creating a new object?
var node = nodes[0];
var endNode = nodes[nodes.length - 1];
var blockNodes;
- 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 csp
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var csp = function() {
if (!isDefined(csp.rules)) {
var ngCspElement = (window.document.querySelector('[ng-csp]') ||
- 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
Avoid too many return
statements within this function. Open
if (!equals(o1[key], o2[key])) return false;
Avoid too many return
statements within this function. Open
return simpleCompare(o1.getTime(), o2.getTime());
Avoid too many return
statements within this function. Open
if (!isRegExp(o2)) return false;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
if (!equals(o1[key], o2[key])) return false;
Avoid too many return
statements within this function. Open
if (!isDate(o2)) return false;
Avoid too many return
statements within this function. Open
!isFunction(o2[key])) return false;
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return o1.toString() === o2.toString();
Avoid too many return
statements within this function. Open
isArray(o2) || isDate(o2) || isRegExp(o2)) return false;
Function stringify
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function stringify(value) {
if (value == null) { // null || undefined
return '';
}
switch (typeof value) {
- 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 bind
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function bind(self, fn) {
var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
if (isFunction(fn) && !(fn instanceof RegExp)) {
return curryArgs.length
? 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 getter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getter(obj, path, bindFnToScope) {
if (!path) return obj;
var keys = path.split('.');
var key;
var lastInstance = obj;
- 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"