wikimedia/mediawiki-core

View on GitHub
resources/lib/jquery.ui/jquery.ui.effect.js

Summary

Maintainability
F
6 days
Test Coverage

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

/*!
 * jQuery UI Effects 1.9.2
 * http://jqueryui.com
 *
 * Copyright 2012 jQuery Foundation and other contributors
Severity: Major
Found in resources/lib/jquery.ui/jquery.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 resources/lib/jquery.ui/jquery.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 resources/lib/jquery.ui/jquery.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 resources/lib/jquery.ui/jquery.ui.effect.js - About 2 hrs to fix

          Function effect has 44 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 resources/lib/jquery.ui/jquery.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 resources/lib/jquery.ui/jquery.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 resources/lib/jquery.ui/jquery.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 resources/lib/jquery.ui/jquery.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 ( jQuery.type( value ) !== "string" || ( parsed = stringParse( value ) ) ) {
                  Severity: Minor
                  Found in resources/lib/jquery.ui/jquery.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 resources/lib/jquery.ui/jquery.ui.effect.js - About 40 mins to fix

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

                          toggleClass: function( classNames, force, speed, easing, callback ) {
                      Severity: Minor
                      Found in resources/lib/jquery.ui/jquery.ui.effect.js - About 35 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 resources/lib/jquery.ui/jquery.ui.effect.js - About 35 mins to fix

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

                              hide: function( speed ) {
                                  if ( standardSpeed( speed ) ) {
                                      return this._hide.apply( this, arguments );
                                  } else {
                                      var args = _normalizeArguments.apply( this, arguments );
                          Severity: Major
                          Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 2 hrs to fix
                          resources/lib/jquery.ui/jquery.ui.effect.js on lines 1174..1182

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

                          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 2 locations. Consider refactoring.
                          Open

                              show: function( speed ) {
                                  if ( standardSpeed( speed ) ) {
                                      return this._show.apply( this, arguments );
                                  } else {
                                      var args = _normalizeArguments.apply( this, arguments );
                          Severity: Major
                          Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 2 hrs to fix
                          resources/lib/jquery.ui/jquery.ui.effect.js on lines 1185..1193

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

                          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 2 locations. Consider refactoring.
                          Open

                                  switch ( origin[ 0 ] ) {
                                      case "top": y = 0; break;
                                      case "middle": y = 0.5; break;
                                      case "bottom": y = 1; break;
                                      default: y = origin[ 0 ] / original.height;
                          Severity: Major
                          Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 1 hr to fix
                          resources/lib/jquery.ui/jquery.ui.effect.js on lines 926..931

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

                          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 2 locations. Consider refactoring.
                          Open

                                  switch ( origin[ 1 ] ) {
                                      case "left": x = 0; break;
                                      case "center": x = 0.5; break;
                                      case "right": x = 1; break;
                                      default: x = origin[ 1 ] / original.width;
                          Severity: Major
                          Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 1 hr to fix
                          resources/lib/jquery.ui/jquery.ui.effect.js on lines 920..925

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

                          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 2 locations. Consider refactoring.
                          Open

                                  hsla: {
                                      props: {
                                          hue: {
                                              idx: 0,
                                              type: "degrees"
                          Severity: Major
                          Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 1 hr to fix
                          resources/lib/jquery.ui/jquery.ui.effect.js on lines 96..111

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

                          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 2 locations. Consider refactoring.
                          Open

                                  rgba: {
                                      props: {
                                          red: {
                                              idx: 0,
                                              type: "byte"
                          Severity: Major
                          Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 1 hr to fix
                          resources/lib/jquery.ui/jquery.ui.effect.js on lines 113..128

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

                          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 2 locations. Consider refactoring.
                          Open

                              addClass: function( classNames, speed, easing, callback ) {
                                  return speed ?
                                      $.effects.animateClass.call( this,
                                          { add: classNames }, speed, easing, callback ) :
                                      this._addClass( classNames );
                          Severity: Major
                          Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 1 hr to fix
                          resources/lib/jquery.ui/jquery.ui.effect.js on lines 837..842

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

                          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 2 locations. Consider refactoring.
                          Open

                              removeClass: function( classNames, speed, easing, callback ) {
                                  return speed ?
                                      $.effects.animateClass.call( this,
                                          { remove: classNames }, speed, easing, callback ) :
                                      this._removeClass( classNames );
                          Severity: Major
                          Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 1 hr to fix
                          resources/lib/jquery.ui/jquery.ui.effect.js on lines 829..834

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

                          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 2 locations. Consider refactoring.
                          Open

                              if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) {
                                  return [ null, null, null, rgba[ 3 ] ];
                              }
                          Severity: Minor
                          Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 50 mins to fix
                          resources/lib/jquery.ui/jquery.ui.effect.js on lines 495..497

                          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

                          Further Reading

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

                              if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) {
                                  return [ null, null, null, hsla[ 3 ] ];
                              }
                          Severity: Minor
                          Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 50 mins to fix
                          resources/lib/jquery.ui/jquery.ui.effect.js on lines 460..462

                          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

                          Further Reading

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

                                  if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
                                      $( active ).focus();
                                  }
                          Severity: Minor
                          Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 40 mins to fix
                          resources/lib/jquery.ui/jquery.ui.effect.js on lines 1021..1023

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

                          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 2 locations. Consider refactoring.
                          Open

                                      if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
                                          $( active ).focus();
                                      }
                          Severity: Minor
                          Found in resources/lib/jquery.ui/jquery.ui.effect.js and 1 other location - About 40 mins to fix
                          resources/lib/jquery.ui/jquery.ui.effect.js on lines 980..982

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

                          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