hummingbird-me/hummingbird

View on GitHub

Showing 859 of 859 total issues

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

    setSort: function (newSort) {
      if (this.get('sortBy') === newSort) {
        if (this.get('sortAsc')) {
          return this.set('sortAsc', false);
        } else {
Severity: Major
Found in frontend/app/controllers/user/library.js and 1 other location - About 3 hrs to fix
frontend/app/controllers/user/manga-library.js on lines 113..124

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

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

  favoriteAnime: function() {
    if (this.get('userInfo.favorites') === undefined) { return []; }

    this.set('favoriteAnimeLoading', false);
    return this.get('userInfo.favorites').filter(function(fav) {
Severity: Major
Found in frontend/app/controllers/user/index.js and 1 other location - About 3 hrs to fix
frontend/app/controllers/user/index.js on lines 59..66

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

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

  favoriteManga: function() {
    if (this.get('userInfo.favorites') === undefined) { return []; }

    this.set('favoriteMangaLoading', false);
    return this.get('userInfo.favorites').filter(function(fav) {
Severity: Major
Found in frontend/app/controllers/user/index.js and 1 other location - About 3 hrs to fix
frontend/app/controllers/user/index.js on lines 50..57

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

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

Method filter_old has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

  def filter_old
    hide_cover_image
    @filter_years = %w(Upcoming 2010s 2000s 1990s 1980s 1970s Older)

    if params[:g]
Severity: Minor
Found in app/controllers/anime_controller.rb - About 3 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 _keydown has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _keydown: function( event ) {
        /*jshint maxcomplexity:20*/
        var match, prev, character, skip, regex,
            preventDefault = true;

Severity: Major
Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 3 hrs to fix

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

            if((this.offsetParent[0] === document.body) ||
                (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
                po = { top: 0, left: 0 };
            }
    Severity: Major
    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 3 hrs to fix
    app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 4944..4946

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

    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.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
                po = { top: 0, left: 0 };
            }
    Severity: Major
    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 3 hrs to fix
    app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 1796..1799

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

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

        formatDate: function (format, date, settings) {
            if (!date) {
                return "";
            }
    
    
    Severity: Major
    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 3 hrs to fix

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

                  if ( !axis || axis === "y" ) {
                      animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop);
                  }
      Severity: Major
      Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 4403..4405

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

      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 ( !axis || axis === "x" ) {
                      animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft);
                  }
      Severity: Major
      Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 3 hrs to fix
      app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 4406..4408

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

      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

      File user.rb has 297 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class User < ActiveRecord::Base
        # Friendly ID.
        def to_param
          name
        end
      Severity: Minor
      Found in app/models/user.rb - About 3 hrs to fix

        Function _clear has 77 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _clear: function(event, noPropagation) {
        
                this.reverting = false;
                // We delay all events that have to be triggered to after the point where the placeholder has been removed and
                // everything else normalized again
        Severity: Major
        Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 3 hrs to fix

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

              _deactivate: function(event) {
                  var draggable = $.ui.ddmanager.current;
                  if(this.options.activeClass) {
                      this.element.removeClass(this.options.activeClass);
                  }
          Severity: Major
          Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 2484..2492

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

          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 (woset + that.size.width >= that.parentData.width) {
                      that.size.width = that.parentData.width - woset;
                      if (pRatio) {
                          that.size.height = that.size.width / that.aspectRatio;
                      }
          Severity: Major
          Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 3541..3546

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

          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

                  next = (this._canAdjustMonth(inst, +1, drawYear, drawMonth) ?
                      "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click'" +
                      " title='" + nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>" :
                      (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+ nextText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "w" : "e") + "'>" + nextText + "</span></a>"));
          Severity: Major
          Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 8428..8431

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

          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

                  prev = (this._canAdjustMonth(inst, -1, drawYear, drawMonth) ?
                      "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click'" +
                      " title='" + prevText + "'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>" :
                      (hideIfNoPrevNext ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+ prevText +"'><span class='ui-icon ui-icon-circle-triangle-" + ( isRTL ? "e" : "w") + "'>" + prevText + "</span></a>"));
          Severity: Major
          Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 8438..8441

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

          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

              _activate: function(event) {
                  var draggable = $.ui.ddmanager.current;
                  if(this.options.activeClass) {
                      this.element.addClass(this.options.activeClass);
                  }
          Severity: Major
          Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 2494..2502

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

          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 (hoset + that.size.height >= that.parentData.height) {
                      that.size.height = that.parentData.height - hoset;
                      if (pRatio) {
                          that.size.width = that.size.height * that.aspectRatio;
                      }
          Severity: Major
          Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 3 hrs to fix
          app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 3534..3539

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

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

              function addTimeToArrayFromToken(token, input, config) {
                  var a, b,
                      datePartArray = config._a;
          
                  switch (token) {
          Severity: Major
          Found in app/assets/javascripts/old/moment.js - About 3 hrs to fix

            File jquery.icheck.js has 293 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*!
             * iCheck v0.9.1, http://git.io/uhUPMA
             * =================================
             * Powerful jQuery plugin for checkboxes and radio buttons customization
             *
            Severity: Minor
            Found in app/assets/javascripts/old/jquery.icheck.js - About 3 hrs to fix
              Severity
              Category
              Status
              Source
              Language