Showing 83 of 169 total issues
Method start_service
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_service io, logger=nil
require 'etc'
begin
require 'hrr_rb_ssh'
Method initialize
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@proc = Proc.new { |context|
ptm = context.vars[:ptm]
pts = context.vars[:pts]
Method start_service
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_service io, logger=nil
require 'etc'
begin
require 'hrr_rb_ssh'
Method receive
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def receive
raise Error::ClosedTransport if @closed
@receiver_monitor.synchronize do
begin
payload = @receiver.receive self
Method respond_to_authentication
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def respond_to_authentication
authentication_methods = (@options['authentication_preferred_authentication_methods'].dup rescue nil) || Method.list_preferred # rescue nil.dup for Ruby version < 2.4
log_info { "preferred authentication methods: #{authentication_methods}" }
loop do
payload = @transport.receive
Method start_service
has a Cognitive Complexity of 14 (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 respond_to_authentication
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def respond_to_authentication
authentication_methods = (@options['authentication_preferred_authentication_methods'].dup rescue nil) || Method.list_preferred # rescue nil.dup for Ruby version < 2.4
log_info { "preferred authentication methods: #{authentication_methods}" }
loop do
payload = @transport.receive
- 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 connection_loop_thread
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def connection_loop_thread
log_info { "start connection loop" }
Thread.new do
begin
while true
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
- 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
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def receive
raise Error::ClosedTransport if @closed
@receiver_monitor.synchronize do
begin
payload = @receiver.receive self
- 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 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
- 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 connection_loop_thread
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def connection_loop_thread
log_info { "start connection loop" }
Thread.new do
begin
while 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 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
- 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 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_service io, logger=nil
begin
require 'hrr_rb_ssh'
rescue LoadError
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
Method request_authentication
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def request_authentication
authentication_methods = (@options['authentication_preferred_authentication_methods'].dup rescue nil) || Method.list_preferred # rescue nil.dup for Ruby version < 2.4
log_info { "preferred authentication methods: #{authentication_methods}" }
next_method_name = "none"
log_info { "authentication request begins with none method" }
- 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 request_authentication
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def request_authentication
authentication_methods = (@options['authentication_preferred_authentication_methods'].dup rescue nil) || Method.list_preferred # rescue nil.dup for Ruby version < 2.4
log_info { "preferred authentication methods: #{authentication_methods}" }
next_method_name = "none"
log_info { "authentication request begins with none method" }
Method start
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start transport
case transport.mode
when Mode::SERVER
message = receive_kex_dh_gex_request transport.receive
@min = message[:'min']
Method exec
has 30 lines of code (exceeds 25 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"
Method start_service
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def start_service io, logger=nil
begin
require 'hrr_rb_ssh'
rescue LoadError
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
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