Showing 83 of 169 total issues
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
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
Method build_key
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_key(_k, h, _x, session_id, key_length)
Method generate_signature
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def generate_signature session_id, username, service_name, method_name, secret_key
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize transport, username, submethods, variables, authentication_methods, logger: nil
Method start_service
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def start_service io, logger=nil
require 'etc'
begin
require 'hrr_rb_ssh'
- 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 receive_version
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def receive_version
str_io = StringIO.new
loop do
str_io.write @io.read(1)
if str_io.string[-2..-1] == "#{CR}#{LF}"
- 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 start_service
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def start_service io, logger=nil
require 'etc'
begin
require 'hrr_rb_ssh'
- 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 encode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.encode arg
unless arg.kind_of? ::Integer
raise ArgumentError, "must be a kind of Integer, but got #{arg.inspect}"
end
bn = ::OpenSSL::BN.new(arg)
- 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 exec
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def exec command, pty: false, env: {}
log_info { "start exec: #{command}" }
begin
log_info { "Opning channel" }
channel = @connection.request_channel_open "session"
- 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 subsystem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def subsystem name
log_info { "start subsystem" }
begin
log_info { "Opning channel" }
channel = @connection.request_channel_open "session"
- 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 decode_recursively
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def decode_recursively payload_io, message=nil
if message.class == Array and message.size == 0
[]
else
definition = case message
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def close
begin
if @sender_thread_finished && @receiver_thread_finished
log_info { "closing forwarded-tcpip" }
@socket.close
- 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 receiver_thread
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def receiver_thread
Thread.new(@socket){ |s|
begin
loop do
begin
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
def close
begin
if @sender_thread_finished && @receiver_thread_finished
log_info { "closing direct-tcpip" }
@socket.close
- 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 decode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.decode io
length = io.read(4).unpack("N")[0]
hex_str = io.read(length).unpack("H*")[0]
# get temporal integer value
value = hex_str.hex
- 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 receiver_thread
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def receiver_thread
Thread.new(@socket){ |s|
begin
loop do
begin
- 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"