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
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',
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',
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
File subscription_object.rb
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'date'
require 'time'
module OneSignal
class SubscriptionObject
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
- 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 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
File player_notification_target.rb
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'date'
require 'time'
module OneSignal
class PlayerNotificationTarget
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
- 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 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
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
Method attribute_map
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.attribute_map
{
:'en' => :'en',
:'ar' => :'ar',
:'bs' => :'bs',
Method openapi_types
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.openapi_types
{
:'en' => :'String',
:'ar' => :'String',
:'bs' => :'String',
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 &&
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
- 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 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'
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
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
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
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