hummingbird-me/hummingbird

View on GitHub

Showing 859 of 859 total issues

Avoid too many return statements within this method.
Open

    return "Decent"   if r == 6
Severity: Major
Found in app/helpers/reviews_helper.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return render(text: "Unknown error: #{e.message}", status: 400)
    Severity: Major
    Found in app/controllers/pro_memberships_controller.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return 'Finished Airing'
      Severity: Major
      Found in app/models/anime.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

            return pluralize(difference_in_years, "year")
        Severity: Major
        Found in app/helpers/application_helper.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

              return "Flawless" if r == 10
          Severity: Major
          Found in app/helpers/reviews_helper.rb - About 30 mins to fix

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

                    if ( event ) {
                        $.each( event.split(" "), function( index, eventName ) {
                            events[ eventName ] = "_eventHandler";
                        });
                    }
            Severity: Minor
            Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 30 mins to fix
            app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 11964..11968

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

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

            FastClick.prototype.onTouchCancel = function() {
                'use strict';
                this.trackingClick = false;
                this.targetElement = null;
            };
            Severity: Minor
            Found in public/2014/assets/js/fastclick.js and 1 other location - About 30 mins to fix
            public/2013/assets/js/fastclick.js on lines 601..605

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

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

                    if ( event ) {
                        $.each( event.split(" "), function( index, eventName ) {
                            events[ eventName ] = "_eventHandler";
                        });
                    }
            Severity: Minor
            Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 30 mins to fix
            app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 5622..5626

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

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

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

            FastClick.prototype.onTouchCancel = function() {
                'use strict';
                this.trackingClick = false;
                this.targetElement = null;
            };
            Severity: Minor
            Found in public/2013/assets/js/fastclick.js and 1 other location - About 30 mins to fix
            public/2014/assets/js/fastclick.js on lines 601..605

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

            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

                            hit = (selectee.left > x1 && selectee.right < x2 && selectee.top > y1 && selectee.bottom < y2);
            Severity: Minor
            Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 30 mins to fix
            app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 3887..3887

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

            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

                    this._disabledInputs = $.map(this._disabledInputs,
                        function(value) { return (value === target ? null : value); }); // delete entry
            Severity: Minor
            Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 30 mins to fix
            app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 7182..7183

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

            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

                            hit = ( !(selectee.left > x2 || selectee.right < x1 || selectee.top > y2 || selectee.bottom < y1) );
            Severity: Minor
            Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 30 mins to fix
            app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 3889..3889

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

            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

                    this._disabledInputs = $.map(this._disabledInputs,
                        function(value) { return (value === target ? null : value); }); // delete entry
            Severity: Minor
            Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 30 mins to fix
            app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 7210..7211

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

            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

              MANGA_STATUS_MAP = {
                "1"             => "Currently Reading",
                "reading"       => "Currently Reading",
                "Reading"       => "Currently Reading",
                "2"             => "Completed",
            Severity: Minor
            Found in lib/my_anime_list_import.rb and 1 other location - About 30 mins to fix
            lib/my_anime_list_import.rb on lines 2..17

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

            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

              ANIME_STATUS_MAP = {
                "1"             => "Currently Watching",
                "watching"      => "Currently Watching",
                "Watching"      => "Currently Watching",
                "2"             => "Completed",
            Severity: Minor
            Found in lib/my_anime_list_import.rb and 1 other location - About 30 mins to fix
            lib/my_anime_list_import.rb on lines 19..34

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

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

            FastClick.prototype.needsClick = function(target) {
                'use strict';
                switch (target.nodeName.toLowerCase()) {
            
                // Don't send a synthetic click to disabled inputs (issue #62)
            Severity: Minor
            Found in public/2014/assets/js/fastclick.js - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function willDestroyElement has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              willDestroyElement: function() {
                var ui = this.get('ui');
            
                if (ui) {
                  // Tear down any observers that were created to make jQuery UI
            Severity: Minor
            Found in app/assets/javascripts/mixins/JQueryMixin.js - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function needsClick has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

            FastClick.prototype.needsClick = function(target) {
                'use strict';
                switch (target.nodeName.toLowerCase()) {
            
                // Don't send a synthetic click to disabled inputs (issue #62)
            Severity: Minor
            Found in public/2013/assets/js/fastclick.js - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method ed_serialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def ed_serialize(data, options = {})
                data = data.to_a if data.respond_to? :to_ary
                data = [data] unless data.is_a? Array
                return if data.empty?
                options[:scope] = current_user
            Severity: Minor
            Found in app/controllers/application_controller.rb - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Method perform has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def perform(user_id, story_id)
                story = Story.find_by_id(story_id)
                user = User.find(user_id)
                return if story.nil?
            
            
            Severity: Minor
            Found in app/workers/story_fanout_worker.rb - About 25 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Severity
            Category
            Status
            Source
            Language