nofxx/georuby

View on GitHub

Showing 91 of 91 total issues

Method get_record has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def get_record(index)
        return nil if record_count <= index || index < 0
        dbf_record = @dbf.record(index)
        @shx.seek(100 + 8 * index) # 100 is the header length
        offset, length = @shx.read(8).unpack('N2')
Severity: Minor
Found in lib/geo_ruby/shp4r/shp.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

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

        when ShpType::MULTIPOINTZ
          str, bbox = create_bbox(geometry)
          m_range = geometry.m_range
          build_multi_point(geometry, str)
          build_multi_point_zm(geometry, :@z, [bbox[0].z, bbox[1].z], str)
Severity: Minor
Found in lib/geo_ruby/shp4r/shp.rb and 2 other locations - About 35 mins to fix
lib/geo_ruby/shp4r/shp.rb on lines 560..565
lib/geo_ruby/shp4r/shp.rb on lines 566..571

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

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

Method == has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def ==(other)
      if (self.class != other.class) || (features.size != other.features.size)
        return false
      else
        features.each_index do |index|
Severity: Minor
Found in lib/geo_ruby/geojson.rb - About 25 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 orthogonal_distance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def orthogonal_distance(line, tail = nil)
        head, tail  = tail ?  [line, tail] : [line[0], line[-1]]
        a, b = @x - head.x, @y - head.y
        c, d = tail.x - head.x, tail.y - head.y

Severity: Minor
Found in lib/geo_ruby/simple_features/point.rb - About 25 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 parse_geometry has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def parse_geometry
        @unpack_structure.endianness = @unpack_structure.read_byte
        geometry_type = @unpack_structure.read_uint

        if (geometry_type & Z_MASK) != 0
Severity: Minor
Found in lib/geo_ruby/ewk/ewkb_parser.rb - About 25 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 as_kml has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def as_kml(options = {})
        id_attr = ''
        id_attr = " id=\"#{options[:id]}\"" if options[:id]

        geom_data = ''
Severity: Minor
Found in lib/geo_ruby/simple_features/geometry.rb - About 25 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 as_ewkb has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def as_ewkb(allow_srid = true, allow_z = true, allow_m = true)
        ewkb = 1.chr # little_endian by default

        type = binary_geometry_type
        type |= Z_MASK if @with_z && allow_z
Severity: Minor
Found in lib/geo_ruby/simple_features/geometry.rb - About 25 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 from_coordinates has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def self.from_coordinates(coords, srid = DEFAULT_SRID, z = false, m = false)
        if !(z || m)
          from_x_y(coords[0], coords[1], srid)
        elsif z && m
          from_x_y_z_m(coords[0], coords[1], coords[2], coords[3], srid)
Severity: Minor
Found in lib/geo_ruby/simple_features/point.rb - About 25 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 parse_point has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def parse_point
        @factory.begin_geometry(Point, @srid)
        x, y = *@unpack_structure.read_point
        if ! (@with_z || @with_m) # most common case probably
          @factory.add_point_x_y(x, y)
Severity: Minor
Found in lib/geo_ruby/ewk/ewkb_parser.rb - About 25 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

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

          0.upto(xy.size / 2 - 1) do |index|
            @geometry << Point.from_x_y(xy[index * 2 + 1].to_f,
                                        xy[index * 2].to_f)
Severity: Minor
Found in lib/geo_ruby/georss.rb and 1 other location - About 20 mins to fix
lib/geo_ruby/georss.rb on lines 57..59

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

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

            0.upto(xy.size / 2 - 1) do |index|
              @geometry << Point.from_x_y(xy[index * 2 + 1].to_f,
                                          xy[index * 2].to_f)
Severity: Minor
Found in lib/geo_ruby/georss.rb and 1 other location - About 20 mins to fix
lib/geo_ruby/georss.rb on lines 103..105

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

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

          0.upto(xy.size / 2 - 1) do |index|
            corners << Point.from_x_y(xy[index * 2 + 1].to_f,
                                      xy[index * 2].to_f)
Severity: Minor
Found in lib/geo_ruby/georss.rb and 2 other locations - About 20 mins to fix
lib/geo_ruby/georss.rb on lines 71..73
lib/geo_ruby/georss.rb on lines 113..115

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

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

          0.upto(xy.size / 2 - 1) do |index|
            linear_ring << Point.from_x_y(xy[index * 2 + 1].to_f,
                                          xy[index * 2].to_f)
Severity: Minor
Found in lib/geo_ruby/georss.rb and 2 other locations - About 20 mins to fix
lib/geo_ruby/georss.rb on lines 71..73
lib/geo_ruby/georss.rb on lines 121..123

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

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

            0.upto(xy.size / 2 - 1) do |index|
              linear_ring << Point.from_x_y(xy[index * 2 + 1].to_f,
                                            xy[index * 2].to_f)
