nulogy/Gorgon

View on GitHub

Showing 111 of 111 total issues

Method encode has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        def self.encode(channel, queue, exchange, routing_key, arguments)
Severity: Minor
Found in lib/gorgon_amq-protocol/lib/gorgon_amq/protocol/client.rb - About 35 mins to fix

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

        def maybe_shutdown_reader_loop
          if @reader_loop
            @reader_loop.stop
            if threaded?
              # this is the easiest way to wait until the loop
    Severity: Minor
    Found in lib/gorgon_bunny/lib/gorgon_bunny/session.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

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

        def initialize(connection_string_or_opts = Hash.new, optz = Hash.new)
          opts = case (ENV["RABBITMQ_URL"] || connection_string_or_opts)
                 when nil then
                   Hash.new
                 when String then
    Severity: Minor
    Found in lib/gorgon_bunny/lib/gorgon_bunny/session.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 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

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

        def test_framework(filename)
          if filename =~ /_spec.rb$/i && defined?(RSpec)
            :rspec
          elsif defined?(MiniTest) && !test_unit_gem?
            :mini_test
    Severity: Minor
    Found in lib/gorgon/worker.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

    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

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

        def run_job(payload)
          @job_definition = JobDefinition.new(payload)
          @reply_exchange = @bunny.exchange(@job_definition.reply_exchange_name, :auto_delete => true)
    
          syncer = SourceTreeSyncer.new(@job_definition.sync)
    Severity: Minor
    Found in lib/gorgon/listener.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

    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

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

        def update payload={}
          output_gorgon_crash_message payload if gorgon_crashed? payload
    
          create_progress_bar_if_started_job_running
    
    
    Severity: Minor
    Found in lib/gorgon/progress_bar_view.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

    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