hummingbird-me/hummingbird

View on GitHub

Showing 419 of 859 total issues

Method sanitize_review has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def sanitize_review(html)
    allow_youtube_transformer = lambda do |env|
      node      = env[:node]
      node_name = env[:node_name]

Severity: Minor
Found in app/helpers/reviews_helper.rb - About 55 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 canonical_title has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def canonical_title(preference = '')
    if preference.class == User
      preference = preference.title_language_preference
    end

Severity: Minor
Found in app/models/anime.rb - About 55 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 from_library_entry has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def self.from_library_entry(l)
    return unless l.valid?

    if l.persisted?

Severity: Minor
Found in app/services/action.rb - About 55 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 update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  def update
    authenticate_user!
    group = Group.find(params[:id])
    group_hash = params.require(:group).permit(:bio, :about, :cover_image_url, :avatar_url).to_h

Severity: Minor
Found in app/controllers/groups_controller.rb - About 55 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 s has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    s: function(val, ctx, partials, inverted, start, end, tags) {
Severity: Major
Found in app/assets/javascripts/old/hogan-2.0.0.js - About 50 mins to fix

    Function ls has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        ls: function(val, ctx, partials, inverted, start, end, tags) {
    Severity: Major
    Found in app/assets/javascripts/old/hogan-2.0.0.js - About 50 mins to fix

      Function performAction has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
      Severity: Major
      Found in app/assets/javascripts/old/handlebars-1.0.0.js - About 50 mins to fix

        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

                          Severity
                          Category
                          Status
                          Source
                          Language