src/ngAnimate/animateQueue.js
Function $$AnimateQueueProvider
has a Cognitive Complexity of 224 (exceeds 5 allowed). Consider refactoring. Open
Open
var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animateProvider) {
var PRE_DIGEST_STATE = 1;
var RUNNING_STATE = 2;
var ONE_SPACE = ' ';
- 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 $$AnimateQueueProvider
has 479 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animateProvider) {
var PRE_DIGEST_STATE = 1;
var RUNNING_STATE = 2;
var ONE_SPACE = ' ';
Function $get
has 398 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function($$rAF, $rootScope, $rootElement, $document, $$Map,
$$animation, $$AnimateRunner, $templateRequest, $$jqLite, $$forceReflow,
$$isDocumentHidden) {
var activeAnimationsLookup = new $$Map();
File animateQueue.js
has 483 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
var NG_ANIMATE_ATTR_NAME = 'data-ng-animate';
var NG_ANIMATE_PIN_DATA = '$ngAnimatePin';
var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animateProvider) {
Function queueAnimation
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function queueAnimation(originalElement, event, initialOptions) {
// we always make a copy of the options since
// there should never be any side effects on
// the input data when running `$animateCss`.
var options = copy(initialOptions);
Function areAnimationsAllowed
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function areAnimationsAllowed(node, parentNode, event) {
var bodyNode = $document[0].body;
var rootNode = getDomNode($rootElement);
var bodyNodeDetected = (node === bodyNode) || node.nodeName === 'HTML';
Function $get
has 11 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function($$rAF, $rootScope, $rootElement, $document, $$Map,
$$animation, $$AnimateRunner, $templateRequest, $$jqLite, $$forceReflow,
$$isDocumentHidden) {
Avoid too many return
statements within this function. Open
Open
return existingAnimation.runner;
Avoid too many return
statements within this function. Open
Open
return runner;
Avoid too many return
statements within this function. Open
Open
return runner;
Avoid too many return
statements within this function. Open
Open
return existingAnimation.runner;