ourcities/panela-de-pressao

View on GitHub

Showing 136 of 136 total issues

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

  def create
    if @auth = Authorization.find_from_hash(auth_data)
      @auth.update_attributes(
        token: auth_data['credentials']['token'],
        secret: auth_data['credentials']['secret']
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 create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  def create
    begin
      params[:ip] = request.remote_ip
      params[:organization_id] = @campaign.organization_id
      params[:password] = SecureRandom.hex
Severity: Minor
Found in app/controllers/pokes_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

Avoid too many return statements within this function.
Open

return _48>0;
Severity: Major
Found in app/assets/javascripts/css3-mediaqueries.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                                return false;
    Severity: Major
    Found in app/assets/javascripts/lib/jquery.inputmask.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

      return false;
      Severity: Major
      Found in app/assets/javascripts/css3-mediaqueries.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

        return false;
        Severity: Major
        Found in app/assets/javascripts/css3-mediaqueries.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

          return ((min&&_46>=_44)||(max&&_46<_44)||(!min&&!max&&_46===_44));
          Severity: Major
          Found in app/assets/javascripts/css3-mediaqueries.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

            return _47>0;
            Severity: Major
            Found in app/assets/javascripts/css3-mediaqueries.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

              return ((min&&_49>=_44)||(max&&_49<_44)||(!min&&!max&&_49===_44));
              Severity: Major
              Found in app/assets/javascripts/css3-mediaqueries.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    if (className != toString.call(b)) return false;
                Severity: Major
                Found in app/assets/javascripts/lib/underscore.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false;
                  Severity: Major
                  Found in app/assets/javascripts/lib/underscore.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                    return _47>0;
                    Severity: Major
                    Found in app/assets/javascripts/css3-mediaqueries.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                          return _.values(obj);
                      Severity: Major
                      Found in app/assets/javascripts/lib/underscore.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                        return ((min&&_47>=_44)||(max&&_47<_44)||(!min&&!max&&_47===_44));
                        Severity: Major
                        Found in app/assets/javascripts/css3-mediaqueries.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                          return false;
                          Severity: Major
                          Found in app/assets/javascripts/css3-mediaqueries.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return -1;
                            Severity: Major
                            Found in app/assets/javascripts/lib/underscore.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                  return result;
                              Severity: Major
                              Found in app/assets/javascripts/lib/underscore.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                return false;
                                Severity: Major
                                Found in app/assets/javascripts/css3-mediaqueries.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                                          return false;
                                  Severity: Major
                                  Found in app/assets/javascripts/lib/jquery.inputmask.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                        if (typeof a != 'object' || typeof b != 'object') return false;
                                    Severity: Major
                                    Found in app/assets/javascripts/lib/underscore.js - About 30 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language