Showing 114 of 202 total issues
Method initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(string, offset: , length: )
if length == Float::INFINITY
length = string.bytesize - offset
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 encode_chars
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def encode_chars(include: nil, exclude: nil)
included = (Chars::CharSet.new(*include) if include)
excluded = (Chars::CharSet.new(*exclude) if exclude)
formatted = String.new(encoding: ::Encoding::UTF_8)
- 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 escape_byte
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.escape_byte(byte,**kwargs)
if (byte == 42) || (byte == 45) || (byte == 46) || ((byte >= 48) && (byte <= 57)) || ((byte >= 65) && (byte <= 90)) || (byte == 95) || ((byte >= 97) && (byte <= 122))
byte.chr
else
encode_byte(byte,**kwargs)
- 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 telnet_connect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def telnet_connect(host, # connection options
proxy: Telnet.proxy,
port: Telnet::DEFAULT_PORT,
binmode: false,
wait_time: 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 escape_byte
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.escape_byte(byte)
if byte >= 0x00 && byte <= 0xff
ESCAPE_BYTES.fetch(byte) do
if byte >= 0x20 && byte <= 0x7e
byte.chr
- 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 unescape
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.unescape(data)
unescaped = String.new(encoding: Encoding::UTF_8)
scanner = StringScanner.new(data)
until scanner.eos?
- 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 parse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.parse(path=PATH)
return enum_for(__method__,path) unless block_given?
io = if File.extname(path) == '.gz' then Zlib::GzipReader.open(path)
else File.new(path)
- 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_bytes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def encode_bytes(include: nil, exclude: nil)
included = (Chars::CharSet.new(*include) if include)
excluded = (Chars::CharSet.new(*exclude) if exclude)
formatted = String.new(encoding: ::Encoding::UTF_8)
- 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 ssl_connect_and_send
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def ssl_connect_and_send(data,host,port,**kwargs,&block)
Method connect_and_send
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.connect_and_send(data,host,port, min_version: 1, **kwargs, &block)
Method udp_connect_and_send
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def udp_connect_and_send(data,host,port,**kwargs,&block)
Method tls_connect_and_send
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def tls_connect_and_send(data,host,port,**kwargs, &block)
Method tcp_connect_and_send
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def tcp_connect_and_send(data,host,port,**kwargs,&block)
Method unescape
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.unescape(data)
unescaped = String.new(encoding: Encoding::UTF_8)
scanner = StringScanner.new(data)
until scanner.eos?
- 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 escape_byte
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.escape_byte(byte)
if byte >= 0x00 && byte <= 0xff
ESCAPE_BYTES.fetch(byte) do
if byte >= 0x20 && byte <= 0x7e
byte.chr
- 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 escape_byte
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.escape_byte(byte)
if byte >= 0x00 && byte <= 0xff
ESCAPE_BYTES.fetch(byte) do
if byte >= 0x20 && byte <= 0x7e
byte.chr
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(name, direction: ,
key: nil,
hash: :sha256,
password: nil,
iv: nil,
- 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 pack
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def pack(hash)
unknown_keys = hash.keys - @members.keys
unless unknown_keys.empty?
raise(ArgumentError,"unknown union members: #{unknown_keys.map(&:inspect).join(', ')}")
- 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 escape_byte
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.escape_byte(byte)
if byte >= 0x00 && byte <= 0xff
ESCAPE_BYTES.fetch(byte) do
if byte >= 0x20 && byte <= 0x7e
byte.chr
- 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 to_s
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def to_s
message = []
if @from
message << "From: #{@from}"
- 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"