SpeciesFileGroup/taxonworks

View on GitHub
app/models/geographic_item.rb

Summary

Maintainability
F
5 days
Test Coverage

Possible SQL injection
Open

      GeographicItem.find_by_sql(q1).first.r
Severity: Critical
Found in app/models/geographic_item.rb by brakeman

Injection is #1 on the 2013 OWASP Top Ten web security risks. SQL injection is when a user is able to manipulate a value which is used unsafely inside a SQL query. This can lead to data leaks, data loss, elevation of privilege, and other unpleasant outcomes.

Brakeman focuses on ActiveRecord methods dealing with building SQL statements.

A basic (Rails 2.x) example looks like this:

User.first(:conditions => "username = '#{params[:username]}'")

Brakeman would produce a warning like this:

Possible SQL injection near line 30: User.first(:conditions => ("username = '#{params[:username]}'"))

The safe way to do this query is to use a parameterized query:

User.first(:conditions => ["username = ?", params[:username]])

Brakeman also understands the new Rails 3.x way of doing things (and local variables and concatenation):

username = params[:user][:name].downcase
password = params[:user][:password]

User.first.where("username = '" + username + "' AND password = '" + password + "'")

This results in this kind of warning:

Possible SQL injection near line 37:
User.first.where((((("username = '" + params[:user][:name].downcase) + "' AND password = '") + params[:user][:password]) + "'"))

See the Ruby Security Guide for more information and Rails-SQLi.org for many examples of SQL injection in Rails.

Possible SQL injection
Open

          where(q) # .not_including(geographic_items)
Severity: Minor
Found in app/models/geographic_item.rb by brakeman

Injection is #1 on the 2013 OWASP Top Ten web security risks. SQL injection is when a user is able to manipulate a value which is used unsafely inside a SQL query. This can lead to data leaks, data loss, elevation of privilege, and other unpleasant outcomes.

Brakeman focuses on ActiveRecord methods dealing with building SQL statements.

A basic (Rails 2.x) example looks like this:

User.first(:conditions => "username = '#{params[:username]}'")

Brakeman would produce a warning like this:

Possible SQL injection near line 30: User.first(:conditions => ("username = '#{params[:username]}'"))

The safe way to do this query is to use a parameterized query:

User.first(:conditions => ["username = ?", params[:username]])

Brakeman also understands the new Rails 3.x way of doing things (and local variables and concatenation):

username = params[:user][:name].downcase
password = params[:user][:password]

User.first.where("username = '" + username + "' AND password = '" + password + "'")

This results in this kind of warning:

Possible SQL injection near line 37:
User.first.where((((("username = '" + params[:user][:name].downcase) + "' AND password = '") + params[:user][:password]) + "'"))

See the Ruby Security Guide for more information and Rails-SQLi.org for many examples of SQL injection in Rails.

Possible SQL injection
Open

        "SELECT ST_AsGeoJSON(#{geo_object_type}::geometry) a " \
Severity: Minor
Found in app/models/geographic_item.rb by brakeman

Injection is #1 on the 2013 OWASP Top Ten web security risks. SQL injection is when a user is able to manipulate a value which is used unsafely inside a SQL query. This can lead to data leaks, data loss, elevation of privilege, and other unpleasant outcomes.

Brakeman focuses on ActiveRecord methods dealing with building SQL statements.

A basic (Rails 2.x) example looks like this:

User.first(:conditions => "username = '#{params[:username]}'")

Brakeman would produce a warning like this:

Possible SQL injection near line 30: User.first(:conditions => ("username = '#{params[:username]}'"))

The safe way to do this query is to use a parameterized query:

User.first(:conditions => ["username = ?", params[:username]])

Brakeman also understands the new Rails 3.x way of doing things (and local variables and concatenation):

username = params[:user][:name].downcase
password = params[:user][:password]

User.first.where("username = '" + username + "' AND password = '" + password + "'")

This results in this kind of warning:

Possible SQL injection near line 37:
User.first.where((((("username = '" + params[:user][:name].downcase) + "' AND password = '") + params[:user][:password]) + "'"))

See the Ruby Security Guide for more information and Rails-SQLi.org for many examples of SQL injection in Rails.

Possible SQL injection
Open

      order(Arel.sql("ST_Area(#{GeographicItem::GEOMETRY_SQL.to_sql}) #{direction}"))
Severity: Minor
Found in app/models/geographic_item.rb by brakeman

Injection is #1 on the 2013 OWASP Top Ten web security risks. SQL injection is when a user is able to manipulate a value which is used unsafely inside a SQL query. This can lead to data leaks, data loss, elevation of privilege, and other unpleasant outcomes.

Brakeman focuses on ActiveRecord methods dealing with building SQL statements.

A basic (Rails 2.x) example looks like this:

User.first(:conditions => "username = '#{params[:username]}'")

Brakeman would produce a warning like this:

Possible SQL injection near line 30: User.first(:conditions => ("username = '#{params[:username]}'"))

The safe way to do this query is to use a parameterized query:

