Showing 2,008 of 4,250 total issues
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 start
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
function start() {
if (animationClosed) return;
if (!node.parentNode) {
close();
return;
Function initializeDirectiveBindings
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initializeDirectiveBindings(scope, attrs, destination, bindings, directive) {
var removeWatchCollection = [];
var initialChanges = {};
var changes;
Function Browser
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Browser(window, document, $log, $sniffer, $$taskTrackerFactory) {
var self = this,
location = window.location,
history = window.history,
setTimeout = window.setTimeout,
Function ngRepeatCompile
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
compile: function ngRepeatCompile($element, $attr) {
var expression = $attr.ngRepeat;
var ngRepeatEndComment = $compile.$$createComment('end ngRepeat', expression);
var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);
Function $$AnimateRunnerFactoryProvider
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
var $$AnimateRunnerFactoryProvider = /** @this */ function() {
this.$get = ['$q', '$sniffer', '$$animateAsyncRun', '$$isDocumentHidden', '$timeout',
function($q, $sniffer, $$animateAsyncRun, $$isDocumentHidden, $timeout) {
var INITIAL_STATE = 0;
Function name
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
Resource[name] = function(a1, a2, a3, a4) {
var params = {}, data, onSuccess, onError;
switch (arguments.length) {
case 4:
Function sendStoredFile
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sendStoredFile(request, response) {
// Request paths will be URI-encoded, so we need to decode them to match the file names in the
// storage bucket. Failing to do so will result in a 404 error from the bucket and `index.html`
// will be returned instead.
// Example of path requiring decoding: `.../input%5Btext%5D.html` --> `.../input[text].html`
Function $get
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
function($q, $sniffer, $$animateAsyncRun, $$isDocumentHidden, $timeout) {
var INITIAL_STATE = 0;
var DONE_PENDING_STATE = 1;
var DONE_COMPLETE_STATE = 2;
Function recurse
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
recurse: function(ast, context, create) {
var left, right, self = this, args;
if (ast.input) {
return this.inputs(ast.input, ast.watchId);
}
Function $get
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
function($rootScope, $browser, $sniffer, $rootElement, $window) {
var $location,
LocationMode,
baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to ''
initialUrl = $browser.url(),
Function createHttpBackend
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {
// TODO(vojta): fix the signature
return function(method, url, post, callback, headers, timeout, withCredentials, responseType, eventHandlers, uploadEventHandlers) {
url = url || $browser.url();
Function $get
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) {
var startSymbolLength = startSymbol.length,
endSymbolLength = endSymbol.length,
escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'),
escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g');
Function $$CoreAnimateQueueProvider
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
var $$CoreAnimateQueueProvider = /** @this */ function() {
var postDigestQueue = new NgMap();
var postDigestElements = [];
this.$get = ['$$AnimateRunner', '$rootScope',
- 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 parseOptionsExpression
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
function parseOptionsExpression(optionsExp, selectElement, scope) {
var match = optionsExp.match(NG_OPTIONS_REGEXP);
if (!(match)) {
throw ngOptionsMinErr('iexp',
Function addSetValidityMethod
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
function addSetValidityMethod(context) {
var clazz = context.clazz,
set = context.set,
unset = context.unset;
- 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 $get
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.$get = ['$injector', '$$sanitizeUri', function($injector, $$sanitizeUri) {
var htmlSanitizer = function htmlSanitizer(html) {
throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');
};
Function sendReq
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
function sendReq(config, reqData) {
var deferred = $q.defer(),
promise = deferred.promise,
cache,
cachedResp,
Function orderByFilter
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
function orderByFilter($parse) {
return function(array, sortPredicate, reverseOrder, compareFn) {
if (array == null) return array;
if (!isArrayLike(array)) {