coding-chimp/onesignal

View on GitHub

Showing 553 of 673 total issues

File notification_target.rb has 304 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'date'
require 'time'

module OneSignal
  class NotificationTarget
Severity: Minor
Found in lib/onesignal/models/notification_target.rb - About 3 hrs to fix

    Method openapi_nullable has 82 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def self.openapi_nullable
          Set.new([
            :'include_player_ids',
            :'include_external_user_ids',
            :'include_aliases',
    Severity: Major
    Found in lib/onesignal/models/basic_notification.rb - About 3 hrs to fix

      Method openapi_nullable has 79 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def self.openapi_nullable
            Set.new([
              :'name',
              :'is_ios',
              :'is_android',
      Severity: Major
      Found in lib/onesignal/models/basic_notification_all_of.rb - About 3 hrs to fix

        Method initialize has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def initialize(attributes = {})
              if (!attributes.is_a?(Hash))
                fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::NotificationTarget` initialize method"
              end
        
        
        Severity: Major
        Found in lib/onesignal/models/notification_target.rb - About 3 hrs to fix

          File subscription_object.rb has 282 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'date'
          require 'time'
          
          module OneSignal
            class SubscriptionObject
          Severity: Minor
          Found in lib/onesignal/models/subscription_object.rb - About 2 hrs to fix

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

                def initialize(attributes = {})
                  if (!attributes.is_a?(Hash))
                    fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::SubscriptionObject` initialize method"
                  end
            
            
            Severity: Minor
            Found in lib/onesignal/models/subscription_object.rb - About 2 hrs 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 initialize has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def initialize(attributes = {})
                  if (!attributes.is_a?(Hash))
                    fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::PlayerNotificationTarget` initialize method"
                  end
            
            
            Severity: Major
            Found in lib/onesignal/models/player_notification_target.rb - About 2 hrs to fix

              File player_notification_target.rb has 270 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'date'
              require 'time'
              
              module OneSignal
                class PlayerNotificationTarget
              Severity: Minor
              Found in lib/onesignal/models/player_notification_target.rb - About 2 hrs to fix

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

                    def initialize(attributes = {})
                      if (!attributes.is_a?(Hash))
                        fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::PropertiesObject` initialize method"
                      end
                
                
                Severity: Minor
                Found in lib/onesignal/models/properties_object.rb - About 2 hrs 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 initialize has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def initialize(attributes = {})
                      if (!attributes.is_a?(Hash))
                        fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::SubscriptionObject` initialize method"
                      end
                
                
                Severity: Major
                Found in lib/onesignal/models/subscription_object.rb - About 2 hrs to fix

                  Method initialize has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def initialize(attributes = {})
                        if (!attributes.is_a?(Hash))
                          fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::PropertiesObject` initialize method"
                        end
                  
                  
                  Severity: Minor
                  Found in lib/onesignal/models/properties_object.rb - About 1 hr to fix

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

                        def self.attribute_map
                          {
                            :'en' => :'en',
                            :'ar' => :'ar',
                            :'bs' => :'bs',
                    Severity: Minor
                    Found in lib/onesignal/models/string_map.rb - About 1 hr to fix

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

                          def self.openapi_types
                            {
                              :'en' => :'String',
                              :'ar' => :'String',
                              :'bs' => :'String',
                      Severity: Minor
                      Found in lib/onesignal/models/string_map.rb - About 1 hr to fix

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

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

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

                              def initialize(attributes = {})
                                if (!attributes.is_a?(Hash))
                                  fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::NotificationWithMetaAllOf` initialize method"
                                end
                          
                          
                          Severity: Minor
                          Found in lib/onesignal/models/notification_with_meta_all_of.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 find_and_cast_into_type has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                def find_and_cast_into_type(klass, data)
                                  return if data.nil?
                          
                                  case klass.to_s
                                  when 'Boolean'
                          Severity: Minor
                          Found in lib/onesignal/models/notification200_errors.rb - About 1 hr to fix

                            Method initialize has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def initialize(attributes = {})
                                  if (!attributes.is_a?(Hash))
                                    fail ArgumentError, "The input argument (attributes) must be a hash in `OneSignal::NotificationWithMetaAllOf` initialize method"
                                  end
                            
                            
                            Severity: Minor
                            Found in lib/onesignal/models/notification_with_meta_all_of.rb - About 1 hr to fix

                              Method create_subscription_with_http_info has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def create_subscription_with_http_info(app_id, alias_label, alias_id, create_subscription_request_body, opts = {})
                                    if @api_client.config.debugging
                                      @api_client.config.logger.debug 'Calling API: DefaultApi.create_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_alias_with_http_info has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    def identify_user_by_alias_with_http_info(app_id, alias_label, alias_id, user_identity_request_body, opts = {})
                                      if @api_client.config.debugging
                                        @api_client.config.logger.debug 'Calling API: DefaultApi.identify_user_by_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 update_user_with_http_info has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      def update_user_with_http_info(app_id, alias_label, alias_id, update_user_request, opts = {})
                                        if @api_client.config.debugging
                                          @api_client.config.logger.debug 'Calling API: DefaultApi.update_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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language