coding-chimp/onesignal

View on GitHub

Showing 553 of 673 total issues

Method server_url has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def server_url(index, variables = {}, servers = nil)
      servers = server_settings if servers == nil

      # check array index out of bound
      if (index < 0 || index >= servers.size)
Severity: Minor
Found in lib/onesignal/configuration.rb - About 1 hr 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_subscription_with_http_info has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def update_subscription_with_http_info(app_id, subscription_id, update_subscription_request_body, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug 'Calling API: DefaultApi.update_subscription ...'
      end
      # verify the required parameter 'app_id' is set
Severity: Minor
Found in lib/onesignal/api/default_api.rb - About 1 hr to fix

    Method identify_user_by_subscription_id_with_http_info has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def identify_user_by_subscription_id_with_http_info(app_id, subscription_id, user_identity_request_body, opts = {})
          if @api_client.config.debugging
            @api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_subscription_id ...'
          end
          # verify the required parameter 'app_id' is set
    Severity: Minor
    Found in lib/onesignal/api/default_api.rb - About 1 hr to fix

      Method transfer_subscription_with_http_info has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def transfer_subscription_with_http_info(app_id, subscription_id, transfer_subscription_request_body, opts = {})
            if @api_client.config.debugging
              @api_client.config.logger.debug 'Calling API: DefaultApi.transfer_subscription ...'
            end
            # verify the required parameter 'app_id' is set
      Severity: Minor
      Found in lib/onesignal/api/default_api.rb - About 1 hr to fix

        Method begin_live_activity_with_http_info has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def begin_live_activity_with_http_info(app_id, activity_id, begin_live_activity_request, opts = {})
              if @api_client.config.debugging
                @api_client.config.logger.debug 'Calling API: DefaultApi.begin_live_activity ...'
              end
              # verify the required parameter 'app_id' is set
        Severity: Minor
        Found in lib/onesignal/api/default_api.rb - About 1 hr to fix

          Method update_live_activity_with_http_info has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def update_live_activity_with_http_info(app_id, activity_id, update_live_activity_request, opts = {})
                if @api_client.config.debugging
                  @api_client.config.logger.debug 'Calling API: DefaultApi.update_live_activity ...'
                end
                # verify the required parameter 'app_id' is set
          Severity: Minor
          Found in lib/onesignal/api/default_api.rb - About 1 hr to fix

            Method delete_alias_with_http_info has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def delete_alias_with_http_info(app_id, alias_label, alias_id, alias_label_to_delete, opts = {})
                  if @api_client.config.debugging
                    @api_client.config.logger.debug 'Calling API: DefaultApi.delete_alias ...'
                  end
                  # verify the required parameter 'app_id' is set
            Severity: Minor
            Found in lib/onesignal/api/default_api.rb - About 1 hr to fix

              Method openapi_types has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def self.openapi_types
                    {
                      :'id' => :'String',
                      :'name' => :'String',
                      :'players' => :'Integer',
              Severity: Minor
              Found in lib/onesignal/models/app.rb - About 1 hr to fix

                Method == has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def ==(o)
                      return true if self.equal?(o)
                      self.class == o.class &&
                          id == o.id &&
                          name == o.name &&
                Severity: Minor
                Found in lib/onesignal/models/app.rb - About 1 hr to fix

                  Method attribute_map has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def self.attribute_map
                        {
                          :'id' => :'id',
                          :'name' => :'name',
                          :'players' => :'players',
                  Severity: Minor
                  Found in lib/onesignal/models/app.rb - About 1 hr to fix

                    Method get_notifications_with_http_info has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def get_notifications_with_http_info(app_id, opts = {})
                          if @api_client.config.debugging
                            @api_client.config.logger.debug 'Calling API: DefaultApi.get_notifications ...'
                          end
                          # verify the required parameter 'app_id' is set
                    Severity: Minor
                    Found in lib/onesignal/api/default_api.rb - About 1 hr to fix

                      Method get_outcomes_with_http_info has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def get_outcomes_with_http_info(app_id, outcome_names, opts = {})
                            if @api_client.config.debugging
                              @api_client.config.logger.debug 'Calling API: DefaultApi.get_outcomes ...'
                            end
                            # verify the required parameter 'app_id' is set
                      Severity: Minor
                      Found in lib/onesignal/api/default_api.rb - About 1 hr to fix

                        Method get_notification_history_with_http_info has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def get_notification_history_with_http_info(notification_id, get_notification_request_body, opts = {})
                              if @api_client.config.debugging
                                @api_client.config.logger.debug 'Calling API: DefaultApi.get_notification_history ...'
                              end
                              # verify the required parameter 'notification_id' is set
                        Severity: Minor
                        Found in lib/onesignal/api/default_api.rb - About 1 hr to fix

                          Method create_user_with_http_info has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def create_user_with_http_info(app_id, user, opts = {})
                                if @api_client.config.debugging
                                  @api_client.config.logger.debug 'Calling API: DefaultApi.create_user ...'
                                end
                                # verify the required parameter 'app_id' is set
                          Severity: Minor
                          Found in lib/onesignal/api/default_api.rb - About 1 hr to fix

                            Method update_player_with_http_info has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def update_player_with_http_info(player_id, player, opts = {})
                                  if @api_client.config.debugging
                                    @api_client.config.logger.debug 'Calling API: DefaultApi.update_player ...'
                                  end
                                  # verify the required parameter 'player_id' is set
                            Severity: Minor
                            Found in lib/onesignal/api/default_api.rb - About 1 hr to fix

                              Method update_app_with_http_info has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def update_app_with_http_info(app_id, app, opts = {})
                                    if @api_client.config.debugging
                                      @api_client.config.logger.debug 'Calling API: DefaultApi.update_app ...'
                                    end
                                    # verify the required parameter 'app_id' is set
                              Severity: Minor
                              Found in lib/onesignal/api/default_api.rb - About 1 hr to fix

                                Method update_player_tags_with_http_info has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    def update_player_tags_with_http_info(app_id, external_user_id, opts = {})
                                      if @api_client.config.debugging
                                        @api_client.config.logger.debug 'Calling API: DefaultApi.update_player_tags ...'
                                      end
                                      # verify the required parameter 'app_id' is set
                                Severity: Minor
                                Found in lib/onesignal/api/default_api.rb - About 1 hr to fix

                                  Method _deserialize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      def _deserialize(type, value)
                                        case type.to_sym
                                        when :Time
                                          Time.parse(value)
                                        when :Date
                                  Severity: Minor
                                  Found in lib/onesignal/models/begin_live_activity_request.rb - About 1 hr to fix

                                    Method _deserialize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        def _deserialize(type, value)
                                          case type.to_sym
                                          when :Time
                                            Time.parse(value)
                                          when :Date
                                    Severity: Minor
                                    Found in lib/onesignal/models/cancel_notification_success_response.rb - About 1 hr to fix

                                      Method _deserialize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          def _deserialize(type, value)
                                            case type.to_sym
                                            when :Time
                                              Time.parse(value)
                                            when :Date
                                      Severity: Minor
                                      Found in lib/onesignal/models/platform_delivery_data.rb - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language