matthucke/graveyards4

View on GitHub

Showing 63 of 84 total issues

Method extract_full_name has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def extract_full_name
      n = user_info['name']
      return n unless n.blank?

      n = user_info['full_name']
Severity: Minor
Found in app/models/user_factory/base.rb - About 45 mins to fix

Cognitive Complexity

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

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

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

Further reading

Function __module1__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

var __module1__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
Severity: Minor
Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 35 mins to fix

    Function MustacheNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        MustacheNode: function(rawParams, hash, open, strip, locInfo) {
    Severity: Minor
    Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 35 mins to fix

      Function BlockNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          BlockNode: function(mustache, program, inverse, close, locInfo) {
      Severity: Minor
      Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 35 mins to fix

        Function __module0__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        var __module0__ = (function(__dependency1__, __dependency2__, __dependency3__, __dependency4__, __dependency5__) {
        Severity: Minor
        Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 35 mins to fix

          Method create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def create
              # for debug, dump to file.
              dump_auth_hash unless Rails.env.production?
          
              if identity = Identity.from_omniauth(auth_hash)
          Severity: Minor
          Found in app/controllers/sessions_controller.rb - About 35 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 find_graveyard has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def find_graveyard county, graveyard_path
              g = lookup_graveyard(county, graveyard_path)
              return g if g
          
              if graveyard_path =~ /(.*)-Cemetery/
          Severity: Minor
          Found in app/controllers/legacy_controller.rb - About 35 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_omniauth has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            def self.from_omniauth(auth)
              ident = where(attrs_from_omniauth(auth)).first_or_initialize do |ident|
                raise "#{ident.provider} user id cannot be empty" if ident.uid.to_s.blank?
                ident.provider_text = auth.to_yaml
                ident.save
          Severity: Minor
          Found in app/models/identity.rb - About 35 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 too many return statements within this method.
          Open

                return ''
          Severity: Major
          Found in app/models/user_factory/base.rb - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                          return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
                                  {text: "", token: null, line: this.yylineno});
            Severity: Major
            Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                case 22:this.popState(); return 18;
              Severity: Major
              Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                  case 24:yy_.yytext = strip(1,2).replace(/\\'/g,"'"); return 32;
                Severity: Major
                Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    case 30:yy_.yytext = strip(1,2); return 40;
                  Severity: Major
                  Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                      case 21:this.popState(); return 24;
                    Severity: Major
                    Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return fn(context);
                      Severity: Major
                      Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                          case 23:yy_.yytext = strip(1,2).replace(/\\"/g,'"'); return 32;
                        Severity: Major
                        Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                    return false;
                          Severity: Major
                          Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return true;
                            Severity: Major
                            Found in app/assets/javascripts/libs/handlebars-v1.3.0.js - About 30 mins to fix

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

                                def initialize(attrs={})
                                  attrs[:url].tap do |u|
                                    @url=u unless u.blank?
                                  end
                                  attrs[:title].tap do |t|
                              Severity: Minor
                              Found in app/models/breadcrumb.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 load_current_user has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def load_current_user
                                  ident = current_identity or return nil
                              
                                  ident.user.tap do |u|
                                    return nil unless u
                              Severity: Minor
                              Found in app/controllers/concerns/knows_current_user.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