User.first(:conditions => ["username = ?", params[:username]])

Brakeman also understands the new Rails 3.x way of doing things (and local variables and concatenation):

username = params[:user][:name].downcase
password = params[:user][:password]

User.first.where("username = '" + username + "' AND password = '" + password + "'")

This results in this kind of warning:

Possible SQL injection near line 37:
User.first.where((((("username = '" + params[:user][:name].downcase) + "' AND password = '") + params[:user][:password]) + "'"))

See the Ruby Security Guide for more information and Rails-SQLi.org for many examples of SQL injection in Rails.

Possible SQL injection
Open

      where("#{column_name} is not null and ST_Distance(#{column_name}, " \
Severity: Minor
Found in app/models/geographic_item.rb by brakeman

Injection is #1 on the 2013 OWASP Top Ten web security risks. SQL injection is when a user is able to manipulate a value which is used unsafely inside a SQL query. This can lead to data leaks, data loss, elevation of privilege, and other unpleasant outcomes.

Brakeman focuses on ActiveRecord methods dealing with building SQL statements.

A basic (Rails 2.x) example looks like this:

User.first(:conditions => "username = '#{params[:username]}'")

Brakeman would produce a warning like this:

Possible SQL injection near line 30: User.first(:conditions => ("username = '#{params[:username]}'"))

The safe way to do this query is to use a parameterized query:

User.first(:conditions => ["username = ?", params[:username]])

Brakeman also understands the new Rails 3.x way of doing things (and local variables and concatenation):

username = params[:user][:name].downcase
password = params[:user][:password]

User.first.where("username = '" + username + "' AND password = '" + password + "'")

This results in this kind of warning:

Possible SQL injection near line 37:
User.first.where((((("username = '" + params[:user][:name].downcase) + "' AND password = '") + params[:user][:password]) + "'"))

See the Ruby Security Guide for more information and Rails-SQLi.org for many examples of SQL injection in Rails.

File geographic_item.rb has 768 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'rgeo'

# A GeographicItem is one and only one of [point, line_string, polygon, multi_point, multi_line_string,
# multi_polygon, geometry_collection] which describes a position, path, or area on the globe, generally associated
# with a geographic_area (through a geographic_area_geographic_item entry), and sometimes only with a georeference.
Severity: Major
Found in app/models/geographic_item.rb - About 1 day to fix

    Class GeographicItem has 90 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class GeographicItem < ApplicationRecord
      include Housekeeping::Users
      include Housekeeping::Timestamps
      include Shared::IsData
      include Shared::SharedAcrossProjects
    Severity: Major
    Found in app/models/geographic_item.rb - About 1 day to fix

      Method has too many lines. [26/25]
      Open

          def gather_geographic_area_or_shape_data(geographic_area_ids, shape_in, search_object_class, project_id)
            if shape_in.blank?
              # get the shape from the geographic area, if possible
              finding = search_object_class.constantize
              target_geographic_item_ids = []
      Severity: Minor
      Found in app/models/geographic_item.rb by rubocop

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Method gather_geographic_area_or_shape_data has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          def gather_geographic_area_or_shape_data(geographic_area_ids, shape_in, search_object_class, project_id)
            if shape_in.blank?
              # get the shape from the geographic area, if possible
              finding = search_object_class.constantize
              target_geographic_item_ids = []
      Severity: Minor
      Found in app/models/geographic_item.rb - About 1 hr 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 are_contained_in_item_by_id has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def are_contained_in_item_by_id(column_name, *geographic_item_ids) # = containing
            geographic_item_ids.flatten! # in case there is a array of arrays, or multiple objects
            column_name.downcase!
            case column_name
              when 'any'
      Severity: Minor
      Found in app/models/geographic_item.rb - About 1 hr to fix

        Method is_contained_by_sql has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def is_contained_by_sql(column_name, geographic_item)
              geo_id = geographic_item.id
              geo_type = geographic_item.geo_object_type
              template = '(ST_Contains((select geographic_items.%s::geometry from geographic_items where ' \
                              'geographic_items.id = %d), %s::geometry))'
        Severity: Minor
        Found in app/models/geographic_item.rb - About 1 hr 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 are_contained_in_item_by_id has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def are_contained_in_item_by_id(column_name, *geographic_item_ids) # = containing
              geographic_item_ids.flatten! # in case there is a array of arrays, or multiple objects
              column_name.downcase!
              case column_name
                when 'any'
        Severity: Minor
        Found in app/models/geographic_item.rb - About 1 hr 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 is_contained_by has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def is_contained_by(column_name, *geographic_items)
              column_name.downcase!
              case column_name
                when 'any'
                  part = []
        Severity: Minor
        Found in app/models/geographic_item.rb - About 1 hr to fix

          Method is_contained_by_sql has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def is_contained_by_sql(column_name, geographic_item)
                geo_id = geographic_item.id
                geo_type = geographic_item.geo_object_type
                template = '(ST_Contains((select geographic_items.%s::geometry from geographic_items where ' \
                                'geographic_items.id = %d), %s::geometry))'
          Severity: Minor
          Found in app/models/geographic_item.rb - About 1 hr to fix

            Method gather_geographic_area_or_shape_data has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def gather_geographic_area_or_shape_data(geographic_area_ids, shape_in, search_object_class, project_id)
                  if shape_in.blank?
                    # get the shape from the geographic area, if possible
                    finding = search_object_class.constantize
                    target_geographic_item_ids = []
            Severity: Minor
            Found in app/models/geographic_item.rb - About 1 hr to fix

              Method is_contained_by has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  def is_contained_by(column_name, *geographic_items)
                    column_name.downcase!
                    case column_name
                      when 'any'
                        part = []
              Severity: Minor
              Found in app/models/geographic_item.rb - About 55 mins 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 are_contained_in_wkt has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

                  def are_contained_in_wkt(column_name, geometry)
                    column_name.downcase!
                    # column_name = 'point'
                    case column_name
                      when 'any'
              Severity: Minor
              Found in app/models/geographic_item.rb - About 45 mins 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 shape= has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                def shape=(value)
                  unless value.blank?
                    geom = RGeo::GeoJSON.decode(value, json_parser: :json)
                    this_type = JSON.parse(value)['geometry']['type']
              
              
              Severity: Minor
              Found in app/models/geographic_item.rb - About 35 mins 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 gather_map_data has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def gather_map_data(feature, search_object_class, project_id)
                    finding = search_object_class.constantize
                    g_feature = RGeo::GeoJSON.decode(feature, json_parser: :json)
                    if g_feature.nil?
                      finding.none
              Severity: Minor
              Found in app/models/geographic_item.rb - About 35 mins 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

              Specify a :dependent option.
              Open

                has_many :georeferences
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop looks for has_many or has_one associations that don't specify a :dependent option. It doesn't register an offense if :through option was specified.

              Example:

              # bad
              class User < ActiveRecord::Base
                has_many :comments
                has_one :avatar
              end
              
              # good
              class User < ActiveRecord::Base
                has_many :comments, dependent: :restrict_with_exception
                has_one :avatar, dependent: :destroy
                has_many :patients, through: :appointments
              end

              Specify an :inverse_of option.
              Open

                has_many :georeferences_through_error_geographic_item,
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop looks for has(one|many) and belongsto associations where Active Record can't automatically determine the inverse association because of a scope or the options used. Using the blog with order scope example below, traversing the a Blog's association in both directions with blog.posts.first.blog would cause the blog to be loaded from the database twice.

              :inverse_of must be manually specified for Active Record to use the associated object in memory, or set to false to opt-out. Note that setting nil does not stop Active Record from trying to determine the inverse automatically, and is not considered a valid value for this.

              Example:

              # good
              class Blog < ApplicationRecord
                has_many :posts
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end

              Example:

              # bad
              class Blog < ApplicationRecord
                has_many :posts, -> { order(published_at: :desc) }
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end
              
              # good
              class Blog < ApplicationRecord
                has_many(:posts,
                         -> { order(published_at: :desc) },
                         inverse_of: :blog)
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end
              
              # good
              class Blog < ApplicationRecord
                with_options inverse_of: :blog do
                  has_many :posts, -> { order(published_at: :desc) }
                end
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end
              
              # good
              # When you don't want to use the inverse association.
              class Blog < ApplicationRecord
                has_many(:posts,
                         -> { order(published_at: :desc) },
                         inverse_of: false)
              end

              Example:

              # bad
              class Picture < ApplicationRecord
                belongs_to :imageable, polymorphic: true
              end
              
              class Employee < ApplicationRecord
                has_many :pictures, as: :imageable
              end
              
              class Product < ApplicationRecord
                has_many :pictures, as: :imageable
              end
              
              # good
              class Picture < ApplicationRecord
                belongs_to :imageable, polymorphic: true
              end
              
              class Employee < ApplicationRecord
                has_many :pictures, as: :imageable, inverse_of: :imageable
              end
              
              class Product < ApplicationRecord
                has_many :pictures, as: :imageable, inverse_of: :imageable
              end

              Example:

              # bad
              # However, RuboCop can not detect this pattern...
              class Physician < ApplicationRecord
                has_many :appointments
                has_many :patients, through: :appointments
              end
              
              class Appointment < ApplicationRecord
                belongs_to :physician
                belongs_to :patient
              end
              
              class Patient < ApplicationRecord
                has_many :appointments
                has_many :physicians, through: :appointments
              end
              
              # good
              class Physician < ApplicationRecord
                has_many :appointments
                has_many :patients, through: :appointments
              end
              
              class Appointment < ApplicationRecord
                belongs_to :physician, inverse_of: :appointments
                belongs_to :patient, inverse_of: :appointments
              end
              
              class Patient < ApplicationRecord
                has_many :appointments
                has_many :physicians, through: :appointments
              end

              @see https://guides.rubyonrails.org/association_basics.html#bi-directional-associations @see https://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#module-ActiveRecord::Associations::ClassMethods-label-Setting+Inverses

              Use if send(item).present? instead of unless send(item).blank?.
              Open

                    data.push(item) unless send(item).blank?
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop checks for code that can be written with simpler conditionals using Object#present? defined by Active Support.

              Interaction with Style/UnlessElse: The configuration of NotBlank will not produce an offense in the context of unless else if Style/UnlessElse is inabled. This is to prevent interference between the auto-correction of the two cops.

              Example: NotNilAndNotEmpty: true (default)

              # Converts usages of `!nil? && !empty?` to `present?`
              
              # bad
              !foo.nil? && !foo.empty?
              
              # bad
              foo != nil && !foo.empty?
              
              # good
              foo.present?

              Example: NotBlank: true (default)

              # Converts usages of `!blank?` to `present?`
              
              # bad
              !foo.blank?
              
              # bad
              not foo.blank?
              
              # good
              foo.present?

              Example: UnlessBlank: true (default)

              # Converts usages of `unless blank?` to `if present?`
              
              # bad
              something unless foo.blank?
              
              # good
              something if foo.present?

              Specify a :dependent option.
              Open

                has_many :georeferences_through_error_geographic_item,
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop looks for has_many or has_one associations that don't specify a :dependent option. It doesn't register an offense if :through option was specified.

              Example:

              # bad
              class User < ActiveRecord::Base
                has_many :comments
                has_one :avatar
              end
              
              # good
              class User < ActiveRecord::Base
                has_many :comments, dependent: :restrict_with_exception
                has_one :avatar, dependent: :destroy
                has_many :patients, through: :appointments
              end

              Specify a :dependent option.
              Open

                has_many :gadm_geographic_areas, class_name: 'GeographicArea', foreign_key: :gadm_geo_item_id
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop looks for has_many or has_one associations that don't specify a :dependent option. It doesn't register an offense if :through option was specified.

              Example:

              # bad
              class User < ActiveRecord::Base
                has_many :comments
                has_one :avatar
              end
              
              # good
              class User < ActiveRecord::Base
                has_many :comments, dependent: :restrict_with_exception
                has_one :avatar, dependent: :destroy
                has_many :patients, through: :appointments
              end

              Specify an :inverse_of option.
              Open

                has_many :ne_geographic_areas, class_name: 'GeographicArea', foreign_key: :ne_geo_item_id
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop looks for has(one|many) and belongsto associations where Active Record can't automatically determine the inverse association because of a scope or the options used. Using the blog with order scope example below, traversing the a Blog's association in both directions with blog.posts.first.blog would cause the blog to be loaded from the database twice.

              :inverse_of must be manually specified for Active Record to use the associated object in memory, or set to false to opt-out. Note that setting nil does not stop Active Record from trying to determine the inverse automatically, and is not considered a valid value for this.

              Example:

              # good
              class Blog < ApplicationRecord
                has_many :posts
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end

              Example:

              # bad
              class Blog < ApplicationRecord
                has_many :posts, -> { order(published_at: :desc) }
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end
              
              # good
              class Blog < ApplicationRecord
                has_many(:posts,
                         -> { order(published_at: :desc) },
                         inverse_of: :blog)
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end
              
              # good
              class Blog < ApplicationRecord
                with_options inverse_of: :blog do
                  has_many :posts, -> { order(published_at: :desc) }
                end
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end
              
              # good
              # When you don't want to use the inverse association.
              class Blog < ApplicationRecord
                has_many(:posts,
                         -> { order(published_at: :desc) },
                         inverse_of: false)
              end

              Example:

              # bad
              class Picture < ApplicationRecord
                belongs_to :imageable, polymorphic: true
              end
              
              class Employee < ApplicationRecord
                has_many :pictures, as: :imageable
              end
              
              class Product < ApplicationRecord
                has_many :pictures, as: :imageable
              end
              
              # good
              class Picture < ApplicationRecord
                belongs_to :imageable, polymorphic: true
              end
              
              class Employee < ApplicationRecord
                has_many :pictures, as: :imageable, inverse_of: :imageable
              end
              
              class Product < ApplicationRecord
                has_many :pictures, as: :imageable, inverse_of: :imageable
              end

              Example:

              # bad
              # However, RuboCop can not detect this pattern...
              class Physician < ApplicationRecord
                has_many :appointments
                has_many :patients, through: :appointments
              end
              
              class Appointment < ApplicationRecord
                belongs_to :physician
                belongs_to :patient
              end
              
              class Patient < ApplicationRecord
                has_many :appointments
                has_many :physicians, through: :appointments
              end
              
              # good
              class Physician < ApplicationRecord
                has_many :appointments
                has_many :patients, through: :appointments
              end
              
              class Appointment < ApplicationRecord
                belongs_to :physician, inverse_of: :appointments
                belongs_to :patient, inverse_of: :appointments
              end
              
              class Patient < ApplicationRecord
                has_many :appointments
                has_many :physicians, through: :appointments
              end

              @see https://guides.rubyonrails.org/association_basics.html#bi-directional-associations @see https://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#module-ActiveRecord::Associations::ClassMethods-label-Setting+Inverses

              Specify an :inverse_of option.
              Open

                has_many :tdwg_geographic_areas, class_name: 'GeographicArea', foreign_key: :tdwg_geo_item_id
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop looks for has(one|many) and belongsto associations where Active Record can't automatically determine the inverse association because of a scope or the options used. Using the blog with order scope example below, traversing the a Blog's association in both directions with blog.posts.first.blog would cause the blog to be loaded from the database twice.

              :inverse_of must be manually specified for Active Record to use the associated object in memory, or set to false to opt-out. Note that setting nil does not stop Active Record from trying to determine the inverse automatically, and is not considered a valid value for this.

              Example:

              # good
              class Blog < ApplicationRecord
                has_many :posts
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end

              Example:

              # bad
              class Blog < ApplicationRecord
                has_many :posts, -> { order(published_at: :desc) }
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end
              
              # good
              class Blog < ApplicationRecord
                has_many(:posts,
                         -> { order(published_at: :desc) },
                         inverse_of: :blog)
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end
              
              # good
              class Blog < ApplicationRecord
                with_options inverse_of: :blog do
                  has_many :posts, -> { order(published_at: :desc) }
                end
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end
              
              # good
              # When you don't want to use the inverse association.
              class Blog < ApplicationRecord
                has_many(:posts,
                         -> { order(published_at: :desc) },
                         inverse_of: false)
              end

              Example:

              # bad
              class Picture < ApplicationRecord
                belongs_to :imageable, polymorphic: true
              end
              
              class Employee < ApplicationRecord
                has_many :pictures, as: :imageable
              end
              
              class Product < ApplicationRecord
                has_many :pictures, as: :imageable
              end
              
              # good
              class Picture < ApplicationRecord
                belongs_to :imageable, polymorphic: true
              end
              
              class Employee < ApplicationRecord
                has_many :pictures, as: :imageable, inverse_of: :imageable
              end
              
              class Product < ApplicationRecord
                has_many :pictures, as: :imageable, inverse_of: :imageable
              end

              Example:

              # bad
              # However, RuboCop can not detect this pattern...
              class Physician < ApplicationRecord
                has_many :appointments
                has_many :patients, through: :appointments
              end
              
              class Appointment < ApplicationRecord
                belongs_to :physician
                belongs_to :patient
              end
              
              class Patient < ApplicationRecord
                has_many :appointments
                has_many :physicians, through: :appointments
              end
              
              # good
              class Physician < ApplicationRecord
                has_many :appointments
                has_many :patients, through: :appointments
              end
              
              class Appointment < ApplicationRecord
                belongs_to :physician, inverse_of: :appointments
                belongs_to :patient, inverse_of: :appointments
              end
              
              class Patient < ApplicationRecord
                has_many :appointments
                has_many :physicians, through: :appointments
              end

              @see https://guides.rubyonrails.org/association_basics.html#bi-directional-associations @see https://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#module-ActiveRecord::Associations::ClassMethods-label-Setting+Inverses

              Use if value.present? instead of unless value.blank?.
              Open

                  unless value.blank?
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop checks for code that can be written with simpler conditionals using Object#present? defined by Active Support.

              Interaction with Style/UnlessElse: The configuration of NotBlank will not produce an offense in the context of unless else if Style/UnlessElse is inabled. This is to prevent interference between the auto-correction of the two cops.

              Example: NotNilAndNotEmpty: true (default)

              # Converts usages of `!nil? && !empty?` to `present?`
              
              # bad
              !foo.nil? && !foo.empty?
              
              # bad
              foo != nil && !foo.empty?
              
              # good
              foo.present?

              Example: NotBlank: true (default)

              # Converts usages of `!blank?` to `present?`
              
              # bad
              !foo.blank?
              
              # bad
              not foo.blank?
              
              # good
              foo.present?

              Example: UnlessBlank: true (default)

              # Converts usages of `unless blank?` to `if present?`
              
              # bad
              something unless foo.blank?
              
              # good
              something if foo.present?

              Specify a :dependent option.
              Open

                has_many :ne_geographic_areas, class_name: 'GeographicArea', foreign_key: :ne_geo_item_id
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop looks for has_many or has_one associations that don't specify a :dependent option. It doesn't register an offense if :through option was specified.

              Example:

              # bad
              class User < ActiveRecord::Base
                has_many :comments
                has_one :avatar
              end
              
              # good
              class User < ActiveRecord::Base
                has_many :comments, dependent: :restrict_with_exception
                has_one :avatar, dependent: :destroy
                has_many :patients, through: :appointments
              end

              Specify a :dependent option.
              Open

                has_many :tdwg_geographic_areas, class_name: 'GeographicArea', foreign_key: :tdwg_geo_item_id
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop looks for has_many or has_one associations that don't specify a :dependent option. It doesn't register an offense if :through option was specified.

              Example:

              # bad
              class User < ActiveRecord::Base
                has_many :comments
                has_one :avatar
              end
              
              # good
              class User < ActiveRecord::Base
                has_many :comments, dependent: :restrict_with_exception
                has_one :avatar, dependent: :destroy
                has_many :patients, through: :appointments
              end

              Prefer self[:attr] = val over write_attribute(:attr, val).
              Open

                    write_attribute(this_type.underscore.to_sym, object)
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop checks for the use of the read_attribute or write_attribute methods and recommends square brackets instead.

              If an attribute is missing from the instance (for example, when initialized by a partial select) then read_attribute will return nil, but square brackets will raise an ActiveModel::MissingAttributeError.

              Explicitly raising an error in this situation is preferable, and that is why rubocop recommends using square brackets.

              Example:

              # bad
              x = read_attribute(:attr)
              write_attribute(:attr, val)
              
              # good
              x = self[:attr]
              self[:attr] = val

              Specify an :inverse_of option.
              Open

                has_many :gadm_geographic_areas, class_name: 'GeographicArea', foreign_key: :gadm_geo_item_id
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop looks for has(one|many) and belongsto associations where Active Record can't automatically determine the inverse association because of a scope or the options used. Using the blog with order scope example below, traversing the a Blog's association in both directions with blog.posts.first.blog would cause the blog to be loaded from the database twice.

              :inverse_of must be manually specified for Active Record to use the associated object in memory, or set to false to opt-out. Note that setting nil does not stop Active Record from trying to determine the inverse automatically, and is not considered a valid value for this.

              Example:

              # good
              class Blog < ApplicationRecord
                has_many :posts
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end

              Example:

              # bad
              class Blog < ApplicationRecord
                has_many :posts, -> { order(published_at: :desc) }
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end
              
              # good
              class Blog < ApplicationRecord
                has_many(:posts,
                         -> { order(published_at: :desc) },
                         inverse_of: :blog)
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end
              
              # good
              class Blog < ApplicationRecord
                with_options inverse_of: :blog do
                  has_many :posts, -> { order(published_at: :desc) }
                end
              end
              
              class Post < ApplicationRecord
                belongs_to :blog
              end
              
              # good
              # When you don't want to use the inverse association.
              class Blog < ApplicationRecord
                has_many(:posts,
                         -> { order(published_at: :desc) },
                         inverse_of: false)
              end

              Example:

              # bad
              class Picture < ApplicationRecord
                belongs_to :imageable, polymorphic: true
              end
              
              class Employee < ApplicationRecord
                has_many :pictures, as: :imageable
              end
              
              class Product < ApplicationRecord
                has_many :pictures, as: :imageable
              end
              
              # good
              class Picture < ApplicationRecord
                belongs_to :imageable, polymorphic: true
              end
              
              class Employee < ApplicationRecord
                has_many :pictures, as: :imageable, inverse_of: :imageable
              end
              
              class Product < ApplicationRecord
                has_many :pictures, as: :imageable, inverse_of: :imageable
              end

              Example:

              # bad
              # However, RuboCop can not detect this pattern...
              class Physician < ApplicationRecord
                has_many :appointments
                has_many :patients, through: :appointments
              end
              
              class Appointment < ApplicationRecord
                belongs_to :physician
                belongs_to :patient
              end
              
              class Patient < ApplicationRecord
                has_many :appointments
                has_many :physicians, through: :appointments
              end
              
              # good
              class Physician < ApplicationRecord
                has_many :appointments
                has_many :patients, through: :appointments
              end
              
              class Appointment < ApplicationRecord
                belongs_to :physician, inverse_of: :appointments
                belongs_to :patient, inverse_of: :appointments
              end
              
              class Patient < ApplicationRecord
                has_many :appointments
                has_many :physicians, through: :appointments
              end

              @see https://guides.rubyonrails.org/association_basics.html#bi-directional-associations @see https://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#module-ActiveRecord::Associations::ClassMethods-label-Setting+Inverses

              TODO found
              Open

                # !!TODO: migrate these to use native column calls
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                #  TODO:  Probably way to many decimals
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                        # TODO: There probably is a better way to do this, but for now...
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                  # TODO: test this
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                  # TODO: should this be wkt_point instead of rgeo_point?
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                # @TODO doesn't work?
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                # TODO: WHY! boolean not nil, or object
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                        # @TODO change 'id in (?)' to some other sql construct
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                    f = "'D.DDDDDD'" # TODO: probably a constant somewhere
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                  # TODO: should be containing_wkt ?
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                          # TODO: Figure out how to see through this group of geographic_items to the ones which contain
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                        # TODO: change 'id in (?)' to some other sql construct
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                        # TODO: change 'id in (?)' to some other sql construct
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                  # TODO: * rename to reflect either/or and what is being returned
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                  # TODO: Remove the hard coded 4326 reference
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                      # @TODO change 'id in (?)' to some other sql construct
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                        # TODO: change 'id in (?)' to some other sql construct
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                        # @TODO change 'id in (?)' to some other sql construct
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                  # TODO: Remove the hard coded 4326 reference
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                        # TODO: change 'id in (?)' to some other sql construct
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                    # TODO: @tuckerjd isn't this set automatically? Or perhaps the callback isn't hit in this approach?
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              TODO found
              Open

                  # TODO: handle other parts of the polygon; i.e., the interior_rings (if they exist)
              Severity: Minor
              Found in app/models/geographic_item.rb by fixme

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      when 'any'
                        part = []
                        DATA_TYPES.each { |column|
                          unless column == :geometry_collection
                            part.push(GeographicItem.is_contained_by(column.to_s, geographic_items).to_a)
              Severity: Minor
              Found in app/models/geographic_item.rb and 1 other location - About 25 mins to fix
              app/models/geographic_item.rb on lines 685..693

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 30.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      when 'any'
                        part = []
                        DATA_TYPES.each { |column|
                          unless column == :geometry_collection
                            part.push(GeographicItem.are_contained_in_item_by_id(column.to_s, geographic_item_ids).to_a)
              Severity: Minor
              Found in app/models/geographic_item.rb and 1 other location - About 25 mins to fix
              app/models/geographic_item.rb on lines 763..771

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 30.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                    c = geographic_items.join(g1, Arel::Nodes::OuterJoin).on(geographic_items[:id].eq(g1[:geographic_item_id]))
                            .join(g2, Arel::Nodes::OuterJoin).on(geographic_items[:id].eq(g2[:error_geographic_item_id]))
              Severity: Minor
              Found in app/models/geographic_item.rb and 1 other location - About 20 mins to fix
              app/models/otu.rb on lines 128..131

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 28.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Prefer symbols instead of strings as hash keys.
              Open

                   'properties' => {
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop checks for the use of strings as keys in hashes. The use of symbols is preferred instead.

              Example:

              # bad
              { 'one' => 1, 'two' => 2, 'three' => 3 }
              
              # good
              { one: 1, two: 2, three: 3 }

              Prefer single-quoted strings when you don't need string interpolation or special symbols.
              Open

                    .when('GeographicItem::Polygon').then(Arel::Nodes::NamedFunction.new("CAST", [arel_table[:polygon].as('geometry')]))
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              Checks if uses of quotes match the configured preference.

              Example: EnforcedStyle: single_quotes (default)

              # bad
              "No special symbols"
              "No string interpolation"
              "Just text"
              
              # good
              'No special symbols'
              'No string interpolation'
              'Just text'
              "Wait! What's #{this}!"

              Example: EnforcedStyle: double_quotes

              # bad
              'Just some text'
              'No special chars or interpolation'
              
              # good
              "Just some text"
              "No special chars or interpolation"
              "Every string in #{project} uses double_quotes"

              Prefer single-quoted strings when you don't need string interpolation or special symbols.
              Open

                    .when('GeographicItem::MultiLineString').then(Arel::Nodes::NamedFunction.new("CAST", [arel_table[:multi_line_string].as('geometry')]))
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              Checks if uses of quotes match the configured preference.

              Example: EnforcedStyle: single_quotes (default)

              # bad
              "No special symbols"
              "No string interpolation"
              "Just text"
              
              # good
              'No special symbols'
              'No string interpolation'
              'Just text'
              "Wait! What's #{this}!"

              Example: EnforcedStyle: double_quotes

              # bad
              'Just some text'
              'No special chars or interpolation'
              
              # good
              "Just some text"
              "No special chars or interpolation"
              "Every string in #{project} uses double_quotes"

              Prefer symbols instead of strings as hash keys.
              Open

                       'id' => id}
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop checks for the use of strings as keys in hashes. The use of symbols is preferred instead.

              Example:

              # bad
              { 'one' => 1, 'two' => 2, 'three' => 3 }
              
              # good
              { one: 1, two: 2, three: 3 }

              Prefer symbols instead of strings as hash keys.
              Open

                   'geometry' => geometry,
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop checks for the use of strings as keys in hashes. The use of symbols is preferred instead.

              Example:

              # bad
              { 'one' => 1, 'two' => 2, 'three' => 3 }
              
              # good
              { one: 1, two: 2, three: 3 }

              Prefer symbols instead of strings as hash keys.
              Open

                  {'type' => 'Feature',
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop checks for the use of strings as keys in hashes. The use of symbols is preferred instead.

              Example:

              # bad
              { 'one' => 1, 'two' => 2, 'three' => 3 }
              
              # good
              { one: 1, two: 2, three: 3 }

              Prefer symbols instead of strings as hash keys.
              Open

                     'geographic_item' => {
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop checks for the use of strings as keys in hashes. The use of symbols is preferred instead.

              Example:

              # bad
              { 'one' => 1, 'two' => 2, 'three' => 3 }
              
              # good
              { one: 1, two: 2, three: 3 }

              Prefer single-quoted strings when you don't need string interpolation or special symbols.
              Open

                    .when('GeographicItem::MultiPolygon').then(Arel::Nodes::NamedFunction.new("CAST", [arel_table[:multi_polygon].as('geometry')]))
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              Checks if uses of quotes match the configured preference.

              Example: EnforcedStyle: single_quotes (default)

              # bad
              "No special symbols"
              "No string interpolation"
              "Just text"
              
              # good
              'No special symbols'
              'No string interpolation'
              'Just text'
              "Wait! What's #{this}!"

              Example: EnforcedStyle: double_quotes

              # bad
              'Just some text'
              'No special chars or interpolation'
              
              # good
              "Just some text"
              "No special chars or interpolation"
              "Every string in #{project} uses double_quotes"

              Prefer single-quoted strings when you don't need string interpolation or special symbols.
              Open

                    .when('GeographicItem::LineString').then(Arel::Nodes::NamedFunction.new("CAST", [arel_table[:line_string].as('geometry')]))
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              Checks if uses of quotes match the configured preference.

              Example: EnforcedStyle: single_quotes (default)

              # bad
              "No special symbols"
              "No string interpolation"
              "Just text"
              
              # good
              'No special symbols'
              'No string interpolation'
              'Just text'
              "Wait! What's #{this}!"

              Example: EnforcedStyle: double_quotes

              # bad
              'Just some text'
              'No special chars or interpolation'
              
              # good
              "Just some text"
              "No special chars or interpolation"
              "Every string in #{project} uses double_quotes"

              Use 2 (not 4) spaces for indentation.
              Open

                  GEOGRAPHY_SQL = "CASE geographic_items.type
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop checks for indentation that doesn't use the specified number of spaces.

              See also the IndentationConsistency cop which is the companion to this one.

              Example:

              # bad
              class A
               def test
                puts 'hello'
               end
              end
              
              # good
              class A
                def test
                  puts 'hello'
                end
              end

              Example: IgnoredPatterns: ['^\s*module']

              # bad
              module A
              class B
                def test
                puts 'hello'
                end
              end
              end
              
              # good
              module A
              class B
                def test
                  puts 'hello'
                end
              end
              end

              Prefer single-quoted strings when you don't need string interpolation or special symbols.
              Open

                    .when('GeographicItem::GeometryCollection').then(Arel::Nodes::NamedFunction.new("CAST", [arel_table[:geometry_collection].as('geometry')]))
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              Checks if uses of quotes match the configured preference.

              Example: EnforcedStyle: single_quotes (default)

              # bad
              "No special symbols"
              "No string interpolation"
              "Just text"
              
              # good
              'No special symbols'
              'No string interpolation'
              'Just text'
              "Wait! What's #{this}!"

              Example: EnforcedStyle: double_quotes

              # bad
              'Just some text'
              'No special chars or interpolation'
              
              # good
              "Just some text"
              "No special chars or interpolation"
              "Every string in #{project} uses double_quotes"

              Prefer single-quoted strings when you don't need string interpolation or special symbols.
              Open

                    .when('GeographicItem::MultiPoint').then(Arel::Nodes::NamedFunction.new("CAST", [arel_table[:multi_point].as('geometry')]))
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              Checks if uses of quotes match the configured preference.

              Example: EnforcedStyle: single_quotes (default)

              # bad
              "No special symbols"
              "No string interpolation"
              "Just text"
              
              # good
              'No special symbols'
              'No string interpolation'
              'Just text'
              "Wait! What's #{this}!"

              Example: EnforcedStyle: double_quotes

              # bad
              'Just some text'
              'No special chars or interpolation'
              
              # good
              "Just some text"
              "No special chars or interpolation"
              "Every string in #{project} uses double_quotes"

              Use 2 (not 4) spaces for indentation.
              Open

                  GEOMETRY_SQL = Arel::Nodes::Case.new(arel_table[:type])
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              This cop checks for indentation that doesn't use the specified number of spaces.

              See also the IndentationConsistency cop which is the companion to this one.

              Example:

              # bad
              class A
               def test
                puts 'hello'
               end
              end
              
              # good
              class A
                def test
                  puts 'hello'
                end
              end

              Example: IgnoredPatterns: ['^\s*module']

              # bad
              module A
              class B
                def test
                puts 'hello'
                end
              end
              end
              
              # good
              module A
              class B
                def test
                  puts 'hello'
                end
              end
              end

              Prefer single-quoted strings when you don't need string interpolation or special symbols.
              Open

                    .when('GeographicItem::Point').then(Arel::Nodes::NamedFunction.new("CAST", [arel_table[:point].as('geometry')]))
              Severity: Minor
              Found in app/models/geographic_item.rb by rubocop

              Checks if uses of quotes match the configured preference.

              Example: EnforcedStyle: single_quotes (default)

              # bad
              "No special symbols"
              "No string interpolation"
              "Just text"
              
              # good
              'No special symbols'
              'No string interpolation'
              'Just text'
              "Wait! What's #{this}!"

              Example: EnforcedStyle: double_quotes

              # bad
              'Just some text'
              'No special chars or interpolation'
              
              # good
              "Just some text"
              "No special chars or interpolation"
              "Every string in #{project} uses double_quotes"

              There are no issues that match your filters.

              Category
              Status