Showing 83 of 169 total issues
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
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
Method request_authentication
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def request_authentication username, service_name
message = {
:'message number' => Messages::SSH_MSG_USERAUTH_REQUEST::VALUE,
:"user name" => username,
:"service name" => service_name,
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
Method shell
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def shell env: {}
log_info { "start shell" }
begin
log_info { "Opning channel" }
channel = @connection.request_channel_open "session"
Method sender_thread
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sender_thread
Thread.new(@socket){ |s|
begin
loop do
begin
Method sender_thread
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sender_thread
Thread.new(@socket){ |s|
begin
loop do
begin
Method start_service
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def start_service io, logger=nil
begin
require 'hrr_rb_ssh'
rescue LoadError
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
- Read upRead up
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 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
- Read upRead up
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 run
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.run proc_chain, username, io, variables, message, options, session, logger: nil
Method run
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.run proc_chain, username, io, variables, message, options, session, logger: nil
Method run
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.run proc_chain, username, io, variables, message, options, session, logger: nil
Method run
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.run proc_chain, username, io, variables, message, options, session, logger: nil
Method run
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.run proc_chain, username, io, variables, message, options, session, logger: nil
Method run
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.run proc_chain, username, io, variables, message, options, session, logger: nil
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize proc_chain, username, io, variables, message, session, logger: nil
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize proc_chain, username, io, variables, message, session, logger: nil
Method initialize_dh
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize_dh pg=nil
unless pg
p_list = KexAlgorithms.constants.map{|c| KexAlgorithms.const_get(c)}.select{|c| c.respond_to?(:const_defined?) && c.const_defined?(:P)}.map{|c| [OpenSSL::BN.new(c::P,16).num_bits, c::P]}.sort_by{|e| e[0]}.reverse
candidate = p_list.find{ |e| e[0] <= @n }
raise unless (@min .. @max).include?(candidate[0])
- Read upRead up
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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize proc_chain, username, io, variables, message, session, logger: nil
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize proc_chain, username, io, variables, message, session, logger: nil