SpeciesFileGroup/taxonworks

View on GitHub
lib/utilities/geo.rb

Summary

Maintainability
F
6 days
Test Coverage

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

    def self.coordinates_regex_from_verbatim_label(text)
      return nil if text.blank?
      text = ' ' + text + ' '
      text.gsub("''", '"')
          .gsub("´´", '"')
Severity: Minor
Found in lib/utilities/geo.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.

File geo.rb has 493 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Utilities
  # Special general routines for Geo-specific itams
  module Geo
=begin
To add a new (discovered) symbol:
Severity: Minor
Found in lib/utilities/geo.rb - About 7 hrs to fix

    Method coordinates_regex_from_verbatim_label has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.coordinates_regex_from_verbatim_label(text)
          return nil if text.blank?
          text = ' ' + text + ' '
          text.gsub("''", '"')
              .gsub("´´", '"')
    Severity: Minor
    Found in lib/utilities/geo.rb - About 6 hrs 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 has too many lines. [54/25]
    Open

        def self.significant_digits(number_string)
          # is there a decimal point?
          intg = ''
          decimal_point_zeros = ''
          mantissa = ''
    Severity: Minor
    Found in lib/utilities/geo.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 coordinates_regex_from_verbatim_label has 107 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def self.coordinates_regex_from_verbatim_label(text)
          return nil if text.blank?
          text = ' ' + text + ' '
          text.gsub("''", '"')
              .gsub("´´", '"')
    Severity: Major
    Found in lib/utilities/geo.rb - About 4 hrs to fix

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

          def self.conform_significant(number, sig_digits)
            input = significant_digits(number.to_s)
            input_string = input[0]
            intg = input[2]
            decimal_point = input[3]
      Severity: Minor
      Found in lib/utilities/geo.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 significant_digits has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          def self.significant_digits(number_string)
            # is there a decimal point?
            intg = ''
            decimal_point_zeros = ''
            mantissa = ''
      Severity: Minor
      Found in lib/utilities/geo.rb - About 3 hrs 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 conform_significant has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

          def self.conform_significant(number, sig_digits)
            input = significant_digits(number.to_s)
            input_string = input[0]
            intg = input[2]
            decimal_point = input[3]
      Severity: Minor
      Found in lib/utilities/geo.rb - About 3 hrs 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 hunt_lat_long has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          def self.hunt_lat_long(label, how = ' ')
            if how.nil?
              pieces = [label]
            else
              pieces = label.split(how)
      Severity: Minor
      Found in lib/utilities/geo.rb - About 3 hrs 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 degrees_minutes_seconds_to_decimal_degrees has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          def self.degrees_minutes_seconds_to_decimal_degrees(dms_in) # rubocop:disable Metrics/PerceivedComplexity !! But this is too complex :)
            match_string = nil
            # no_point     = false
            degrees      = 0.0
            minutes      = 0.0
      Severity: Minor
      Found in lib/utilities/geo.rb - About 2 hrs 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 degrees_minutes_seconds_to_decimal_degrees has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def self.degrees_minutes_seconds_to_decimal_degrees(dms_in) # rubocop:disable Metrics/PerceivedComplexity !! But this is too complex :)
            match_string = nil
            # no_point     = false
            degrees      = 0.0
            minutes      = 0.0
      Severity: Major
      Found in lib/utilities/geo.rb - About 2 hrs to fix

        Method significant_digits has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def self.significant_digits(number_string)
              # is there a decimal point?
              intg = ''
              decimal_point_zeros = ''
              mantissa = ''
        Severity: Major
        Found in lib/utilities/geo.rb - About 2 hrs to fix

          Method conform_significant has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def self.conform_significant(number, sig_digits)
                input = significant_digits(number.to_s)
                input_string = input[0]
                intg = input[2]
                decimal_point = input[3]
          Severity: Minor
          Found in lib/utilities/geo.rb - About 1 hr to fix

            Method distance_in_meters has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                def self.distance_in_meters(dist_in)
                  dist_in   = '0.0 meters' if dist_in.blank?
                  elevation = dist_in.strip.downcase
                  pieces    = elevation.split(' ')
                  # value     = elevation.to_f
            Severity: Minor
            Found in lib/utilities/geo.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 nearby_from_params has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def self.nearby_from_params(params)
                  nearby_distance = params['nearby_distance'].to_i
                  nearby_distance = CollectingEvent::NEARBY_DISTANCE if nearby_distance == 0
            
                  decade = case nearby_distance.to_s.length
            Severity: Minor
            Found in lib/utilities/geo.rb - About 1 hr to fix

              Method hunt_lat_long has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def self.hunt_lat_long(label, how = ' ')
                    if how.nil?
                      pieces = [label]
                    else
                      pieces = label.split(how)
              Severity: Minor
              Found in lib/utilities/geo.rb - About 1 hr to fix

                Avoid too many return statements within this method.
                Open

                      return {} if coordinates[:long_min].to_f >= 60
                Severity: Major
                Found in lib/utilities/geo.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                        return c
                  Severity: Major
                  Found in lib/utilities/geo.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                          return {} if coordinates[:long_sec].to_f >= 60
                    Severity: Major
                    Found in lib/utilities/geo.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                            return {} if coordinates[:long_deg].to_f > 180 || coordinates[:long_deg].to_f < -180
                      Severity: Major
                      Found in lib/utilities/geo.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                              return {} if coordinates[:lat_sec].to_f >= 60
                        Severity: Major
                        Found in lib/utilities/geo.rb - About 30 mins to fix

                          Avoid more than 3 levels of block nesting.
                          Open

                                      if decimal_position < sig_digits
                                        result.insert(decimal_position, decimal_point)
                                      end
                          Severity: Minor
                          Found in lib/utilities/geo.rb by rubocop

                          This cop checks for excessive nesting of conditional and looping constructs.

                          You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

                          The maximum level of nesting allowed is configurable.

                          Avoid more than 3 levels of block nesting.
                          Open

                                      if intg.nil?
                                        intg = digits[0]
                                      end
                          Severity: Minor
                          Found in lib/utilities/geo.rb by rubocop

                          This cop checks for excessive nesting of conditional and looping constructs.

                          You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

                          The maximum level of nesting allowed is configurable.

                          Avoid more than 3 levels of block nesting.
                          Open

                                      if digit_string[index + 1].to_i >= 5
                                        result = (result.to_i + 1).to_s # round if necessary
                                      end
                          Severity: Minor
                          Found in lib/utilities/geo.rb by rubocop

                          This cop checks for excessive nesting of conditional and looping constructs.

                          You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

                          The maximum level of nesting allowed is configurable.

                          Avoid more than 3 levels of block nesting.
                          Open

                                      if intg.length > 0  # have full case nn.mm
                                        sig = intg.length + mantissa.length
                                      else  # mantissa might have "leading" zeros
                                        decimal_lead_zeros = digits[1].length
                                        mantissa = digits[1].sub(/^[0]+/, '')
                          Severity: Minor
                          Found in lib/utilities/geo.rb by rubocop

                          This cop checks for excessive nesting of conditional and looping constructs.

                          You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

                          The maximum level of nesting allowed is configurable.

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

                                scale = 1 unless m.blank?    # previously 1.0
                          Severity: Minor
                          Found in lib/utilities/geo.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?

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

                                scale = 1_609.344 unless mi.blank?
                          Severity: Minor
                          Found in lib/utilities/geo.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?

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

                                scale = 1000 unless km.blank? # previously 1000.0
                          Severity: Minor
                          Found in lib/utilities/geo.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?

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

                                scale = 0.3048 unless ft.blank?
                          Severity: Minor
                          Found in lib/utilities/geo.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?

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

                                if coordinates[:lat_ns].nil?
                                  lat_string = coordinates[:lat_deg]
                                  if coordinates[:lat_deg].to_f < 0 # -5° S; 5° N
                                    coordinates[:lat_ns] = 'S'
                                    coordinates[:lat_deg] = coordinates[:lat_deg].gsub('-', '')
                          Severity: Major
                          Found in lib/utilities/geo.rb and 1 other location - About 1 hr to fix
                          lib/utilities/geo.rb on lines 662..675

                          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 72.

                          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

                                if coordinates[:long_we].nil?
                                  long_string = coordinates[:long_deg]
                                  if coordinates[:long_deg].to_f < 0
                                    coordinates[:long_we] = 'W'
                                    coordinates[:long_deg] = coordinates[:long_deg].gsub('-', '')
                          Severity: Major
                          Found in lib/utilities/geo.rb and 1 other location - About 1 hr to fix
                          lib/utilities/geo.rb on lines 648..661

                          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 72.

                          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

                                  coordinates[:lat_deg] = matchdata1[1]
                                  coordinates[:lat_min] = matchdata1[2]
                                  coordinates[:lat_sec] = matchdata1[3]
                                  coordinates[:lat_ns]  = matchdata1[4]
                                  coordinates[:long_deg] = matchdata1[5]
                          Severity: Major
                          Found in lib/utilities/geo.rb and 1 other location - About 1 hr to fix
                          lib/utilities/geo.rb on lines 589..596

                          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 49.

                          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

                                  coordinates[:lat_deg] = matchdata2[2]
                                  coordinates[:lat_min] = matchdata2[3]
                                  coordinates[:lat_sec] = matchdata2[4]
                                  coordinates[:lat_ns]  = matchdata2[1]
                                  coordinates[:long_deg] = matchdata2[6]
                          Severity: Major
                          Found in lib/utilities/geo.rb and 1 other location - About 1 hr to fix
                          lib/utilities/geo.rb on lines 579..586

                          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 49.

                          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

                                  coordinates[:lat_deg] = matchdata3[2]
                                  coordinates[:lat_min] = matchdata3[3]
                                  coordinates[:lat_ns]  = matchdata3[1]
                                  coordinates[:long_deg] = matchdata3[5]
                                  coordinates[:long_min] = matchdata3[6]
                          Severity: Minor
                          Found in lib/utilities/geo.rb and 1 other location - About 40 mins to fix
                          lib/utilities/geo.rb on lines 607..612

                          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 37.

                          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

                                  coordinates[:lat_deg] = matchdata4[1]
                                  coordinates[:lat_min] = matchdata4[2]
                                  coordinates[:lat_ns]  = matchdata4[3]
                                  coordinates[:long_deg] = matchdata4[4]
                                  coordinates[:long_min] = matchdata4[5]
                          Severity: Minor
                          Found in lib/utilities/geo.rb and 1 other location - About 40 mins to fix
                          lib/utilities/geo.rb on lines 599..604

                          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 37.

                          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

                                  coordinates[:lat_deg] = matchdata6[1]
                                  coordinates[:lat_ns]  = matchdata6[2]
                                  coordinates[:long_deg] = matchdata6[3]
                                  coordinates[:long_we]  = matchdata6[4]
                          Severity: Minor
                          Found in lib/utilities/geo.rb and 1 other location - About 15 mins to fix
                          lib/utilities/geo.rb on lines 621..624

                          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 25.

                          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

                                  coordinates[:lat_deg] = matchdata5[2]
                                  coordinates[:lat_ns]  = matchdata5[1]
                                  coordinates[:long_deg] = matchdata5[4]
                                  coordinates[:long_we]  = matchdata5[3]
                          Severity: Minor
                          Found in lib/utilities/geo.rb and 1 other location - About 15 mins to fix
                          lib/utilities/geo.rb on lines 615..618

                          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 25.

                          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 single-quoted strings when you don't need string interpolation or special symbols.
                          Open

                                    .gsub("ʹʹ", '"')
                          Severity: Minor
                          Found in lib/utilities/geo.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

                                dp = num.index(".")
                          Severity: Minor
                          Found in lib/utilities/geo.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

                                  digits = num.split(".")
                          Severity: Minor
                          Found in lib/utilities/geo.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

                                    .gsub("ʼʼ", '"')
                          Severity: Minor
                          Found in lib/utilities/geo.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

                                    .gsub("´´", '"')
                          Severity: Minor
                          Found in lib/utilities/geo.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

                                    .gsub("ˊˊ", '"')
                          Severity: Minor
                          Found in lib/utilities/geo.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