angular/angular.js

View on GitHub
src/ngAnimate/animateQueue.js

Summary

Maintainability
F
1 wk
Test Coverage

Function $$AnimateQueueProvider has a Cognitive Complexity of 224 (exceeds 5 allowed). Consider refactoring.
Open

var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animateProvider) {
  var PRE_DIGEST_STATE = 1;
  var RUNNING_STATE = 2;
  var ONE_SPACE = ' ';

Severity: Minor
Found in src/ngAnimate/animateQueue.js - About 4 days 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 $$AnimateQueueProvider has 479 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animateProvider) {
  var PRE_DIGEST_STATE = 1;
  var RUNNING_STATE = 2;
  var ONE_SPACE = ' ';

Severity: Major
Found in src/ngAnimate/animateQueue.js - About 2 days to fix

    Function $get has 398 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

           function($$rAF,   $rootScope,   $rootElement,   $document,   $$Map,
                    $$animation,   $$AnimateRunner,   $templateRequest,   $$jqLite,   $$forceReflow,
                    $$isDocumentHidden) {
    
        var activeAnimationsLookup = new $$Map();
    Severity: Major
    Found in src/ngAnimate/animateQueue.js - About 1 day to fix

      File animateQueue.js has 483 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      
      var NG_ANIMATE_ATTR_NAME = 'data-ng-animate';
      var NG_ANIMATE_PIN_DATA = '$ngAnimatePin';
      var $$AnimateQueueProvider = ['$animateProvider', /** @this */ function($animateProvider) {
      Severity: Minor
      Found in src/ngAnimate/animateQueue.js - About 7 hrs to fix

        Function queueAnimation has 173 lines of code (exceeds 25 allowed). Consider refactoring.
        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);
        Severity: Major
        Found in src/ngAnimate/animateQueue.js - About 6 hrs to fix

          Function areAnimationsAllowed has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function areAnimationsAllowed(node, parentNode, event) {
                var bodyNode = $document[0].body;
                var rootNode = getDomNode($rootElement);
          
                var bodyNodeDetected = (node === bodyNode) || node.nodeName === 'HTML';
          Severity: Major
          Found in src/ngAnimate/animateQueue.js - About 2 hrs to fix

            Function $get has 11 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                   function($$rAF,   $rootScope,   $rootElement,   $document,   $$Map,
                            $$animation,   $$AnimateRunner,   $templateRequest,   $$jqLite,   $$forceReflow,
                            $$isDocumentHidden) {
            Severity: Major
            Found in src/ngAnimate/animateQueue.js - About 1 hr to fix

              Avoid too many return statements within this function.
              Open

                          return existingAnimation.runner;
              Severity: Major
              Found in src/ngAnimate/animateQueue.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return runner;
                Severity: Major
                Found in src/ngAnimate/animateQueue.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return runner;
                  Severity: Major
                  Found in src/ngAnimate/animateQueue.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                  return existingAnimation.runner;
                    Severity: Major
                    Found in src/ngAnimate/animateQueue.js - About 30 mins to fix

                      There are no issues that match your filters.

                      Category
                      Status