Severity: Minor
Found in lib/geo_ruby/georss.rb and 2 other locations - About 20 mins to fix
lib/geo_ruby/georss.rb on lines 113..115
lib/geo_ruby/georss.rb on lines 121..123

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

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

      def self.from_coordinates(point_sequence_sequences, srid = DEFAULT_SRID, with_z = false, with_m = false)
        multi_polygon = new(srid, with_z, with_m)
        multi_polygon.concat(point_sequence_sequences.collect { |point_sequences| Polygon.from_coordinates(point_sequences, srid, with_z, with_m) })
        multi_polygon
Severity: Minor
Found in lib/geo_ruby/simple_features/multi_polygon.rb and 5 other locations - About 20 mins to fix
lib/geo_ruby/simple_features/line_string.rb on lines 217..220
lib/geo_ruby/simple_features/multi_line_string.rb on lines 49..52
lib/geo_ruby/simple_features/multi_point.rb on lines 45..48
lib/geo_ruby/simple_features/polygon.rb on lines 158..161
lib/geo_ruby/simple_features/polygon.rb on lines 165..168

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

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 6 locations. Consider refactoring.
Open

      def self.from_coordinates(points, srid = DEFAULT_SRID, z = false, m = false)
        line_string = new(srid, z, m)
        line_string.concat(points.map { |p| Point.from_coordinates(p, srid, z, m) })
        line_string
Severity: Minor
Found in lib/geo_ruby/simple_features/line_string.rb and 5 other locations - About 20 mins to fix
lib/geo_ruby/simple_features/multi_line_string.rb on lines 49..52
lib/geo_ruby/simple_features/multi_point.rb on lines 45..48
lib/geo_ruby/simple_features/multi_polygon.rb on lines 48..51
lib/geo_ruby/simple_features/polygon.rb on lines 158..161
lib/geo_ruby/simple_features/polygon.rb on lines 165..168

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

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 6 locations. Consider refactoring.
Open

      def self.from_coordinates(point_sequences, srid = DEFAULT_SRID, with_z = false, with_m = false)
        multi_line_string = new(srid, with_z, with_m)
        multi_line_string.concat(point_sequences.collect { |points| LineString.from_coordinates(points, srid, with_z, with_m) })
        multi_line_string
Severity: Minor
Found in lib/geo_ruby/simple_features/multi_line_string.rb and 5 other locations - About 20 mins to fix
lib/geo_ruby/simple_features/line_string.rb on lines 217..220
lib/geo_ruby/simple_features/multi_point.rb on lines 45..48
lib/geo_ruby/simple_features/multi_polygon.rb on lines 48..51
lib/geo_ruby/simple_features/polygon.rb on lines 158..161
lib/geo_ruby/simple_features/polygon.rb on lines 165..168

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

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 6 locations. Consider refactoring.
Open

      def self.from_coordinates(points, srid = DEFAULT_SRID, with_z = false, with_m = false)
        multi_point = new(srid, with_z, with_m)
        multi_point.concat(points.collect { |point| Point.from_coordinates(point, srid, with_z, with_m) })
        multi_point
Severity: Minor
Found in lib/geo_ruby/simple_features/multi_point.rb and 5 other locations - About 20 mins to fix
lib/geo_ruby/simple_features/line_string.rb on lines 217..220
lib/geo_ruby/simple_features/multi_line_string.rb on lines 49..52
lib/geo_ruby/simple_features/multi_polygon.rb on lines 48..51
lib/geo_ruby/simple_features/polygon.rb on lines 158..161
lib/geo_ruby/simple_features/polygon.rb on lines 165..168

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

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 6 locations. Consider refactoring.
Open

      def self.from_points(point_sequences, srid = DEFAULT_SRID, z = false, m = false)
        polygon = new(srid, z, m)
        polygon.concat(point_sequences.map { |points| LinearRing.from_points(points, srid, z, m) })
        polygon
Severity: Minor
Found in lib/geo_ruby/simple_features/polygon.rb and 5 other locations - About 20 mins to fix
lib/geo_ruby/simple_features/line_string.rb on lines 217..220
lib/geo_ruby/simple_features/multi_line_string.rb on lines 49..52
lib/geo_ruby/simple_features/multi_point.rb on lines 45..48
lib/geo_ruby/simple_features/multi_polygon.rb on lines 48..51
lib/geo_ruby/simple_features/polygon.rb on lines 158..161

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

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 6 locations. Consider refactoring.
Open

      def self.from_coordinates(point_sequences, srid = DEFAULT_SRID, z = false, m = false)
        polygon = new(srid, z, m)
        polygon.concat(point_sequences.map { |points| LinearRing.from_coordinates(points, srid, z, m) })
        polygon
Severity: Minor
Found in lib/geo_ruby/simple_features/polygon.rb and 5 other locations - About 20 mins to fix
lib/geo_ruby/simple_features/line_string.rb on lines 217..220
lib/geo_ruby/simple_features/multi_line_string.rb on lines 49..52
lib/geo_ruby/simple_features/multi_point.rb on lines 45..48
lib/geo_ruby/simple_features/multi_polygon.rb on lines 48..51
lib/geo_ruby/simple_features/polygon.rb on lines 165..168

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

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

Severity
Category
Status
Source
Language