nukomeet/coworfing

View on GitHub

Showing 29 of 60 total issues

Method confirm_button_with_class has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def confirm_button_with_class(name, path, confirm_text, classes, disabled=false, method=:get)
Severity: Minor
Found in app/helpers/application_helper.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if (h == 0) tmph = 12 +'a';
                            else if (h < 12) tmph += 'a';
                            else tmph += 'p';
    Severity: Major
    Found in lib/assets/javascripts/jquery-ui-timepicker-addon.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if(this.millisec > this._defaults.millisecMax) this.millisec = this._defaults.millisecMax;
      Severity: Major
      Found in lib/assets/javascripts/jquery-ui-timepicker-addon.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                        if (aph == 12) h = 0;
                                        else h = aph;
        Severity: Major
        Found in lib/assets/javascripts/jquery-ui-timepicker-addon.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                      } else if (aph == 12) h = 12;
                                      else h = aph + 12;
          Severity: Major
          Found in lib/assets/javascripts/jquery-ui-timepicker-addon.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if(this.millisec < this._defaults.millisecMin)
                                        this.millisec = this._defaults.millisecMin;
            Severity: Major
            Found in lib/assets/javascripts/jquery-ui-timepicker-addon.js - About 45 mins to fix

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

                  def location(location=[])
                    unless location.blank?
                      loc = location.is_a?(Array) ? location[0] : location
                      geo = Geocoder.search(loc.gsub("-", " "))[0]
                      if geo
              Severity: Minor
              Found in app/models/place.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 all has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                def all
                  auth = request.env['omniauth.auth']
                
                  # Find an identity here
                  @identity = Identity.find_with_omniauth(auth)
              Severity: Minor
              Found in app/controllers/omniauth_callbacks_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 update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                def update
                  @user = current_user
                  email_changed = @user.email != params[:user][:email]
                  password_changed = false
                  if params[:user][:password]
              Severity: Minor
              Found in app/controllers/registrations_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

              Severity
              Category
              Status
              Source
              Language