Floppy/carbon-diet

View on GitHub

Showing 292 of 292 total issues

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

      do {
        valueT += element.offsetTop  || 0;
        valueL += element.offsetLeft || 0;
        element = element.offsetParent;
      } while (element);
Severity: Minor
Found in app/assets/javascripts/standard/prototype.js and 1 other location - About 40 mins to fix
app/assets/javascripts/standard/prototype.js on lines 3694..3698

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

    do {
      valueT += element.scrollTop  || 0;
      valueL += element.scrollLeft || 0;
      element = element.parentNode;
    } while (element);
Severity: Minor
Found in app/assets/javascripts/standard/prototype.js and 1 other location - About 40 mins to fix
app/assets/javascripts/standard/prototype.js on lines 3662..3666

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);
        }
Severity: Minor
Found in app/assets/javascripts/standard/effects.js and 1 other location - About 40 mins to fix
app/assets/javascripts/standard/effects.js on lines 816..818

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.undoClipping().undoPositioned().setStyle(oldStyle);
             }
Severity: Minor
Found in app/assets/javascripts/standard/effects.js and 1 other location - About 40 mins to fix
app/assets/javascripts/standard/effects.js on lines 648..650

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

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

        PSEUDO: function(match, curLoop, inplace, result, not){
Severity: Minor
Found in app/assets/javascripts/standard/prototype.js - About 35 mins to fix

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

        showPageByHref: function(href, args, method, replace, cb)
    Severity: Minor
    Found in public/iui/iui.js - About 35 mins to fix

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

            function(init, element, eventName, selector, callback) {
      Severity: Minor
      Found in app/assets/javascripts/rails.js - About 35 mins to fix

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

            showPageByHrefExt: function(href, args, method, replace, cb)
        Severity: Minor
        Found in public/iui/iui.js - About 35 mins to fix

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

          function slide1(fromPage, toPage, backwards, axis, cb)
          Severity: Minor
          Found in public/iui/iui.js - About 35 mins to fix

            Method wml_select has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def wml_select(name, values, default=nil, value_func = nil, value_text = nil)
            Severity: Minor
            Found in app/helpers/wml_helper.rb - About 35 mins to fix

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

                  if (options.setLeft)   element.style.left  = (p[0] - delta[0] + options.offsetLeft) + 'px';
              Severity: Minor
              Found in app/assets/javascripts/standard/prototype.js and 1 other location - About 35 mins to fix
              app/assets/javascripts/standard/prototype.js on lines 2438..2438

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

              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 (options.setTop)    element.style.top   = (p[1] - delta[1] + options.offsetTop) + 'px';
              Severity: Minor
              Found in app/assets/javascripts/standard/prototype.js and 1 other location - About 35 mins to fix
              app/assets/javascripts/standard/prototype.js on lines 2437..2437

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

              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

                  for (var i = 0, length = elements.length; i < length; i++) {
                    Element.extend(elements[i]);
                  }
              Severity: Minor
              Found in app/assets/javascripts/standard/prototype.js and 1 other location - About 35 mins to fix
              app/assets/javascripts/standard/prototype.js on lines 4583..4585

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

              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

                              for ( var i = 0, l = array.length; i < l; i++ ) {
                                  ret.push( array[i] );
                              }
              Severity: Minor
              Found in app/assets/javascripts/standard/prototype.js and 1 other location - About 35 mins to fix
              app/assets/javascripts/standard/prototype.js on lines 3879..3881

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

              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_for_droppable = {
                    overlap:     options.overlap,
                    containment: options.containment,
                    tree:        options.tree,
                    hoverclass:  options.hoverclass,
              Severity: Minor
              Found in app/assets/javascripts/standard/dragdrop.js and 1 other location - About 35 mins to fix
              app/assets/javascripts/standard/dragdrop.js on lines 871..877

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

              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({
                    tag: sortableOptions.tag,
                    treeTag: sortableOptions.treeTag,
                    only: sortableOptions.only,
                    name: element.id,
              Severity: Minor
              Found in app/assets/javascripts/standard/dragdrop.js and 1 other location - About 35 mins to fix
              app/assets/javascripts/standard/dragdrop.js on lines 688..694

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

              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

              Function request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                request: function(form, options) {
                  form = $(form), options = Object.clone(options || { });
              
                  var params = options.parameters, action = form.readAttribute('action') || '';
                  if (action.blank()) action = window.location.href;
              Severity: Minor
              Found in app/assets/javascripts/standard/prototype.js - About 35 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 baseInitialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                baseInitialize: function(element, update, options) {
                  element          = $(element);
                  this.element     = element;
                  this.update      = $(update);
                  this.hasFocus    = false;
              Severity: Minor
              Found in app/assets/javascripts/standard/controls.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
              Open

                initialize: function(element, url, options) {
                  this.url = url;
                  this.element = element = $(element);
                  this.prepareOptions();
                  this._controls = { };
              Severity: Minor
              Found in app/assets/javascripts/standard/controls.js - About 35 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 onKeyPress has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                onKeyPress: function(event) {
                  if(this.active)
                    switch(event.keyCode) {
                     case Event.KEY_TAB:
                     case Event.KEY_RETURN:
              Severity: Minor
              Found in app/assets/javascripts/standard/controls.js - About 35 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

              Severity
              Category
              Status
              Source
              Language