angular/angular.js

View on GitHub
src/ngAnimate/animation.js

Summary

Maintainability
F
5 days
Test Coverage

Function $$AnimationProvider has 333 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {
  var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';

  var drivers = this.drivers = [];

Severity: Major
Found in src/ngAnimate/animation.js - About 1 day to fix

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

           function($$jqLite,   $rootScope,   $injector,   $$AnimateRunner,   $$Map,   $$rAFScheduler, $$animateCache) {
    
        var animationQueue = [];
        var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
    
    
    Severity: Major
    Found in src/ngAnimate/animation.js - About 1 day to fix

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

      var $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {
        var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';
      
        var drivers = this.drivers = [];
      
      
      Severity: Minor
      Found in src/ngAnimate/animation.js - About 6 hrs 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

      File animation.js has 335 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      
      /* exported $$AnimationProvider */
      
      var $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {
      Severity: Minor
      Found in src/ngAnimate/animation.js - About 4 hrs to fix

        Function groupAnimations has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              function groupAnimations(animations) {
                var preparedAnimations = [];
                var refLookup = {};
                forEach(animations, function(animation, index) {
                  var element = animation.element;
        Severity: Major
        Found in src/ngAnimate/animation.js - About 2 hrs to fix

          Function sortAnimations has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function sortAnimations(animations) {
                var tree = { children: [] };
                var i, lookup = new $$Map();
          
                // this is done first beforehand so that the map
          Severity: Major
          Found in src/ngAnimate/animation.js - About 2 hrs to fix

            Function flatten has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  function flatten(tree) {
                    var result = [];
                    var queue = [];
                    var i;
            
            
            Severity: Minor
            Found in src/ngAnimate/animation.js - About 1 hr to fix

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

                     function($$jqLite,   $rootScope,   $injector,   $$AnimateRunner,   $$Map,   $$rAFScheduler, $$animateCache) {
              Severity: Major
              Found in src/ngAnimate/animation.js - About 50 mins to fix

                There are no issues that match your filters.

                Category
                Status