coding-chimp/onesignal

View on GitHub

Showing 553 of 673 total issues

File default_api.rb has 1493 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'cgi'

module OneSignal
  class DefaultApi
    attr_accessor :api_client
Severity: Major
Found in lib/onesignal/api/default_api.rb - About 3 days to fix

    Method initialize has a Cognitive Complexity of 154 (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::NotificationWithMeta` initialize method"
          end
    
    
    Severity: Minor
    Found in lib/onesignal/models/notification_with_meta.rb - About 3 days 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 a Cognitive Complexity of 142 (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::Notification` initialize method"
          end
    
    
    Severity: Minor
    Found in lib/onesignal/models/notification.rb - About 2 days 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 a Cognitive Complexity of 141 (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::BasicNotification` initialize method"
          end
    
    
    Severity: Minor
    Found in lib/onesignal/models/basic_notification.rb - About 2 days 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

    File notification_with_meta.rb has 1120 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'date'
    require 'time'
    
    module OneSignal
      class NotificationWithMeta
    Severity: Major
    Found in lib/onesignal/models/notification_with_meta.rb - About 2 days to fix

      File notification.rb has 1044 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'date'
      require 'time'
      
      module OneSignal
        class Notification
      Severity: Major
      Found in lib/onesignal/models/notification.rb - About 2 days to fix

        File basic_notification.rb has 1036 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'date'
        require 'time'
        
        module OneSignal
          class BasicNotification
        Severity: Major
        Found in lib/onesignal/models/basic_notification.rb - About 2 days to fix

          File basic_notification_all_of.rb has 892 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'date'
          require 'time'
          
          module OneSignal
            class BasicNotificationAllOf
          Severity: Major
          Found in lib/onesignal/models/basic_notification_all_of.rb - About 2 days to fix

            Method initialize has a Cognitive Complexity of 103 (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::BasicNotificationAllOf` initialize method"
                  end
            
            
            Severity: Minor
            Found in lib/onesignal/models/basic_notification_all_of.rb - About 2 days 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 394 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::NotificationWithMeta` initialize method"
                  end
            
            
            Severity: Major
            Found in lib/onesignal/models/notification_with_meta.rb - About 1 day to fix

              Method initialize has 362 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::Notification` initialize method"
                    end
              
              
              Severity: Major
              Found in lib/onesignal/models/notification.rb - About 1 day to fix

                Method initialize has 359 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::BasicNotification` initialize method"
                      end
                
                
                Severity: Major
                Found in lib/onesignal/models/basic_notification.rb - About 1 day to fix

                  Method initialize has 293 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::BasicNotificationAllOf` initialize method"
                        end
                  
                  
                  Severity: Major
                  Found in lib/onesignal/models/basic_notification_all_of.rb - About 1 day to fix

                    Class DefaultApi has 75 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                      class DefaultApi
                        attr_accessor :api_client
                    
                        def initialize(api_client = ApiClient.default)
                          @api_client = api_client
                    Severity: Major
                    Found in lib/onesignal/api/default_api.rb - About 1 day to fix

                      Method find_and_cast_into_type has a Cognitive Complexity of 56 (exceeds 5 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 day 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 a Cognitive Complexity of 46 (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::StringMap` initialize method"
                            end
                      
                      
                      Severity: Minor
                      Found in lib/onesignal/models/string_map.rb - About 7 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

                      File string_map.rb has 436 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      require 'date'
                      require 'time'
                      
                      module OneSignal
                        class StringMap
                      Severity: Minor
                      Found in lib/onesignal/models/string_map.rb - About 6 hrs to fix

                        Method initialize has a Cognitive Complexity of 41 (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::NotificationTarget` initialize method"
                              end
                        
                        
                        Severity: Minor
                        Found in lib/onesignal/models/notification_target.rb - About 6 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

                        File app.rb has 416 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        require 'date'
                        require 'time'
                        
                        module OneSignal
                          class App
                        Severity: Minor
                        Found in lib/onesignal/models/app.rb - About 6 hrs to fix

                          Method initialize has a Cognitive Complexity of 37 (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::App` initialize method"
                                end
                          
                          
                          Severity: Minor
                          Found in lib/onesignal/models/app.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

                          Severity
                          Category
                          Status
                          Source
                          Language