File angular-animate.js
has 1105 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @license AngularJS v1.3.5
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
Function performAnimation
has 172 lines of code (exceeds 25 allowed). Consider refactoring. Open
function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, options, doneCallback) {
var noopCancel = noop;
var runner = animationRunner(element, animationEvent, className, options);
if (!runner) {
fireDOMOperation();
Function animationRunner
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
function animationRunner(element, animationEvent, className, options) {
//transcluded directives may sometimes fire an animation using only comment nodes
//best to catch this early on to prevent any animation operations from occurring
var node = element[0];
if (!node) {
Function animateRun
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
function animateRun(animationEvent, element, className, activeAnimationComplete, styles) {
var node = extractElementNode(element);
var elementData = element.data(NG_ANIMATE_CSS_DATA_KEY);
if (node.getAttribute('class').indexOf(className) == -1 || !elementData) {
activeAnimationComplete();
Function setClass
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
setClass: function(element, add, remove, options) {
options = parseAnimateOptions(options);
var STORAGE_KEY = '$$animateClasses';
element = angular.element(element);
Function animateSetup
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
function animateSetup(animationEvent, element, className, styles) {
var structural = ['ng-enter','ng-leave','ng-move'].indexOf(className) >= 0;
var cacheKey = getCacheKey(element);
var eventCacheKey = cacheKey + ' ' + className;
Function run
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function run(fns, cancellations, allCompleteFn) {
var animations = [];
forEach(fns, function(animation) {
animation.fn && animations.push(animation);
});
Function getElementAnimationDetails
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getElementAnimationDetails(element, cacheKey) {
var data = cacheKey ? lookupCache[cacheKey] : null;
if (!data) {
var transitionDuration = 0;
var transitionDelay = 0;
Function animationsDisabled
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function animationsDisabled(element, parentElement) {
if (rootAnimateState.disabled) {
return true;
}
Function closeAnimation
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function closeAnimation() {
if (!closeAnimation.hasBeenRun) {
if (runner) { //the runner doesn't exist if it fails to instantiate
runner.applyStyles();
}
Function resolveElementClasses
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resolveElementClasses(element, cache, runningAnimations) {
runningAnimations = runningAnimations || {};
var lookup = {};
forEach(runningAnimations, function(data, selector) {
Function performAnimation
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, options, doneCallback) {
Function animate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
animate: function(element, className, from, to, animationCompleted, options) {
Function animateRun
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function animateRun(animationEvent, element, className, activeAnimationComplete, styles) {
Function animateAfter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function animateAfter(animationEvent, element, className, afterAnimationComplete, styles) {
Function setClass
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
setClass: function(element, add, remove, animationCompleted, options) {
Function animate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
animate: function(element, from, to, className, options) {
Function animate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function animate(animationEvent, element, className, animationComplete, options) {
Function beforeSetClass
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
beforeSetClass: function(element, add, remove, animationCompleted, options) {
Similar blocks of code found in 2 locations. Consider refactoring. Open
beforeRemoveClass: function(element, className, animationCompleted, options) {
options = options || {};
var cancellationMethod = animateBefore('removeClass', element, suffixClasses(className, '-remove'), options.from);
if (cancellationMethod) {
afterReflow(element, animationCompleted);
- 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 79.
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
beforeAddClass: function(element, className, animationCompleted, options) {
options = options || {};
var cancellationMethod = animateBefore('addClass', element, suffixClasses(className, '-add'), options.from);
if (cancellationMethod) {
afterReflow(element, animationCompleted);
- 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 79.
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
addClass: function(element, className, animationCompleted, options) {
options = options || {};
return animateAfter('addClass', element, suffixClasses(className, '-add'), animationCompleted, options.to);
},
- 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 46.
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
removeClass: function(element, className, animationCompleted, options) {
options = options || {};
return animateAfter('removeClass', element, suffixClasses(className, '-remove'), animationCompleted, options.to);
}
- 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 46.
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
after: function(allCompleteFn) {
afterComplete = allCompleteFn;
run(after, afterCancel, function() {
afterComplete = noop;
allCompleteFn();
- 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 45.
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
before: function(allCompleteFn) {
beforeComplete = allCompleteFn;
run(before, beforeCancel, function() {
beforeComplete = noop;
allCompleteFn();
- 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 45.
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