hirura/hrr_rb_ssh

View on GitHub
lib/hrr_rb_ssh/connection/channel.rb

Summary

Maintainability
F
6 days
Test Coverage

File channel.rb has 527 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'hrr_rb_ssh/connection/channel/channel_type'

module HrrRbSsh
  class Connection
    class Channel
Severity: Major
Found in lib/hrr_rb_ssh/connection/channel.rb - About 1 day to fix

    Method channel_loop_thread has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
    Open

          def channel_loop_thread
            Thread.start do
              log_info { "start channel loop thread" }
              begin
                loop do
    Severity: Minor
    Found in lib/hrr_rb_ssh/connection/channel.rb - About 5 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Class Channel has 31 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class Channel
          include Loggable
    
          INITIAL_WINDOW_SIZE = 100000
          MAXIMUM_PACKET_SIZE = 100000
    Severity: Minor
    Found in lib/hrr_rb_ssh/connection/channel.rb - About 3 hrs to fix

      Method sender_thread has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

            def sender_thread
              Thread.start {
                log_info { "start sender thread" }
                loop do
                  if @r_io_in.closed?
      Severity: Minor
      Found in lib/hrr_rb_ssh/connection/channel.rb - About 2 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method out_sender_thread has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

            def out_sender_thread
              Thread.start {
                log_info { "start out sender thread" }
                loop do
                  if @r_io_out.closed?
      Severity: Minor
      Found in lib/hrr_rb_ssh/connection/channel.rb - About 2 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method err_sender_thread has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

            def err_sender_thread
              Thread.start {
                log_info { "start err sender thread" }
                loop do
                  if @r_io_err.closed?
      Severity: Minor
      Found in lib/hrr_rb_ssh/connection/channel.rb - About 2 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Method channel_loop_thread has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def channel_loop_thread
              Thread.start do
                log_info { "start channel loop thread" }
                begin
                  loop do
      Severity: Major
      Found in lib/hrr_rb_ssh/connection/channel.rb - About 2 hrs to fix

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

              def err_receiver_thread
                Thread.start {
                  log_info { "start err receiver thread" }
                  loop do
                    begin
        Severity: Minor
        Found in lib/hrr_rb_ssh/connection/channel.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

              def receiver_thread
                Thread.start {
                  log_info { "start receiver thread" }
                  loop do
                    begin
        Severity: Minor
        Found in lib/hrr_rb_ssh/connection/channel.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

              def out_receiver_thread
                Thread.start {
                  log_info { "start out receiver thread" }
                  loop do
                    begin
        Severity: Minor
        Found in lib/hrr_rb_ssh/connection/channel.rb - About 1 hr to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method receiver_thread has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def receiver_thread
                Thread.start {
                  log_info { "start receiver thread" }
                  loop do
                    begin
        Severity: Minor
        Found in lib/hrr_rb_ssh/connection/channel.rb - About 1 hr to fix

          Method err_receiver_thread has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def err_receiver_thread
                  Thread.start {
                    log_info { "start err receiver thread" }
                    loop do
                      begin
          Severity: Minor
          Found in lib/hrr_rb_ssh/connection/channel.rb - About 1 hr to fix

            Method out_receiver_thread has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def out_receiver_thread
                    Thread.start {
                      log_info { "start out receiver thread" }
                      loop do
                        begin
            Severity: Minor
            Found in lib/hrr_rb_ssh/connection/channel.rb - About 1 hr to fix

              Method close has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def close from=:outside, exitstatus=0
                      @channel_closing_monitor.synchronize {
                        return if @closed
                        log_info { "close channel" }
                        @closed = true
              Severity: Minor
              Found in lib/hrr_rb_ssh/connection/channel.rb - About 1 hr to fix

                Method close has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                Open

                      def close from=:outside, exitstatus=0
                        @channel_closing_monitor.synchronize {
                          return if @closed
                          log_info { "close channel" }
                          @closed = true
                Severity: Minor
                Found in lib/hrr_rb_ssh/connection/channel.rb - About 55 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 send_channel_request_pty_req has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                      def send_channel_request_pty_req term_env_var_val, term_width_chars, term_height_rows, term_width_pixel, term_height_pixel, encoded_term_modes
                Severity: Minor
                Found in lib/hrr_rb_ssh/connection/channel.rb - About 45 mins to fix

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

                        def receiver_thread
                          Thread.start {
                            log_info { "start receiver thread" }
                            loop do
                              begin
                  Severity: Major
                  Found in lib/hrr_rb_ssh/connection/channel.rb and 2 other locations - About 2 hrs to fix
                  lib/hrr_rb_ssh/connection/channel.rb on lines 304..333
                  lib/hrr_rb_ssh/connection/channel.rb on lines 337..366

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

                  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 out_receiver_thread
                          Thread.start {
                            log_info { "start out receiver thread" }
                            loop do
                              begin
                  Severity: Major
                  Found in lib/hrr_rb_ssh/connection/channel.rb and 2 other locations - About 2 hrs to fix
                  lib/hrr_rb_ssh/connection/channel.rb on lines 271..300
                  lib/hrr_rb_ssh/connection/channel.rb on lines 337..366

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

                  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 err_receiver_thread
                          Thread.start {
                            log_info { "start err receiver thread" }
                            loop do
                              begin
                  Severity: Major
                  Found in lib/hrr_rb_ssh/connection/channel.rb and 2 other locations - About 2 hrs to fix
                  lib/hrr_rb_ssh/connection/channel.rb on lines 271..300
                  lib/hrr_rb_ssh/connection/channel.rb on lines 304..333

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

                  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 out_sender_thread
                          Thread.start {
                            log_info { "start out sender thread" }
                            loop do
                              if @r_io_out.closed?
                  Severity: Major
                  Found in lib/hrr_rb_ssh/connection/channel.rb and 1 other location - About 2 hrs to fix
                  lib/hrr_rb_ssh/connection/channel.rb on lines 245..267

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

                  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 err_sender_thread
                          Thread.start {
                            log_info { "start err sender thread" }
                            loop do
                              if @r_io_err.closed?
                  Severity: Major
                  Found in lib/hrr_rb_ssh/connection/channel.rb and 1 other location - About 2 hrs to fix
                  lib/hrr_rb_ssh/connection/channel.rb on lines 219..241

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

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                            begin
                              t.join if t.instance_of? Thread
                            rescue => e
                              log_error { [e.backtrace[0], ": ", e.message, " (", e.class.to_s, ")\n\t", e.backtrace[1..-1].join("\n\t")].join }
                            end
                  Severity: Minor
                  Found in lib/hrr_rb_ssh/connection/channel.rb and 1 other location - About 30 mins to fix
                  lib/hrr_rb_ssh/connection/channel.rb on lines 145..149

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

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                            begin
                              t.join if t.instance_of? Thread
                            rescue => e
                              log_error { [e.backtrace[0], ": ", e.message, " (", e.class.to_s, ")\n\t", e.backtrace[1..-1].join("\n\t")].join }
                            end
                  Severity: Minor
                  Found in lib/hrr_rb_ssh/connection/channel.rb and 1 other location - About 30 mins to fix
                  lib/hrr_rb_ssh/connection/channel.rb on lines 96..100

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

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

                        def send_channel_request_signal signal_name
                          message = {
                            :'message number'    => Messages::SSH_MSG_CHANNEL_REQUEST::VALUE,
                            :'recipient channel' => @remote_channel,
                            :'request type'      => "signal",
                  Severity: Minor
                  Found in lib/hrr_rb_ssh/connection/channel.rb and 3 other locations - About 20 mins to fix
                  lib/hrr_rb_ssh/connection/channel.rb on lines 486..495
                  lib/hrr_rb_ssh/connection/channel.rb on lines 498..507
                  lib/hrr_rb_ssh/connection/channel.rb on lines 537..546

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 28.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                        def send_channel_request_exec command
                          message = {
                            :'message number'    => Messages::SSH_MSG_CHANNEL_REQUEST::VALUE,
                            :'recipient channel' => @remote_channel,
                            :'request type'      => "exec",
                  Severity: Minor
                  Found in lib/hrr_rb_ssh/connection/channel.rb and 3 other locations - About 20 mins to fix
                  lib/hrr_rb_ssh/connection/channel.rb on lines 498..507
                  lib/hrr_rb_ssh/connection/channel.rb on lines 525..534
                  lib/hrr_rb_ssh/connection/channel.rb on lines 537..546

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 28.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                        def send_channel_request_subsystem subsystem_name
                          message = {
                            :'message number'    => Messages::SSH_MSG_CHANNEL_REQUEST::VALUE,
                            :'recipient channel' => @remote_channel,
                            :'request type'      => "subsystem",
                  Severity: Minor
                  Found in lib/hrr_rb_ssh/connection/channel.rb and 3 other locations - About 20 mins to fix
                  lib/hrr_rb_ssh/connection/channel.rb on lines 486..495
                  lib/hrr_rb_ssh/connection/channel.rb on lines 525..534
                  lib/hrr_rb_ssh/connection/channel.rb on lines 537..546

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 28.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                        def send_channel_request_exit_status exitstatus
                          message = {
                            :'message number'    => Messages::SSH_MSG_CHANNEL_REQUEST::VALUE,
                            :'recipient channel' => @remote_channel,
                            :'request type'      => "exit-status",
                  Severity: Minor
                  Found in lib/hrr_rb_ssh/connection/channel.rb and 3 other locations - About 20 mins to fix
                  lib/hrr_rb_ssh/connection/channel.rb on lines 486..495
                  lib/hrr_rb_ssh/connection/channel.rb on lines 498..507
                  lib/hrr_rb_ssh/connection/channel.rb on lines 525..534

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 28.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  There are no issues that match your filters.

                  Category
                  Status