hummingbird-me/hummingbird

View on GitHub

Showing 859 of 859 total issues

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

            draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left);
Severity: Minor
Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 50 mins to fix
app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 2612..2612

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

            draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top);
Severity: Minor
Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 50 mins to fix
app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 2611..2611

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

    goBack: function() {
      if (!this.get('canGoBack')) { return; }
      this.fetchPage(this.get('page') - 1);
    },
Severity: Minor
Found in frontend/app/components/quick-update.js and 1 other location - About 50 mins to fix
frontend/app/components/quick-update.js on lines 47..50

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

Avoid deeply nested control flow statements.
Open

                        if (v) {
                            partial.push(quote(k) + (gap ? ': ' : ':') + v);
                        }
Severity: Major
Found in app/assets/javascripts/old/json2.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                  if (/wn|er|in/.test(type)) {
    
                    // mousedown|mouseover|touchbegin
                    parent[_add](toggle);
    
    
    Severity: Major
    Found in app/assets/javascripts/old/jquery.icheck.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                    if (label.length && labelHover && toggle == hoverClass) {
      
                      // mouseout|touchend
                      label[/ut|nd/.test(type) ? _remove : _add](labelHoverClass);
                    };
      Severity: Major
      Found in app/assets/javascripts/old/jquery.icheck.js - About 45 mins to fix

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

        FastClick.prototype.updateScrollParent = function(targetElement) {
            'use strict';
            var scrollParent, parentElement;
        
            scrollParent = targetElement.fastClickScrollParent;
        Severity: Minor
        Found in public/2013/assets/js/fastclick.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

        Avoid deeply nested control flow statements.
        Open

                                    if (v !== undefined) {
                                        value[k] = v;
                                    } else {
                                        delete value[k];
                                    }
        Severity: Major
        Found in app/assets/javascripts/old/json2.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                    if (tag) {
                      i++;
                    }
          Severity: Major
          Found in app/assets/javascripts/old/hogan-2.0.0.js - About 45 mins to fix

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

            FastClick.prototype.updateScrollParent = function(targetElement) {
                'use strict';
                var scrollParent, parentElement;
            
                scrollParent = targetElement.fastClickScrollParent;
            Severity: Minor
            Found in public/2014/assets/js/fastclick.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

            Avoid deeply nested control flow statements.
            Open

                      if (tagType == '{') {
                        if (ctag == '}}') {
                          i++;
                        } else {
                          cleanTripleStache(tokens[tokens.length - 1]);
            Severity: Major
            Found in app/assets/javascripts/old/hogan-2.0.0.js - About 45 mins to fix

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

              FastClick.prototype.onMouse = function(event) {
                  'use strict';
              
                  // If a target element was never set (because a touch event was never fired) allow the event
                  if (!this.targetElement) {
              Severity: Minor
              Found in public/2014/assets/js/fastclick.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

              Avoid deeply nested control flow statements.
              Open

                                      if (v) {
                                          partial.push(quote(k) + (gap ? ': ' : ':') + v);
                                      }
              Severity: Major
              Found in app/assets/javascripts/old/json2.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                              if (node[_checked]) {
                                off(self, _checked);
                              } else {
                                on(self, _checked);
                              };
                Severity: Major
                Found in app/assets/javascripts/old/jquery.icheck.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                if (_mobile) {
                                  event.stopPropagation();
                                } else {
                                  return false;
                                };
                  Severity: Major
                  Found in app/assets/javascripts/old/jquery.icheck.js - About 45 mins to fix

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

                    this.initializeRatingInterface = function(element, type) {
                      var anime_slug, i, rating, star, _i;
                      return;
                      rating = parseInt(element.attr("data-rating"));
                      anime_slug = element.attr("data-anime-slug");
                    Severity: Minor
                    Found in app/assets/javascripts/old/library_update.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 onMouse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                    FastClick.prototype.onMouse = function(event) {
                        'use strict';
                    
                        // If a target element was never set (because a touch event was never fired) allow the event
                        if (!this.targetElement) {
                    Severity: Minor
                    Found in public/2013/assets/js/fastclick.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

                    Avoid deeply nested control flow statements.
                    Open

                                  if ((callback && callback !== ev.callback && callback !== ev.callback._callback) ||
                                      (context && context !== ev.context)) {
                                    retain.push(ev);
                                  }
                    Severity: Major
                    Found in app/assets/javascripts/old/backbone-1.0.0.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                    if (type == _click) {
                                      operate(self, false, true);
                      
                                    // Hover state
                                    } else if (labelHover) {
                      Severity: Major
                      Found in app/assets/javascripts/old/jquery.icheck.js - About 45 mins to fix

                        Function section has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          function section(nodes, id, method, start, end, tags) {
                        Severity: Minor
                        Found in app/assets/javascripts/old/hogan-2.0.0.js - About 45 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language