CaffGeek/MBACNationals

View on GitHub
Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js

Summary

Maintainability
F
1 wk
Test Coverage

File effects.js has 1016 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// script.aculo.us effects.js v1.8.0, Tue Nov 06 15:01:40 +0300 2007

// Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
// Contributors:
//  Justin Palmer (http://encytemedia.com/)
Severity: Major
Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 2 days to fix

    Function Grow has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Effect.Grow = function(element) {
      element = $(element);
      var options = Object.extend({
        direction: 'center',
        moveTransition: Effect.Transitions.sinoidal,
    Severity: Major
    Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 2 hrs to fix

      Function setDimensions has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

        setDimensions: function(height, width) {
          var d = { };
          if (this.options.scaleX) d.width = width.round() + 'px';
          if (this.options.scaleY) d.height = height.round() + 'px';
          if (this.options.scaleFromCenter) {
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 2 hrs to fix

      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 setup has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

        setup: function(){
          function parseColor(color){
            if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
            color = color.parseColor();
            return $R(0,2).map(function(i){
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 2 hrs to fix

      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 parseColor has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

      String.prototype.parseColor = function() {  
        var color = '#';
        if (this.slice(0,4) == 'rgb(') {  
          var cols = this.slice(4,this.length-1).split(',');  
          var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);  
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 2 hrs to fix

      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 Shrink has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Effect.Shrink = function(element) {
        element = $(element);
        var options = Object.extend({
          direction: 'center',
          moveTransition: Effect.Transitions.sinoidal,
      Severity: Minor
      Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 1 hr to fix

        Function setup has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          setup: function(){
            function parseColor(color){
              if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
              color = color.parseColor();
              return $R(0,2).map(function(i){
        Severity: Minor
        Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 1 hr to fix

          Function start has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            start: function(options) {
              function codeForEvent(options,eventName){
                return (
                  (options[eventName+'Internal'] ? 'this.options.'+eventName+'Internal(this);' : '') +
                  (options[eventName] ? 'this.options.'+eventName+'(this);' : '')
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 1 hr to fix

          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 start has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            start: function(options) {
              function codeForEvent(options,eventName){
                return (
                  (options[eventName+'Internal'] ? 'this.options.'+eventName+'Internal(this);' : '') +
                  (options[eventName] ? 'this.options.'+eventName+'(this);' : '')
          Severity: Minor
          Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 1 hr to fix

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

              initialize: function(element) {
                this.element = $(element);
                if (!this.element) throw(Effect._elementDoesNotExistError);
                var options = Object.extend({
                  style: { }
            Severity: Minor
            Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 1 hr to fix

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

              Effect.SlideUp = function(element) {
                element = $(element).cleanWhitespace();
                var oldInnerBottom = element.down().getStyle('bottom');
                var elementDimensions = element.getDimensions();
                return new Effect.Scale(element, window.opera ? 0 : 1,
              Severity: Minor
              Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 1 hr to fix

                Function loop has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  loop: function(timePos) {
                    if (timePos >= this.startOn) {
                      if (timePos >= this.finishOn) {
                        this.render(1.0);
                        this.cancel();
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 45 mins to fix

                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 collectTextNodesIgnoreClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                Element.collectTextNodesIgnoreClass = function(element, className) {  
                  return $A($(element).childNodes).collect( function(node) {
                    return (node.nodeType==3 ? node.nodeValue : 
                      ((node.hasChildNodes() && !Element.hasClassName(node,className)) ? 
                        Element.collectTextNodesIgnoreClass(node, className) : ''));
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 25 mins to fix

                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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  initialize: function(element) {
                    this.element = $(element);
                    if (!this.element) throw(Effect._elementDoesNotExistError);
                    var options = Object.extend({
                      style: { }
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 25 mins to fix

                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 update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                  update: function(position) {
                    var style = { }, transform, i = this.transforms.length;
                    while(i--)
                      style[(transform = this.transforms[i]).style] = 
                        transform.unit=='color' ? '#'+
                Severity: Minor
                Found in Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js - About 25 mins to fix

                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

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

                  var oldStyle = {
                    top: element.style.top,
                    left: element.style.left,
                    height: element.style.height,
                    width: element.style.width,
                Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js on lines 834..839

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

                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

                  var oldStyle = {
                    top: element.style.top,
                    left: element.style.left,
                    height: element.style.height,
                    width: element.style.width,
                Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js on lines 760..765

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

                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 (!this.options.sync)
                      Effect.Queues.get(Object.isString(this.options.queue) ? 
                        'global' : this.options.queue.scope).add(this);
                Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js on lines 291..293

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

                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 (!this.options.sync)
                      Effect.Queues.get(Object.isString(this.options.queue) ? 
                        'global' : this.options.queue.scope).remove(this);
                Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js on lines 268..270

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

                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

                  var options = Object.extend({
                    direction: 'center',
                    moveTransition: Effect.Transitions.sinoidal,
                    scaleTransition: Effect.Transitions.sinoidal,
                    opacityTransition: Effect.Transitions.none
                Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js on lines 754..759

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

                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

                  var options = Object.extend({
                    direction: 'center',
                    moveTransition: Effect.Transitions.sinoidal,
                    scaleTransition: Effect.Transitions.sinoidal,
                    opacityTransition: Effect.Transitions.full
                Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js on lines 828..833

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

                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

                    afterUpdateInternal: function(effect) {
                      effect.element.down().setStyle({bottom:
                        (effect.dims[0] - effect.element.clientHeight) + 'px' });
                    },
                Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js on lines 699..702

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

                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

                    afterUpdateInternal: function(effect) {
                      effect.element.down().setStyle({bottom:
                        (effect.dims[0] - effect.element.clientHeight) + 'px' }); 
                    },
                Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js on lines 727..730

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

                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

                        transform.unit=='color' ? '#'+
                          (Math.round(transform.originalValue[0]+
                            (transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() +
                Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js on lines 990..994
                Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js on lines 990..996

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

                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

                             afterFinishInternal: function(effect) {
                               effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle); 
                             }
                Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js on lines 649..651

                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

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

                        afterFinishInternal: function(effect) {
                          effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);
                        } 
                Web.Admin/2014/wordpress/wp-includes/js/scriptaculous/effects.js on lines 817..819

                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