Showing 114 of 202 total issues
Method initialize_ssl
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize_ssl(ca_bundle: nil,
cert: nil,
cert_store: nil,
ciphers: nil,
extra_chain_cert: nil,
Method imap_connect
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def imap_connect(host, user: ,
password: ,
port: DEFAULT_PORT,
ssl: nil,
auth: :login)
Method get_string
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_string(offset,length=nil)
if (offset < 0) || (offset >= size)
raise(IndexError,"offset #{offset} is out of bounds: 0...#{size - 1}")
elsif (length && (offset + length) > size)
raise(IndexError,"offset #{offset} or length #{length} is out of bounds: 0...#{size - 1}")
- 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 ip
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def ip(ip)
address = ip.to_s
ip = IPAddr.new(ip) unless ip.kind_of?(IPAddr)
prefixes = if ip.ipv6? then @ipv6_prefixes
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def self.escape_byte(byte)
if byte >= 0x00 && byte <= 0xff
if byte == 0x22
"\\\""
elsif byte == 0x5d
- 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 connect_uri
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def self.connect_uri(url, ssl: nil,
user: nil,
password: nil,
**kwargs, &block)
case url
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_s
message = []
if @from
message << "From: #{@from}"
Method parse
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.parse(string)
kwargs = {}
params = {}
string.split(/;\s+/) do |field|
Method pop3_connect
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def pop3_connect(host, port: DEFAULT_PORT,
ssl: nil,
user: ,
password: )
host = DNS::IDN.to_ascii(host)
Method connect_uri
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.connect_uri(url, ssl: nil,
user: nil,
password: nil,
**kwargs, &block)
case url
Method each_unique_substring
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def each_unique_substring(min=1,&block)
return enum_for(__method__,min) unless block
unique_strings = {}
- 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_line
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse_line(line)
if @type.kind_of?(CTypes::CharType)
# because od/hexdump print the ' ' char as white space,
# we need special parsing logic here.
if (start_index = line.index(' '))
- 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 padding
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.padding(new_padding=nil)
unless new_padding.nil?
@padding = new_padding
else
if @padding.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 stream
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def stream(io, block_size: 16384, output: nil)
unless block_given?
output ||= String.new(encoding: Encoding::ASCII_8BIT)
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 poll
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def poll
sockets = [@socket] + client_connections + server_connections
readable, _writtable, errors = IO.select(sockets,nil,sockets)
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def self.parse(string)
kwargs = {}
params = {}
string.split(/;\s+/) do |field|
- 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 build
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.build(common_name: nil, email_address: nil, organizational_unit: nil, organization: nil, locality: nil, state: nil, province: nil, country: nil)
name = new
name.add_entry("CN",common_name) if common_name
name.add_entry('emailAddress',email_address) if email_address
name.add_entry("OU",organizational_unit) if organizational_unit
- 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?
type = 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 join
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def join(*names)
joined_path = if root? then String.new(encoding: Encoding::UTF_8)
else self.to_s
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 tld_regexp
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def tld_regexp(tld,subtree)
if subtree
subtree_regexp = if subtree.length == 1
tld_regexp(subtree.keys[0],subtree.values[0])
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"