src/ngAnimate/animateJs.js
Function $$AnimateJsProvider
has 230 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var $$AnimateJsProvider = ['$animateProvider', /** @this */ function($animateProvider) {
this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',
function($injector, $$AnimateRunner, $$jqLite) {
var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
Function $get
has 227 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function($injector, $$AnimateRunner, $$jqLite) {
var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
// $animateJs(element, 'enter');
return function(element, event, classes, options) {
Function start
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
start: function() {
if (runner) {
return runner;
}
Function packageAnimations
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 $$AnimateJsProvider
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
var $$AnimateJsProvider = ['$animateProvider', /** @this */ function($animateProvider) {
this.$get = ['$injector', '$$AnimateRunner', '$$jqLite',
function($injector, $$AnimateRunner, $$jqLite) {
var applyAnimationClasses = applyAnimationClassesFactory($$jqLite);
- 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
Function executeAnimationFn
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
function groupEventedAnimations(element, event, options, animations, fnName) {
var operations = [];
forEach(animations, function(ani) {
var animation = ani[fnName];
if (!animation) return;
Function groupEventedAnimations
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function groupEventedAnimations(element, event, options, animations, fnName) {
Function packageAnimations
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function packageAnimations(element, event, options, animations, fnName) {
Function executeAnimationFn
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function executeAnimationFn(fn, element, event, options, onDone) {