SpeciesFileGroup/taxonworks

View on GitHub
app/models/geographic_item/geometry_collection.rb

Summary

Maintainability
A
1 hr
Test Coverage

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

  def to_hash(geometry_collection)
    data = {
      points:   [],
      lines:    [],
      polygons: []

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 to_hash has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def to_hash(geometry_collection)
    data = {
      points:   [],
      lines:    [],
      polygons: []
Severity: Minor
Found in app/models/geographic_item/geometry_collection.rb - About 1 hr to fix

    Prefer the new style validations validates :column, presence: value over validates_presence_of.
    Open

      validates_presence_of :geometry_collection

    This cop checks for the use of old-style attribute validation macros.

    Example:

    # bad
    validates_acceptance_of :foo
    validates_confirmation_of :foo
    validates_exclusion_of :foo
    validates_format_of :foo
    validates_inclusion_of :foo
    validates_length_of :foo
    validates_numericality_of :foo
    validates_presence_of :foo
    validates_absence_of :foo
    validates_size_of :foo
    validates_uniqueness_of :foo
    
    # good
    validates :foo, acceptance: true
    validates :foo, confirmation: true
    validates :foo, exclusion: true
    validates :foo, format: true
    validates :foo, inclusion: true
    validates :foo, length: true
    validates :foo, numericality: true
    validates :foo, presence: true
    validates :foo, absence: true
    validates :foo, size: true
    validates :foo, uniqueness: true

    There are no issues that match your filters.

    Category
    Status