Showing 83 of 169 total issues
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
File transport.rb
has 475 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'hrr_rb_ssh/version'
require 'hrr_rb_ssh/error/closed_transport'
require 'hrr_rb_ssh/transport/constant'
require 'hrr_rb_ssh/transport/direction'
require 'hrr_rb_ssh/transport/sequence_number'
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
- 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 a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def initialize
@proc = Proc.new { |context|
begin
ptm, pts = PTY.open
passwd = Etc.getpwnam(context.username)
- 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
Class Transport
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class Transport
include Loggable
include Constant
attr_reader \
Class Channel
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class Channel
include Loggable
INITIAL_WINDOW_SIZE = 100000
MAXIMUM_PACKET_SIZE = 100000
Method initialize
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def initialize
@proc = Proc.new { |context|
ptm = context.vars[:ptm]
pts = context.vars[:pts]
- 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
File connection.rb
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'hrr_rb_ssh/error/closed_connection'
require 'hrr_rb_ssh/connection/global_request_handler'
require 'hrr_rb_ssh/connection/channel'
module HrrRbSsh
Method start_service
has 72 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 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@proc = Proc.new { |context|
begin
ptm, pts = PTY.open
passwd = Etc.getpwnam(context.username)
Method exec!
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def exec! command, pty: false, env: {}
log_info { "start exec!: #{command}" }
out_buf = StringIO.new
err_buf = StringIO.new
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
Class Connection
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Connection
include Loggable
attr_reader \
:username,
Method sender_thread
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def sender_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 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?
- 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 sender_thread
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def sender_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 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?
- 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 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?
- 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 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@proc = Proc.new { |context|
ptm = context.vars[:ptm]
pts = context.vars[:pts]
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
Method exec!
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exec! command, pty: false, env: {}
log_info { "start exec!: #{command}" }
out_buf = StringIO.new
err_buf = StringIO.new
begin