angular/angular.js

View on GitHub
src/ngAnimate/animateJs.js

Summary

Maintainability
F
3 days
Test Coverage

Function $$AnimateJsProvider has 230 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var $$AnimateJsProvider = ['$animateProvider', /** @this */ function($animateProvider) {
  this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',
       function($injector,   $$AnimateRunner,   $$jqLite) {

    var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
Severity: Major
Found in src/ngAnimate/animateJs.js - About 1 day to fix

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

           function($injector,   $$AnimateRunner,   $$jqLite) {
    
        var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
             // $animateJs(element, 'enter');
        return function(element, event, classes, options) {
    Severity: Major
    Found in src/ngAnimate/animateJs.js - About 1 day to fix

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

              start: function() {
                if (runner) {
                  return runner;
                }
      
      
      Severity: Minor
      Found in src/ngAnimate/animateJs.js - About 1 hr to fix

        Function packageAnimations has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              function packageAnimations(element, event, options, animations, fnName) {
                var operations = groupEventedAnimations(element, event, options, animations, fnName);
                if (operations.length === 0) {
                  var a, b;
                  if (fnName === 'beforeSetClass') {
        Severity: Minor
        Found in src/ngAnimate/animateJs.js - About 1 hr to fix

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

          var $$AnimateJsProvider = ['$animateProvider', /** @this */ function($animateProvider) {
            this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',
                 function($injector,   $$AnimateRunner,   $$jqLite) {
          
              var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
          Severity: Minor
          Found in src/ngAnimate/animateJs.js - About 1 hr 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 executeAnimationFn has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                function executeAnimationFn(fn, element, event, options, onDone) {
                  var args;
                  switch (event) {
                    case 'animate':
                      args = [element, options.from, options.to, onDone];
          Severity: Minor
          Found in src/ngAnimate/animateJs.js - About 1 hr to fix

            Function groupEventedAnimations has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  function groupEventedAnimations(element, event, options, animations, fnName) {
                    var operations = [];
                    forEach(animations, function(ani) {
                      var animation = ani[fnName];
                      if (!animation) return;
            Severity: Minor
            Found in src/ngAnimate/animateJs.js - About 1 hr to fix

              Function groupEventedAnimations has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                    function groupEventedAnimations(element, event, options, animations, fnName) {
              Severity: Minor
              Found in src/ngAnimate/animateJs.js - About 35 mins to fix

                Function packageAnimations has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                      function packageAnimations(element, event, options, animations, fnName) {
                Severity: Minor
                Found in src/ngAnimate/animateJs.js - About 35 mins to fix

                  Function executeAnimationFn has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                        function executeAnimationFn(fn, element, event, options, onDone) {
                  Severity: Minor
                  Found in src/ngAnimate/animateJs.js - About 35 mins to fix

                    There are no issues that match your filters.

                    Category
                    Status