nulogy/Gorgon

View on GitHub

Showing 51 of 111 total issues

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

      class RecoverAsync < Protocol::Method
        @name = "basic.recover-async"
        @method_id = 100
        @index = 0x003C0064 # 60, 100, 3932260
        @packed_indexes = [60, 100].pack(PACK_UINT16_X2).freeze
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 1 other location - About 55 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2018..2036

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

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

      class Recover < Protocol::Method
        @name = "basic.recover"
        @method_id = 110
        @index = 0x003C006E # 60, 110, 3932270
        @packed_indexes = [60, 110].pack(PACK_UINT16_X2).freeze
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 1 other location - About 55 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1995..2013

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

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

      class Unblocked < Protocol::Method
        @name = "connection.unblocked"
        @method_id = 61
        @index = 0x000A003D # 10, 61, 655421
        @packed_indexes = [10, 61].pack(PACK_UINT16_X2).freeze
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 1 other location - About 50 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 484..508

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

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

      class CloseOk < Protocol::Method
        @name = "connection.close-ok"
        @method_id = 51
        @index = 0x000A0033 # 10, 51, 655411
        @packed_indexes = [10, 51].pack(PACK_UINT16_X2).freeze
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 1 other location - About 50 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 550..574

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

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

      class SelectOk < Protocol::Method
        @name = "confirm.select-ok"
        @method_id = 11
        @index = 0x0055000B # 85, 11, 5570571
        @packed_indexes = [85, 11].pack(PACK_UINT16_X2).freeze
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 1 other location - About 45 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 757..780

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

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

      class CloseOk < Protocol::Method
        @name = "channel.close-ok"
        @method_id = 41
        @index = 0x00140029 # 20, 41, 1310761
        @packed_indexes = [20, 41].pack(PACK_UINT16_X2).freeze
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 1 other location - About 45 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2284..2307

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

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

        def self.encode(channel, delivery_tag, multiple)
          buffer = @packed_indexes.dup
          buffer << GorgonAMQ::Pack.pack_uint64_big_endian(delivery_tag)
          bit_buffer = 0
          bit_buffer = bit_buffer | (1 << 0) if multiple
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 1 other location - About 30 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1984..1990

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

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

        def self.encode(channel, delivery_tag, requeue)
          buffer = @packed_indexes.dup
          buffer << GorgonAMQ::Pack.pack_uint64_big_endian(delivery_tag)
          bit_buffer = 0
          bit_buffer = bit_buffer | (1 << 0) if requeue
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 1 other location - About 30 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1960..1966

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

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

    def wait_on_confirms_continuations
      if @connection.threaded
        t = Thread.current
        @threads_waiting_on_confirms_continuations << t

Severity: Minor
Found in lib/gorgon_bunny/lib/gorgon_bunny/channel.rb and 2 other locations - About 25 mins to fix
lib/gorgon_bunny/lib/gorgon_bunny/channel.rb on lines 1655..1668
lib/gorgon_bunny/lib/gorgon_bunny/channel.rb on lines 1673..1686

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

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

    def wait_on_continuations
      if @connection.threaded
        t = Thread.current
        @threads_waiting_on_continuations << t

Severity: Minor
Found in lib/gorgon_bunny/lib/gorgon_bunny/channel.rb and 2 other locations - About 25 mins to fix
lib/gorgon_bunny/lib/gorgon_bunny/channel.rb on lines 1673..1686
lib/gorgon_bunny/lib/gorgon_bunny/channel.rb on lines 1691..1704

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

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

    def wait_on_basic_get_continuations
      if @connection.threaded
        t = Thread.current
        @threads_waiting_on_basic_get_continuations << t

Severity: Minor
Found in lib/gorgon_bunny/lib/gorgon_bunny/channel.rb and 2 other locations - About 25 mins to fix
lib/gorgon_bunny/lib/gorgon_bunny/channel.rb on lines 1655..1668
lib/gorgon_bunny/lib/gorgon_bunny/channel.rb on lines 1691..1704

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

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

      class BindOk < Protocol::Method
        @name = "queue.bind-ok"
        @method_id = 21
        @index = 0x00320015 # 50, 21, 3276821
        @packed_indexes = [50, 21].pack(PACK_UINT16_X2).freeze
Severity: Major
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 10 other locations - About 25 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 827..843
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 877..893
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 931..947
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 985..1001
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1272..1288
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1555..1571
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2041..2057
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2134..2150
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2176..2192
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2218..2234

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

      class SelectOk < Protocol::Method
        @name = "tx.select-ok"
        @method_id = 11
        @index = 0x005A000B # 90, 11, 5898251
        @packed_indexes = [90, 11].pack(PACK_UINT16_X2).freeze
Severity: Major
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 10 other locations - About 25 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 827..843
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 877..893
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 931..947
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 985..1001
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1113..1129
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1272..1288
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1555..1571
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2041..2057
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2176..2192
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2218..2234

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

      class UnbindOk < Protocol::Method
        @name = "exchange.unbind-ok"
        @method_id = 51
        @index = 0x00280033 # 40, 51, 2621491
        @packed_indexes = [40, 51].pack(PACK_UINT16_X2).freeze
Severity: Major
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 10 other locations - About 25 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 827..843
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 877..893
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 931..947
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1113..1129
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1272..1288
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1555..1571
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2041..2057
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2134..2150
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2176..2192
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2218..2234

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

      class QosOk < Protocol::Method
        @name = "basic.qos-ok"
        @method_id = 11
        @index = 0x003C000B # 60, 11, 3932171
        @packed_indexes = [60, 11].pack(PACK_UINT16_X2).freeze
Severity: Major
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 10 other locations - About 25 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 827..843
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 877..893
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 931..947
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 985..1001
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1113..1129
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1272..1288
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2041..2057
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2134..2150
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2176..2192
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2218..2234

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

      class Select < Protocol::Method
        @name = "tx.select"
        @method_id = 10
        @index = 0x005A000A # 90, 10, 5898250
        @packed_indexes = [90, 10].pack(PACK_UINT16_X2).freeze
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 2 other locations - About 25 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2156..2171
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2198..2213

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

      class Rollback < Protocol::Method
        @name = "tx.rollback"
        @method_id = 30
        @index = 0x005A001E # 90, 30, 5898270
        @packed_indexes = [90, 30].pack(PACK_UINT16_X2).freeze
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 2 other locations - About 25 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2114..2129
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2156..2171

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

      class DeclareOk < Protocol::Method
        @name = "exchange.declare-ok"
        @method_id = 11
        @index = 0x0028000B # 40, 11, 2621451
        @packed_indexes = [40, 11].pack(PACK_UINT16_X2).freeze
Severity: Major
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 10 other locations - About 25 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 877..893
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 931..947
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 985..1001
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1113..1129
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1272..1288
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1555..1571
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2041..2057
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2134..2150
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2176..2192
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2218..2234

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

      DECODE_PROPERTIES = {
        0x8000 => :content_type,
        0x4000 => :content_encoding,
        0x2000 => :headers,
        0x1000 => :delivery_mode,
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 1 other location - About 25 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1461..1475

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

      DECODE_PROPERTIES_TYPE = {
        0x8000 => :shortstr,
        0x4000 => :shortstr,
        0x2000 => :table,
        0x1000 => :octet,
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb and 1 other location - About 25 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 1444..1458

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

Severity
Category
Status
Source
Language