Line #56 –
convention:
Rails/SkipsModelValidations: Avoid using insert_all
because it skips validations.
Planet.insert_all(planets)
Line #106 –
convention:
Metrics/AbcSize: Assignment Branch Condition size for create_specific_resources is too high. [<7, 18, 4> 19.72/17]
def create_specific_resources(name, patch_factor, part_of_map)
Line #106 –
convention:
Metrics/MethodLength: Method has too many lines. [25/20]
def create_specific_resources(name, patch_factor, part_of_map)
Line #117 –
convention:
Style/IfUnlessModifier: Favor modifier if
usage when having a single-line body. Another good alternative is the usage of control flow &&
/||
.
if num_planets < 1
Line #131 –
convention:
Rails/TimeZone: Do not use Time.now
without zone. Use one of Time.zone.now
, Time.current
, Time.now.in_time_zone
, Time.now.utc
, Time.now.getlocal
, Time.now.xmlschema
, Time.now.iso8601
, Time.now.jisx0301
, Time.now.rfc3339
, Time.now.httpdate
, Time.now.to_i
, Time.now.to_f
instead.
created_at: Time.now,
Line #132 –
convention:
Rails/TimeZone: Do not use Time.now
without zone. Use one of Time.zone.now
, Time.current
, Time.now.in_time_zone
, Time.now.utc
, Time.now.getlocal
, Time.now.xmlschema
, Time.now.iso8601
, Time.now.jisx0301
, Time.now.rfc3339
, Time.now.httpdate
, Time.now.to_i
, Time.now.to_f
instead.
updated_at: Time.now}
Line #135 –
convention:
Rails/SkipsModelValidations: Avoid using insert_all
because it skips validations.
Resource.insert_all(resources)
Line #138 –
warning:
Lint/UnusedMethodArgument: Unused method argument - planets
. If it's necessary, use _
or _planets
as an argument name to indicate that it won't be used. If it's unnecessary, remove it. You can also write as generate_resource_distribution_quotas(*)
if you want the method to accept any arguments but don't care about them.
def generate_resource_distribution_quotas(planets)
Line #140 –
convention:
Layout/LineLength: Line is too long. [122/120]
{patch_factor: Rails.application.config.gameworld_coal_patch_factor || 0.8, name: "coal", part_of_map: :outer_map?},
Line #143 –
convention:
Layout/LineLength: Line is too long. [122/120]
{patch_factor: Rails.application.config.gameworld_gold_patch_factor || 0.2, name: "gold", part_of_map: :inner_map?},
Line #144 –
convention:
Layout/LineLength: Line is too long. [125/120]
{patch_factor: Rails.application.config.gameworld_platin_patch_factor || 0.1, name: "platin", part_of_map: :inner_map?}
Line #157 –
convention:
Rails/TimeZone: Do not use Time.now
without zone. Use one of Time.zone.now
, Time.current
, Time.now.in_time_zone
, Time.now.utc
, Time.now.getlocal
, Time.now.xmlschema
, Time.now.iso8601
, Time.now.jisx0301
, Time.now.rfc3339
, Time.now.httpdate
, Time.now.to_i
, Time.now.to_f
instead.
created_at: Time.now,
Line #158 –
convention:
Rails/TimeZone: Do not use Time.now
without zone. Use one of Time.zone.now
, Time.current
, Time.now.in_time_zone
, Time.now.utc
, Time.now.getlocal
, Time.now.xmlschema
, Time.now.iso8601
, Time.now.jisx0301
, Time.now.rfc3339
, Time.now.httpdate
, Time.now.to_i
, Time.now.to_f
instead.
updated_at: Time.now,
Line #193 –
convention:
Rails/TimeZone: Do not use Time.now
without zone. Use one of Time.zone.now
, Time.current
, Time.now.in_time_zone
, Time.now.utc
, Time.now.getlocal
, Time.now.xmlschema
, Time.now.iso8601
, Time.now.jisx0301
, Time.now.rfc3339
, Time.now.httpdate
, Time.now.to_i
, Time.now.to_f
instead.
planet[:deleted_at] = Time.now if deleted_planets.include?([planet[:x], planet[:y]])