nulogy/Gorgon

View on GitHub

Showing 51 of 111 total issues

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

      class BindOk < Protocol::Method
        @name = "exchange.bind-ok"
        @method_id = 31
        @index = 0x0028001F # 40, 31, 2621471
        @packed_indexes = [40, 31].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 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 11 locations. Consider refactoring.
Open

      class UnbindOk < Protocol::Method
        @name = "queue.unbind-ok"
        @method_id = 51
        @index = 0x00320033 # 50, 51, 3276851
        @packed_indexes = [50, 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 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 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 CommitOk < Protocol::Method
        @name = "tx.commit-ok"
        @method_id = 21
        @index = 0x005A0015 # 90, 21, 5898261
        @packed_indexes = [90, 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 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 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 Commit < Protocol::Method
        @name = "tx.commit"
        @method_id = 20
        @index = 0x005A0014 # 90, 20, 5898260
        @packed_indexes = [90, 20].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 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 11 locations. Consider refactoring.
Open

      class RecoverOk < Protocol::Method
        @name = "basic.recover-ok"
        @method_id = 111
        @index = 0x003C006F # 60, 111, 3932271
        @packed_indexes = [60, 111].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 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 RollbackOk < Protocol::Method
        @name = "tx.rollback-ok"
        @method_id = 31
        @index = 0x005A001F # 90, 31, 5898271
        @packed_indexes = [90, 31].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 2134..2150
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb on lines 2176..2192

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 DeleteOk < Protocol::Method
        @name = "exchange.delete-ok"
        @method_id = 21
        @index = 0x00280015 # 40, 21, 2621461
        @packed_indexes = [40, 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 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

      def self.decode_string(data, offset)
        length = data.slice(offset, 4).unpack(PACK_UINT32).first
        offset += 4
        v = data.slice(offset, length)
        offset += length
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/table.rb on lines 129..135

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

      def self.decode_table_key(data, offset)
        key_length = data.slice(offset, 1).unpack(PACK_CHAR).first
        offset += 1
        key = data.slice(offset, key_length)
        offset += key_length
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/table.rb and 1 other location - About 20 mins to fix
lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/table_value_decoder.rb on lines 85..91

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

    def queue_exists?(name)
      ch = create_channel
      begin
        ch.queue(name, :passive => true)
        true
Severity: Minor
Found in lib/gorgon_bunny/lib/gorgon_bunny/session.rb and 1 other location - About 15 mins to fix
lib/gorgon_bunny/lib/gorgon_bunny/session.rb on lines 427..435

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

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 exchange_exists?(name)
      ch = create_channel
      begin
        ch.exchange(name, :passive => true)
        true
Severity: Minor
Found in lib/gorgon_bunny/lib/gorgon_bunny/session.rb and 1 other location - About 15 mins to fix
lib/gorgon_bunny/lib/gorgon_bunny/session.rb on lines 407..415

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

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