angular/angular.js

View on GitHub
src/ngAnimate/animateCssDriver.js

Summary

Maintainability
F
3 days
Test Coverage

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

var $$AnimateCssDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) {
  $$animationProvider.drivers.push('$$animateCssDriver');

  var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';
  var NG_ANIMATE_ANCHOR_CLASS_NAME = 'ng-anchor';
Severity: Minor
Found in src/ngAnimate/animateCssDriver.js - About 1 day 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 $$AnimateCssDriverProvider has 187 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var $$AnimateCssDriverProvider = ['$$animationProvider', /** @this */ function($$animationProvider) {
  $$animationProvider.drivers.push('$$animateCssDriver');

  var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';
  var NG_ANIMATE_ANCHOR_CLASS_NAME = 'ng-anchor';
Severity: Major
Found in src/ngAnimate/animateCssDriver.js - About 7 hrs to fix

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

           function($animateCss,   $rootScope,   $$AnimateRunner,   $rootElement,   $sniffer,   $$jqLite,   $document) {
    
        // only browsers that support these properties can render animations
        if (!$sniffer.animations && !$sniffer.transitions) return noop;
    
    
    Severity: Major
    Found in src/ngAnimate/animateCssDriver.js - About 7 hrs to fix

      Function prepareAnchoredAnimation has 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function prepareAnchoredAnimation(classes, outAnchor, inAnchor) {
            var clone = jqLite(getDomNode(outAnchor).cloneNode(true));
            var startingClasses = filterCssClasses(getClassVal(clone));
      
            outAnchor.addClass(NG_ANIMATE_SHIM_CLASS_NAME);
      Severity: Major
      Found in src/ngAnimate/animateCssDriver.js - About 3 hrs to fix

        Function prepareFromToAnchorAnimation has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function prepareFromToAnchorAnimation(from, to, classes, anchors) {
              var fromAnimation = prepareRegularAnimation(from, noop);
              var toAnimation = prepareRegularAnimation(to, noop);
        
              var anchorAnimations = [];
        Severity: Minor
        Found in src/ngAnimate/animateCssDriver.js - About 1 hr to fix

          Function start has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  start: function() {
                    var runner;
          
                    var currentAnimation = startingAnimator.start();
                    currentAnimation.done(function() {
          Severity: Minor
          Found in src/ngAnimate/animateCssDriver.js - About 1 hr to fix

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

                   function($animateCss,   $rootScope,   $$AnimateRunner,   $rootElement,   $sniffer,   $$jqLite,   $document) {
            Severity: Major
            Found in src/ngAnimate/animateCssDriver.js - About 50 mins to fix

              There are no issues that match your filters.

              Category
              Status