hummingbird-me/hummingbird

View on GitHub

Showing 859 of 859 total issues

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

      {
        "name": "Hummingbird Updater",
        "author": [
          { "name": "Dennis", "link": "http://hummingbird.me/users/Dennis" },
        ],
Severity: Major
Found in frontend/app/routes/apps/index.js and 5 other locations - About 2 hrs to fix
frontend/app/routes/apps/index.js on lines 40..53
frontend/app/routes/apps/index.js on lines 54..67
frontend/app/routes/apps/index.js on lines 82..95
frontend/app/routes/apps/index.js on lines 110..123
frontend/app/routes/apps/index.js on lines 124..137

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

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

      {
        "name": "Taiga",
        "author": [
          { "name": "Erengy", "link": "http://hummingbird.me/users/Erengy" },
        ],
Severity: Major
Found in frontend/app/routes/apps/index.js and 5 other locations - About 2 hrs to fix
frontend/app/routes/apps/index.js on lines 54..67
frontend/app/routes/apps/index.js on lines 82..95
frontend/app/routes/apps/index.js on lines 96..109
frontend/app/routes/apps/index.js on lines 110..123
frontend/app/routes/apps/index.js on lines 124..137

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

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

      {
          "name": "Hachidori",
          "author": [
            { "name": "chikorita157", "link": "https://hummingbird.me/users/chikorita157" },
          ],
Severity: Major
Found in frontend/app/routes/apps/index.js and 5 other locations - About 2 hrs to fix
frontend/app/routes/apps/index.js on lines 40..53
frontend/app/routes/apps/index.js on lines 54..67
frontend/app/routes/apps/index.js on lines 82..95
frontend/app/routes/apps/index.js on lines 96..109
frontend/app/routes/apps/index.js on lines 124..137

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

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

      {
          "name": "Trackma",
          "author": [
            { "name": "z411", "link": "https://hummingbird.me/users/z411" },
          ],
Severity: Major
Found in frontend/app/routes/apps/index.js and 5 other locations - About 2 hrs to fix
frontend/app/routes/apps/index.js on lines 40..53
frontend/app/routes/apps/index.js on lines 54..67
frontend/app/routes/apps/index.js on lines 82..95
frontend/app/routes/apps/index.js on lines 96..109
frontend/app/routes/apps/index.js on lines 110..123

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

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

      {
        "name": "Anitro",
        "author": [
          { "name": "Killerrin", "link": "http://hummingbird.me/users/Killerrin" },
        ],
Severity: Major
Found in frontend/app/routes/apps/index.js and 5 other locations - About 2 hrs to fix
frontend/app/routes/apps/index.js on lines 40..53
frontend/app/routes/apps/index.js on lines 54..67
frontend/app/routes/apps/index.js on lines 96..109
frontend/app/routes/apps/index.js on lines 110..123
frontend/app/routes/apps/index.js on lines 124..137

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

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

      {
        "name": "HAPU",
        "author": [
          { "name": "inket", "link": "http://hummingbird.me/users/inket" },
        ],
Severity: Major
Found in frontend/app/routes/apps/index.js and 5 other locations - About 2 hrs to fix
frontend/app/routes/apps/index.js on lines 40..53
frontend/app/routes/apps/index.js on lines 82..95
frontend/app/routes/apps/index.js on lines 96..109
frontend/app/routes/apps/index.js on lines 110..123
frontend/app/routes/apps/index.js on lines 124..137

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

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

        keydown: function( event ) {
            /*jshint maxcomplexity:25*/
            var allowed, curVal, newVal, step,
                index = $( event.target ).data( "ui-slider-handle-index" );

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

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

        truncatedAbout: Ember.computed('about', {
          get() {
            return this.get('about') || "";
          },
    
    
    Severity: Major
    Found in frontend/app/mixins/model-truncated-details.js and 1 other location - About 2 hrs to fix
    frontend/app/mixins/model-truncated-details.js on lines 4..13

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

    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

        truncatedBio: Ember.computed('bio', {
          get() {
            return this.get('bio') || "";
          },
    
    
    Severity: Major
    Found in frontend/app/mixins/model-truncated-details.js and 1 other location - About 2 hrs to fix
    frontend/app/mixins/model-truncated-details.js on lines 15..24

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

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

        _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
                secondary, monthNames, monthNamesShort) {
    
            var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
                changeMonth = this._get(inst, "changeMonth"),
    Severity: Major
    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix

      Method find_by_ids has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def self.find_by_ids(story_ids, current_user)
          stories = Story.where(id: story_ids)
                    .for_user(current_user)
                    .preload(:target, substories: %i(target))
                    .includes(:user, :substories,
      Severity: Major
      Found in lib/story_query.rb - About 2 hrs to fix

        File bootstrap-tooltip.js has 258 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* ===========================================================
         * bootstrap-tooltip.js v2.3.2
         * http://twitter.github.com/bootstrap/javascript.html#tooltips
         * Inspired by the original jQuery.tipsy by Jason Frame
         * ===========================================================
        Severity: Minor
        Found in app/assets/javascripts/old/bootstrap-tooltip.js - About 2 hrs to fix

          File anime.rb has 258 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class Anime < ActiveRecord::Base
            PG_TITLE_SCOPE = %i(title alt_title)
          
            AGE_RATINGS = %w(G PG13 PG R18+)
          
          
          Severity: Minor
          Found in app/models/anime.rb - About 2 hrs to fix

            Function refresh has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                refresh: function(init) {
                  var el = this.element;
                  var o = this.options;
                  var menu = this.menu;
                  var checkboxContainer = this.checkboxContainer;
            Severity: Major
            Found in app/assets/javascripts/old/multiselect.js - About 2 hrs to fix

              Function _mouseStart has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _mouseStart: function(event) {
                      var that = this,
                          options = this.options;
              
                      this.opos = [event.pageX, event.pageY];
              Severity: Major
              Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix

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

                            v = partial.length === 0
                                ? '{}'
                                : gap
                                ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}'
                                : '{' + partial.join(',') + '}';
                Severity: Major
                Found in app/assets/javascripts/old/json2.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/old/json2.js on lines 307..311

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

                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

                                v = partial.length === 0
                                    ? '[]'
                                    : gap
                                    ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']'
                                    : '[' + partial.join(',') + ']';
                Severity: Major
                Found in app/assets/javascripts/old/json2.js and 1 other location - About 2 hrs to fix
                app/assets/javascripts/old/json2.js on lines 346..350

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

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

                  def self.create_or_update_from_hash hash
                    # First the creation logic
                    # TODO: stop hard-coding the ID column
                    manga = Manga.find_by(mal_id: hash[:external_id])
                    if manga.nil? && Manga.where(romaji_title: hash[:romaji_title]).count > 1
                Severity: Minor
                Found in app/models/manga.rb - 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

                Method myanimelist has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                  def myanimelist
                    file = params.require(:file)
                
                    # Prepare the file
                    # Check the magic number for gzip because some browsers are stupid
                Severity: Minor
                Found in app/controllers/settings/import_controller.rb - 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 keydown has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            keydown: function( event ) {
                                /*jshint maxcomplexity:15*/
                                if ( this.element.prop( "readOnly" ) ) {
                                    suppressKeyPress = true;
                                    suppressInput = true;
                Severity: Major
                Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language