Showing 16 of 18 total issues
Class Session
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Session
include Error
include ListPath
Method read_and_execute_commands
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def read_and_execute_commands
catch :done do
begin
reply "220 #{server_name_and_version}"
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 option_parser
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def option_parser
OptionParser.new do |op|
op.on('-p', '--port N', Integer, 'Bind to a specific port') do |t|
@port = t
end
Method make_server_thread
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def make_server_thread
Thread.new do
Thread.abort_on_exception = true
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 standard_command_handlers
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.standard_command_handlers
[
CmdAbor,
CmdAllo,
CmdAppe,
Method cmd_port
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cmd_port(argument)
ensure_logged_in
ensure_not_epsv_all
pieces = argument.split(/,/)
syntax_error unless pieces.size == 6
- 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 triad
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def triad(read_bit, write_bit, execute_bit, special_bit, special_letters)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(user, password, account, data_dir, read_only)
Method cmd_mode
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def cmd_mode(argument)
syntax_error unless argument
ensure_logged_in
name, implemented = TRANSMISSION_MODES[argument]
error "Invalid mode code", 504 unless name
- 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 cmd_epsv
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def cmd_epsv(argument)
ensure_logged_in
if data_server
reply "200 Already in passive mode"
else
- 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 open_data_connection
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def open_data_connection(path_to_advertise = nil, &block)
send_start_of_data_connection_reply(path_to_advertise)
if data_server
if encrypt_data?
open_passive_tls_data_connection(&block)
- 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 cmd_prot
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def cmd_prot(level_arg)
level_code = level_arg.upcase
unless protection_buffer_size_set
error "PROT must be preceded by PBSZ", 503
end
- 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 cmd_stru
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def cmd_stru(argument)
syntax_error unless argument
ensure_logged_in
name, implemented = FILE_STRUCTURES[argument]
error "Invalid structure code", 504 unless name
- 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 stop_track
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def stop_track(socket)
@mutex.synchronize do
ip = @socket_ips.delete(socket.object_id)
break unless ip
if (@connections[ip] -= 1) == 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 cmd_pbsz
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def cmd_pbsz(buffer_size)
ensure_tls_supported
syntax_error unless buffer_size =~ /^\d+$/
buffer_size = buffer_size.to_i
unless socket.encrypted?
- 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 converted_chunk
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def converted_chunk(io)
chunk = io.read(CHUNK_SIZE)
return unless chunk
if data_type == 'A'
next_char = io.getc
- 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"