hirura/hrr_rb_ssh

View on GitHub

Showing 86 of 169 total issues

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

        if channel
          log_info { "closing channel IOs" }
          channel.io.each{ |io| io.close rescue nil }
          log_info { "channel IOs closed" }
          log_info { "closing channel" }
Severity: Major
Found in lib/hrr_rb_ssh/client.rb and 3 other locations - About 30 mins to fix
lib/hrr_rb_ssh/client.rb on lines 124..132
lib/hrr_rb_ssh/client.rb on lines 188..196
lib/hrr_rb_ssh/client.rb on lines 215..223

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

        if channel
          log_info { "closing channel IOs" }
          channel.io.each{ |io| io.close rescue nil }
          log_info { "channel IOs closed" }
          log_info { "closing channel" }
Severity: Major
Found in lib/hrr_rb_ssh/client.rb and 3 other locations - About 30 mins to fix
lib/hrr_rb_ssh/client.rb on lines 124..132
lib/hrr_rb_ssh/client.rb on lines 157..165
lib/hrr_rb_ssh/client.rb on lines 188..196

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

        if channel
          log_info { "closing channel IOs" }
          channel.io.each{ |io| io.close rescue nil }
          log_info { "channel IOs closed" }
          log_info { "closing channel" }
Severity: Major
Found in lib/hrr_rb_ssh/client.rb and 3 other locations - About 30 mins to fix
lib/hrr_rb_ssh/client.rb on lines 124..132
lib/hrr_rb_ssh/client.rb on lines 157..165
lib/hrr_rb_ssh/client.rb on lines 215..223

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

  auth_password = HrrRbSsh::Authentication::Authenticator.new { |context|
    user_and_pass = [
      ['user1',  'password1'],
      ['user2',  'password2'],
    ]
Severity: Minor
Found in demo/multi_step_auth.rb and 1 other location - About 30 mins to fix
demo/more_flexible_auth.rb on lines 34..44

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

  auth_password = HrrRbSsh::Authentication::Authenticator.new { |context|
    user_and_pass = [
      ['user1',  'password1'],
      ['user2',  'password2'],
    ]
Severity: Minor
Found in demo/more_flexible_auth.rb and 1 other location - About 30 mins to fix
demo/multi_step_auth.rb on lines 29..39

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

    def channel_extended_data payload
      log_info { 'received ' + Messages::SSH_MSG_CHANNEL_EXTENDED_DATA::ID }
      message = Messages::SSH_MSG_CHANNEL_EXTENDED_DATA.new(logger: logger).decode payload
      local_channel = message[:'recipient channel']
      @channels[local_channel].receive_message_queue.enq message if @channels.has_key? local_channel
Severity: Major
Found in lib/hrr_rb_ssh/connection.rb and 4 other locations - About 30 mins to fix
lib/hrr_rb_ssh/connection.rb on lines 219..223
lib/hrr_rb_ssh/connection.rb on lines 226..230
lib/hrr_rb_ssh/connection.rb on lines 233..237
lib/hrr_rb_ssh/connection.rb on lines 247..251

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

    def channel_window_adjust payload
      log_info { 'received ' + Messages::SSH_MSG_CHANNEL_WINDOW_ADJUST::ID }
      message = Messages::SSH_MSG_CHANNEL_WINDOW_ADJUST.new(logger: logger).decode payload
      local_channel = message[:'recipient channel']
      @channels[local_channel].receive_message_queue.enq message if @channels.has_key? local_channel
Severity: Major
Found in lib/hrr_rb_ssh/connection.rb and 4 other locations - About 30 mins to fix
lib/hrr_rb_ssh/connection.rb on lines 219..223
lib/hrr_rb_ssh/connection.rb on lines 233..237
lib/hrr_rb_ssh/connection.rb on lines 240..244
lib/hrr_rb_ssh/connection.rb on lines 247..251

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

    def channel_request payload
      log_info { 'received ' + Messages::SSH_MSG_CHANNEL_REQUEST::ID }
      message = Messages::SSH_MSG_CHANNEL_REQUEST.new(logger: logger).decode payload
      local_channel = message[:'recipient channel']
      @channels[local_channel].receive_message_queue.enq message if @channels.has_key? local_channel
Severity: Major
Found in lib/hrr_rb_ssh/connection.rb and 4 other locations - About 30 mins to fix
lib/hrr_rb_ssh/connection.rb on lines 226..230
lib/hrr_rb_ssh/connection.rb on lines 233..237
lib/hrr_rb_ssh/connection.rb on lines 240..244
lib/hrr_rb_ssh/connection.rb on lines 247..251

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

    def channel_data payload
      log_info { 'received ' + Messages::SSH_MSG_CHANNEL_DATA::ID }
      message = Messages::SSH_MSG_CHANNEL_DATA.new(logger: logger).decode payload
      local_channel = message[:'recipient channel']
      @channels[local_channel].receive_message_queue.enq message if @channels.has_key? local_channel
Severity: Major
Found in lib/hrr_rb_ssh/connection.rb and 4 other locations - About 30 mins to fix
lib/hrr_rb_ssh/connection.rb on lines 219..223
lib/hrr_rb_ssh/connection.rb on lines 226..230
lib/hrr_rb_ssh/connection.rb on lines 240..244
lib/hrr_rb_ssh/connection.rb on lines 247..251

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

    def channel_eof payload
      log_info { 'received ' + Messages::SSH_MSG_CHANNEL_EOF::ID }
      message = Messages::SSH_MSG_CHANNEL_EOF.new(logger: logger).decode payload
      local_channel = message[:'recipient channel']
      @channels[local_channel].receive_message_queue.enq message if @channels.has_key? local_channel
Severity: Major
Found in lib/hrr_rb_ssh/connection.rb and 4 other locations - About 30 mins to fix
lib/hrr_rb_ssh/connection.rb on lines 219..223
lib/hrr_rb_ssh/connection.rb on lines 226..230
lib/hrr_rb_ssh/connection.rb on lines 233..237
lib/hrr_rb_ssh/connection.rb on lines 240..244

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

      rescue => e
        log_error { "Failed opening channel" }
        log_error { [e.backtrace[0], ": ", e.message, " (", e.class.to_s, ")\n\t", e.backtrace[1..-1].join("\n\t")].join }
        raise "Error in exec!"
      ensure
Severity: Minor
Found in lib/hrr_rb_ssh/client.rb and 3 other locations - About 25 mins to fix
lib/hrr_rb_ssh/client.rb on lines 152..156
lib/hrr_rb_ssh/client.rb on lines 183..187
lib/hrr_rb_ssh/client.rb on lines 210..214

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

module HrrRbSsh
  module Messages
    class SSH_MSG_KEX_DH_GEX_REPLY
      include Codable

Severity: Major
Found in lib/hrr_rb_ssh/messages/033_ssh_msg_kex_dh_gex_reply.rb and 4 other locations - About 25 mins to fix
lib/hrr_rb_ssh/messages/004_ssh_msg_debug.rb on lines 3..17
lib/hrr_rb_ssh/messages/031_ssh_msg_kexdh_reply.rb on lines 3..17
lib/hrr_rb_ssh/messages/031_ssh_msg_kexecdh_reply.rb on lines 3..17
lib/hrr_rb_ssh/messages/034_ssh_msg_kex_dh_gex_request.rb on lines 3..17

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

module HrrRbSsh
  module Messages
    class SSH_MSG_KEXECDH_REPLY
      include Codable

Severity: Major
Found in lib/hrr_rb_ssh/messages/031_ssh_msg_kexecdh_reply.rb and 4 other locations - About 25 mins to fix
lib/hrr_rb_ssh/messages/004_ssh_msg_debug.rb on lines 3..17
lib/hrr_rb_ssh/messages/031_ssh_msg_kexdh_reply.rb on lines 3..17
lib/hrr_rb_ssh/messages/033_ssh_msg_kex_dh_gex_reply.rb on lines 3..17
lib/hrr_rb_ssh/messages/034_ssh_msg_kex_dh_gex_request.rb on lines 3..17

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

module HrrRbSsh
  module Messages
    class SSH_MSG_KEXDH_REPLY
      include Codable

Severity: Major
Found in lib/hrr_rb_ssh/messages/031_ssh_msg_kexdh_reply.rb and 4 other locations - About 25 mins to fix
lib/hrr_rb_ssh/messages/004_ssh_msg_debug.rb on lines 3..17
lib/hrr_rb_ssh/messages/031_ssh_msg_kexecdh_reply.rb on lines 3..17
lib/hrr_rb_ssh/messages/033_ssh_msg_kex_dh_gex_reply.rb on lines 3..17
lib/hrr_rb_ssh/messages/034_ssh_msg_kex_dh_gex_request.rb on lines 3..17

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

      rescue => e
        log_error { "Failed opening channel" }
        log_error { [e.backtrace[0], ": ", e.message, " (", e.class.to_s, ")\n\t", e.backtrace[1..-1].join("\n\t")].join }
        raise "Error in shell"
      ensure
Severity: Minor
Found in lib/hrr_rb_ssh/client.rb and 3 other locations - About 25 mins to fix
lib/hrr_rb_ssh/client.rb on lines 119..123
lib/hrr_rb_ssh/client.rb on lines 152..156
lib/hrr_rb_ssh/client.rb on lines 210..214

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

      rescue => e
        log_error { "Failed opening channel" }
        log_error { [e.backtrace[0], ": ", e.message, " (", e.class.to_s, ")\n\t", e.backtrace[1..-1].join("\n\t")].join }
        raise "Error in subsystem"
      ensure
Severity: Minor
Found in lib/hrr_rb_ssh/client.rb and 3 other locations - About 25 mins to fix
lib/hrr_rb_ssh/client.rb on lines 119..123
lib/hrr_rb_ssh/client.rb on lines 152..156
lib/hrr_rb_ssh/client.rb on lines 183..187

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

module HrrRbSsh
  module Messages
    class SSH_MSG_KEX_DH_GEX_REQUEST
      include Codable

Severity: Major
Found in lib/hrr_rb_ssh/messages/034_ssh_msg_kex_dh_gex_request.rb and 4 other locations - About 25 mins to fix
lib/hrr_rb_ssh/messages/004_ssh_msg_debug.rb on lines 3..17
lib/hrr_rb_ssh/messages/031_ssh_msg_kexdh_reply.rb on lines 3..17
lib/hrr_rb_ssh/messages/031_ssh_msg_kexecdh_reply.rb on lines 3..17
lib/hrr_rb_ssh/messages/033_ssh_msg_kex_dh_gex_reply.rb on lines 3..17

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

module HrrRbSsh
  module Messages
    class SSH_MSG_DEBUG
      include Codable

Severity: Major
Found in lib/hrr_rb_ssh/messages/004_ssh_msg_debug.rb and 4 other locations - About 25 mins to fix
lib/hrr_rb_ssh/messages/031_ssh_msg_kexdh_reply.rb on lines 3..17
lib/hrr_rb_ssh/messages/031_ssh_msg_kexecdh_reply.rb on lines 3..17
lib/hrr_rb_ssh/messages/033_ssh_msg_kex_dh_gex_reply.rb on lines 3..17
lib/hrr_rb_ssh/messages/034_ssh_msg_kex_dh_gex_request.rb on lines 3..17

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

      rescue => e
        log_error { "Failed opening channel" }
        log_error { [e.backtrace[0], ": ", e.message, " (", e.class.to_s, ")\n\t", e.backtrace[1..-1].join("\n\t")].join }
        raise "Error in shell"
      ensure
Severity: Minor
Found in lib/hrr_rb_ssh/client.rb and 3 other locations - About 25 mins to fix
lib/hrr_rb_ssh/client.rb on lines 119..123
lib/hrr_rb_ssh/client.rb on lines 183..187
lib/hrr_rb_ssh/client.rb on lines 210..214

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

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

        rescue => e
          log_error { [e.backtrace[0], ": ", e.message, " (", e.class.to_s, ")\n\t", e.backtrace[1..-1].join("\n\t")].join }
          close
          raise Error::ClosedTransport
        end
Severity: Minor
Found in lib/hrr_rb_ssh/transport.rb and 2 other locations - About 25 mins to fix
lib/hrr_rb_ssh/transport.rb on lines 93..97
lib/hrr_rb_ssh/transport.rb on lines 167..171

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