coding-chimp/onesignal

View on GitHub

Showing 553 of 673 total issues

Method initialize has 138 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::StringMap` initialize method"
      end

Severity: Major
Found in lib/onesignal/models/string_map.rb - About 5 hrs to fix

    Method initialize has a Cognitive Complexity of 35 (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::PlayerNotificationTarget` initialize method"
          end
    
    
    Severity: Minor
    Found in lib/onesignal/models/player_notification_target.rb - About 5 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 openapi_types has 119 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def self.openapi_types
          {
            :'included_segments' => :'Array<String>',
            :'excluded_segments' => :'Array<String>',
            :'include_player_ids' => :'Array<String>',
    Severity: Major
    Found in lib/onesignal/models/notification_with_meta.rb - About 4 hrs to fix

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

          def ==(o)
            return true if self.equal?(o)
            self.class == o.class &&
                included_segments == o.included_segments &&
                excluded_segments == o.excluded_segments &&
      Severity: Major
      Found in lib/onesignal/models/notification_with_meta.rb - About 4 hrs to fix

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

            def self.attribute_map
              {
                :'included_segments' => :'included_segments',
                :'excluded_segments' => :'excluded_segments',
                :'include_player_ids' => :'include_player_ids',
        Severity: Major
        Found in lib/onesignal/models/notification_with_meta.rb - About 4 hrs to fix

          Method initialize has 111 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::App` initialize method"
                end
          
          
          Severity: Major
          Found in lib/onesignal/models/app.rb - About 4 hrs to fix

            Method initialize has a Cognitive Complexity of 30 (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::Player` initialize method"
                  end
            
            
            Severity: Minor
            Found in lib/onesignal/models/player.rb - About 4 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 attribute_map has 109 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def self.attribute_map
                  {
                    :'included_segments' => :'included_segments',
                    :'excluded_segments' => :'excluded_segments',
                    :'include_player_ids' => :'include_player_ids',
            Severity: Major
            Found in lib/onesignal/models/notification.rb - About 4 hrs to fix

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

                  def ==(o)
                    return true if self.equal?(o)
                    self.class == o.class &&
                        included_segments == o.included_segments &&
                        excluded_segments == o.excluded_segments &&
              Severity: Major
              Found in lib/onesignal/models/notification.rb - About 4 hrs to fix

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

                    def self.openapi_types
                      {
                        :'included_segments' => :'Array<String>',
                        :'excluded_segments' => :'Array<String>',
                        :'include_player_ids' => :'Array<String>',
                Severity: Major
                Found in lib/onesignal/models/notification.rb - About 4 hrs to fix

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

                      def self.openapi_types
                        {
                          :'included_segments' => :'Array<String>',
                          :'excluded_segments' => :'Array<String>',
                          :'include_player_ids' => :'Array<String>',
                  Severity: Major
                  Found in lib/onesignal/models/basic_notification.rb - About 4 hrs to fix

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

                        def ==(o)
                          return true if self.equal?(o)
                          self.class == o.class &&
                              included_segments == o.included_segments &&
                              excluded_segments == o.excluded_segments &&
                    Severity: Major
                    Found in lib/onesignal/models/basic_notification.rb - About 4 hrs to fix

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

                          def self.attribute_map
                            {
                              :'included_segments' => :'included_segments',
                              :'excluded_segments' => :'excluded_segments',
                              :'include_player_ids' => :'include_player_ids',
                      Severity: Major
                      Found in lib/onesignal/models/basic_notification.rb - About 4 hrs to fix

                        File player.rb has 338 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        require 'date'
                        require 'time'
                        
                        module OneSignal
                          class Player
                        Severity: Minor
                        Found in lib/onesignal/models/player.rb - About 4 hrs to fix

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

                              def self.attribute_map
                                {
                                  :'id' => :'id',
                                  :'value' => :'value',
                                  :'name' => :'name',
                          Severity: Major
                          Found in lib/onesignal/models/basic_notification_all_of.rb - About 3 hrs to fix

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

                                def ==(o)
                                  return true if self.equal?(o)
                                  self.class == o.class &&
                                      id == o.id &&
                                      value == o.value &&
                            Severity: Major
                            Found in lib/onesignal/models/basic_notification_all_of.rb - About 3 hrs to fix

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

                                  def self.openapi_types
                                    {
                                      :'id' => :'String',
                                      :'value' => :'Integer',
                                      :'name' => :'String',
                              Severity: Major
                              Found in lib/onesignal/models/basic_notification_all_of.rb - About 3 hrs to fix

                                Method initialize has 90 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::Player` initialize method"
                                      end
                                
                                
                                Severity: Major
                                Found in lib/onesignal/models/player.rb - About 3 hrs to fix

                                  Method openapi_nullable has 85 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/notification_with_meta.rb - About 3 hrs to fix

                                    Method openapi_nullable has 83 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/notification.rb - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language