File angular-animate.js
has 2040 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @license AngularJS v1.4.3
* (c) 2010-2015 Google, Inc. http://angularjs.org
* License: MIT
*/
Function $$AnimateQueueProvider
has 411 lines of code (exceeds 25 allowed). Consider refactoring. Open
var $$AnimateQueueProvider = ['$animateProvider', function($animateProvider) {
var PRE_DIGEST_STATE = 1;
var RUNNING_STATE = 2;
var rules = this.rules = {
Function $AnimateCssProvider
has 398 lines of code (exceeds 25 allowed). Consider refactoring. Open
var $AnimateCssProvider = ['$animateProvider', function($animateProvider) {
var gcsLookup = createLocalCacheLookup();
var gcsStaggerLookup = createLocalCacheLookup();
this.$get = ['$window', '$$jqLite', '$$AnimateRunner', '$timeout',
Function $get
has 391 lines of code (exceeds 25 allowed). Consider refactoring. Open
function($window, $$jqLite, $$AnimateRunner, $timeout,
$document, $sniffer, $$rAFScheduler) {
var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
Function $get
has 365 lines of code (exceeds 25 allowed). Consider refactoring. Open
function($$rAF, $rootScope, $rootElement, $document, $$HashMap,
$$animation, $$AnimateRunner, $templateRequest, $$jqLite) {
var activeAnimationsLookup = new $$HashMap();
var disabledElementsLookup = new $$HashMap();
Function init
has 327 lines of code (exceeds 25 allowed). Consider refactoring. Open
function init(element, options) {
var node = getDomNode(element);
if (!node || !node.parentNode) {
return closeAndReturnNoopAnimator();
}
Function $$AnimationProvider
has 254 lines of code (exceeds 25 allowed). Consider refactoring. Open
var $$AnimationProvider = ['$animateProvider', function($animateProvider) {
var NG_ANIMATE_REF_ATTR = 'ng-animate-ref';
var drivers = this.drivers = [];
Function $get
has 239 lines of code (exceeds 25 allowed). Consider refactoring. Open
function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$rAFScheduler) {
var animationQueue = [];
var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
Function $$AnimateJsProvider
has 203 lines of code (exceeds 25 allowed). Consider refactoring. Open
var $$AnimateJsProvider = ['$animateProvider', function($animateProvider) {
this.$get = ['$injector', '$$AnimateRunner', '$$rAFMutex', '$$jqLite',
function($injector, $$AnimateRunner, $$rAFMutex, $$jqLite) {
var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
Function $get
has 200 lines of code (exceeds 25 allowed). Consider refactoring. Open
function($injector, $$AnimateRunner, $$rAFMutex, $$jqLite) {
var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
// $animateJs(element, 'enter');
return function(element, event, classes, options) {
Function $$AnimateCssDriverProvider
has 180 lines of code (exceeds 25 allowed). Consider refactoring. Open
var $$AnimateCssDriverProvider = ['$$animationProvider', function($$animationProvider) {
$$animationProvider.drivers.push('$$animateCssDriver');
var NG_ANIMATE_SHIM_CLASS_NAME = 'ng-animate-shim';
var NG_ANIMATE_ANCHOR_CLASS_NAME = 'ng-anchor';
Function $get
has 172 lines of code (exceeds 25 allowed). Consider refactoring. Open
function($animateCss, $rootScope, $$AnimateRunner, $rootElement, $document, $sniffer) {
// only browsers that support these properties can render animations
if (!$sniffer.animations && !$sniffer.transitions) return noop;
Function queueAnimation
has 155 lines of code (exceeds 25 allowed). Consider refactoring. Open
function queueAnimation(element, event, options) {
var node, parent;
element = stripCommentsFromElement(element);
if (element) {
node = getDomNode(element);
Function start
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
function start() {
if (animationClosed) return;
if (!node.parentNode) {
close();
return;
Function $$AnimateRunnerFactory
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
var $$AnimateRunnerFactory = ['$q', '$$rAFMutex', function($q, $$rAFMutex) {
var INITIAL_STATE = 0;
var DONE_PENDING_STATE = 1;
var DONE_COMPLETE_STATE = 2;
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);
Function triggerAnimationStart
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
function triggerAnimationStart() {
// just incase a stagger animation kicks in when the animation
// itself was cancelled entirely
if (animationClosed) return;
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;
Function $$AnimateJsDriverProvider
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
var $$AnimateJsDriverProvider = ['$$animationProvider', function($$animationProvider) {
$$animationProvider.drivers.push('$$animateJsDriver');
this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {
return function initDriverFn(animationDetails) {
if (animationDetails.from && animationDetails.to) {
Function resolveElementClasses
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resolveElementClasses(existing, toAdd, toRemove) {
var ADD_CLASS = 1;
var REMOVE_CLASS = -1;
var flags = {};
Function areAnimationsAllowed
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function areAnimationsAllowed(element, parentElement, event) {
var bodyElementDetected = false;
var rootElementDetected = false;
var parentAnimationDetected = false;
var animateChildren;
Function $get
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.$get = ['$$animateJs', '$$AnimateRunner', function($$animateJs, $$AnimateRunner) {
return function initDriverFn(animationDetails) {
if (animationDetails.from && animationDetails.to) {
var fromAnimation = prepareAnimation(animationDetails.from);
var toAnimation = prepareAnimation(animationDetails.to);
Function start
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: function() {
var closeActiveAnimations;
var chain = [];
if (before) {
Function prepareFromToAnchorAnimation
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function prepareFromToAnchorAnimation(from, to, classes, anchors) {
var fromAnimation = prepareRegularAnimation(from);
var toAnimation = prepareRegularAnimation(to);
var anchorAnimations = [];
Function $$rAFSchedulerFactory
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
var $$rAFSchedulerFactory = ['$$rAF', function($$rAF) {
var tickQueue = [];
var cancelFn;
function scheduler(tasks) {
Function initDriverFn
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function initDriverFn(animationDetails) {
if (animationDetails.from && animationDetails.to) {
var fromAnimation = prepareAnimation(animationDetails.from);
var toAnimation = prepareAnimation(animationDetails.to);
if (!fromAnimation && !toAnimation) return;
Function packageAnimations
has 32 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') {
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];
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;
Function start
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: function() {
var runner;
var currentAnimation = startingAnimator.start();
currentAnimation.done(function() {
Function $get
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
function($$rAF, $rootScope, $rootElement, $document, $$HashMap,
$$animation, $$AnimateRunner, $templateRequest, $$jqLite) {
Function $get
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function($window, $$jqLite, $$AnimateRunner, $timeout,
$document, $sniffer, $$rAFScheduler) {
Function $get
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function($animateCss, $rootScope, $$AnimateRunner, $rootElement, $document, $sniffer) {
Function $get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function($$jqLite, $rootScope, $injector, $$AnimateRunner, $$rAFScheduler) {
Function executeAnimationFn
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function executeAnimationFn(fn, element, event, options, onDone) {
Function groupEventedAnimations
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function groupEventedAnimations(element, event, options, animations, fnName) {
Function packageAnimations
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function packageAnimations(element, event, options, animations, fnName) {
Avoid too many return
statements within this function. Open
return runner;
Avoid too many return
statements within this function. Open
return existingAnimation.runner;
Avoid too many return
statements within this function. Open
return runner;
Avoid too many return
statements within this function. Open
return runner;
Avoid too many return
statements within this function. Open
return {
$$willAnimate: true,
end: endFn,
start: function() {
if (animationClosed) return;
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (flags.hasTransitions) {
easeProp = TRANSITION_PROP + TIMING_KEY;
temporaryStyles.push([easeProp, easeVal]);
node.style[easeProp] = easeVal;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 51.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (flags.hasAnimations) {
easeProp = ANIMATION_PROP + TIMING_KEY;
temporaryStyles.push([easeProp, easeVal]);
node.style[easeProp] = easeVal;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 51.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
end: function() {
if (this.host.end) {
this.host.end();
}
this._resolve(true);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 50.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
cancel: function() {
if (this.host.cancel) {
this.host.cancel();
}
this._resolve(false);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 50.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
function applyAnimationToStyles(element, options) {
if (options.to) {
element.css(options.to);
options.to = null;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 47.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
function applyAnimationFromStyles(element, options) {
if (options.from) {
element.css(options.from);
options.from = null;
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 47.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76