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
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
- Read upRead up
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
- Read upRead up
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
- Read upRead up
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
File notification.rb
has 1044 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'date'
require 'time'
module OneSignal
class Notification
File basic_notification.rb
has 1036 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'date'
require 'time'
module OneSignal
class BasicNotification
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
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
- Read upRead up
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
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
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
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
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
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'
- Read upRead up
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
- Read upRead up
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
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
- Read upRead up
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
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
- Read upRead up
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"