kuasha/cosmos

View on GitHub
samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js

Summary

Maintainability
F
2 mos
Test Coverage

File effect.js has 994 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * jQuery UI Effects 1.11.0
 * http://jqueryui.com
 *
 * Copyright 2014 jQuery Foundation and other contributors
Severity: Major
Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js - About 2 days to fix

    Function createWrapper has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        createWrapper: function( element ) {
    
            // if the element is already wrapped, return it
            if ( element.parent().is( ".ui-effects-wrapper" )) {
                return element.parent();
    Severity: Major
    Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js - About 2 hrs to fix

      Function parse has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          parse: function( red, green, blue, alpha ) {
              if ( red === undefined ) {
                  this._rgba = [ null, null, null, null ];
                  return this;
              }
      Severity: Major
      Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js - About 2 hrs to fix

        Function animateClass has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        $.effects.animateClass = function( value, duration, easing, callback ) {
            var o = $.speed( duration, easing, callback );
        
            return this.queue( function() {
                var animated = $( this ),
        Severity: Minor
        Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js - About 2 hrs to fix

          Function hook has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          color.hook = function( hook ) {
              var hooks = hook.split( " " );
              each( hooks, function( i, hook ) {
                  jQuery.cssHooks[ hook ] = {
                      set: function( elem, value ) {
          Severity: Minor
          Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js - About 1 hr to fix

            Function effect has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                effect: function( /* effect, options, speed, callback */ ) {
                    var args = _normalizeArguments.apply( this, arguments ),
                        mode = args.mode,
                        queue = args.queue,
                        effectMethod = $.effects.effect[ args.effect ];
            Severity: Minor
            Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js - About 1 hr to fix

              Function _normalizeArguments has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function _normalizeArguments( effect, options, speed, callback ) {
              
                  // allow passing all options as the first parameter
                  if ( $.isPlainObject( effect ) ) {
                      options = effect;
              Severity: Minor
              Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js - About 1 hr to fix

                Function to has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                spaces.hsla.to = function( rgba ) {
                    if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
                        return [ null, null, null, rgba[ 3 ] ];
                    }
                    var r = rgba[ 0 ] / 255,
                Severity: Minor
                Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js - About 1 hr to fix

                  Function transition has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      transition: function( other, distance ) {
                          var end = color( other ),
                              spaceName = end._space(),
                              space = spaces[ spaceName ],
                              startColor = this.alpha() === 0 ? color( "transparent" ) : this,
                  Severity: Minor
                  Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js - About 1 hr to fix

                    Function set has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                set: function( elem, value ) {
                                    var parsed, curElem,
                                        backgroundColor = "";
                    
                                    if ( value !== "transparent" && ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) ) {
                    Severity: Minor
                    Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                                          if ( !support.rgba && value._rgba[ 3 ] !== 1 ) {
                                              curElem = hook === "backgroundColor" ? elem.parentNode : elem;
                                              while (
                                                  (backgroundColor === "" || backgroundColor === "transparent") &&
                                                  curElem && curElem.style
                      Severity: Major
                      Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js - About 40 mins to fix

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

                            switchClass: function( remove, add, speed, easing, callback) {
                        Severity: Minor
                        Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js - About 35 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return false;
                          Severity: Major
                          Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js - About 30 mins to fix

                            Similar blocks of code found in 3 locations. Consider refactoring.
                            Open

                            (function( jQuery, undefined ) {
                            
                                var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",
                            
                                // plusequals test for += 100 -= 100
                            samples/adminpanel/app/bower_components/jquery-ui/jquery-ui.js on lines 13759..14410
                            samples/adminpanel/app/lib/js/jquery-ui.js on lines 4792..5444

                            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 5098.

                            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

                            Further Reading

                            Similar blocks of code found in 3 locations. Consider refactoring.
                            Open

                            (function() {
                            
                            $.extend( $.effects, {
                                version: "1.11.0",
                            
                            
                            samples/adminpanel/app/bower_components/jquery-ui/jquery-ui.js on lines 14620..14960
                            samples/adminpanel/app/lib/js/jquery-ui.js on lines 5656..5997

                            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 2542.

                            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

                            Further Reading

                            Similar blocks of code found in 3 locations. Consider refactoring.
                            Open

                            (function() {
                            
                            var classAnimationActions = [ "add", "remove", "toggle" ],
                                shorthandStyles = {
                                    border: 1,
                            samples/adminpanel/app/bower_components/jquery-ui/jquery-ui.js on lines 14415..14614
                            samples/adminpanel/app/lib/js/jquery-ui.js on lines 5450..5650

                            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 1606.

                            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

                            Further Reading

                            Similar blocks of code found in 3 locations. Consider refactoring.
                            Open

                            (function() {
                            
                            // based on easing equations from Robert Penner (http://www.robertpenner.com/easing)
                            
                            var baseEasings = {};
                            samples/adminpanel/app/bower_components/jquery-ui/jquery-ui.js on lines 14966..15013
                            samples/adminpanel/app/lib/js/jquery-ui.js on lines 6003..6050

                            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 543.

                            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

                            Further Reading

                            Identical blocks of code found in 5 locations. Consider refactoring.
                            Open

                            (function( factory ) {
                                if ( typeof define === "function" && define.amd ) {
                            
                                    // AMD. Register as an anonymous module.
                                    define( [ "jquery" ], factory );
                            Severity: Major
                            Found in samples/adminpanel/app/bower_components/jquery-ui/ui/effect.js and 4 other locations - About 55 mins to fix
                            samples/adminpanel/app/bower_components/jquery-ui/jquery-ui.js on lines 6..16150
                            samples/adminpanel/app/bower_components/jquery-ui/ui/core.js on lines 11..303
                            samples/adminpanel/app/bower_components/jquery-ui/ui/position.js on lines 11..514
                            samples/adminpanel/app/bower_components/jquery-ui/ui/widget.js on lines 11..543

                            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 54.

                            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

                            Further Reading

                            There are no issues that match your filters.

                            Category
                            Status