src/ngAnimate/animation.js
Function $$AnimationProvider
has 333 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {
var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';
var drivers = this.drivers = [];
Function $get
has 317 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$Map, $$rAFScheduler, $$animateCache) {
var animationQueue = [];
var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
Function $$AnimationProvider
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
Open
var $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {
var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';
var drivers = this.drivers = [];
- 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
File animation.js
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
/* exported $$AnimationProvider */
var $$AnimationProvider = ['$animateProvider', /** @this */ function($animateProvider) {
Function groupAnimations
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function groupAnimations(animations) {
var preparedAnimations = [];
var refLookup = {};
forEach(animations, function(animation, index) {
var element = animation.element;
Function sortAnimations
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function sortAnimations(animations) {
var tree = { children: [] };
var i, lookup = new $$Map();
// this is done first beforehand so that the map
Function flatten
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function flatten(tree) {
var result = [];
var queue = [];
var i;
Function $get
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$Map, $$rAFScheduler, $$animateCache) {