Showing 110 of 197 total issues
Method context
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def self.context(version: nil,
verify: :none,
key: nil,
key_file: nil,
cert: 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
Class Struct
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Struct < Memory
# The type system used by the struct.
#
# @return [CTypes::StructType]
Method build
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def self.build(method,path, # query string keyword arguments
query: nil,
query_params: nil,
# Basic-Auth keyword arguments
user: 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
Consider simplifying this complex logical expression. Open
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)
end
Consider simplifying this complex logical expression. Open
if (byte == 45) || (byte == 46) || ((byte >= 48) && (byte <= 57)) || ((byte >= 65) && (byte <= 90)) || (byte == 95) || ((byte >= 97) && (byte <= 122)) || (byte == 126)
byte.chr
elsif byte == 0x20
'+'
else
Method build
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def self.build(fields, alignment: nil, padding: true)
members = {}
max_alignment = 0
pack_string = String.new(encoding: Encoding::ASCII_8BIT)
- 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 read_string
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def read_string(length=nil)
new_string = if (encoding = external_encoding)
String.new('', encoding: encoding)
else
String.new('')
- 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_ssl
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def initialize_ssl(ca_bundle: nil,
cert: nil,
cert_store: nil,
ciphers: nil,
extra_chain_cert: 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 parse
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def parse(hexdump)
return enum_for(__method__,hexdump) unless block_given?
previous_address = nil
first_address = 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 encode_byte
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def self.encode_byte(byte, format: :decimal, zero_pad: false, **kwargs)
case format
when :decimal
if zero_pad then "&#%.7d;" % byte
else "&#%d;" % byte
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
def self.escape_byte(byte,**kwargs)
if (byte >= 0) && (byte <= 0xff)
if (byte == 45) || (byte == 46) || ((byte >= 48) && (byte <= 57)) || ((byte >= 65) && (byte <= 90)) || (byte == 95) || ((byte >= 97) && (byte <= 122)) || (byte == 126)
byte.chr
elsif byte == 0x20
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
def self.escape_byte(byte,**kwargs)
if (byte >= 0) && (byte <= 0xff)
if (byte == 33) || (byte == 36) || (byte == 38) || ((byte >= 39) && (byte <= 59)) || (byte == 61) || ((byte >= 63) && (byte <= 91)) || (byte == 93) || (byte == 95) || ((byte >= 97) && (byte <= 122)) || (byte == 126)
byte.chr
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 build
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.build(method,path, # query string keyword arguments
query: nil,
query_params: nil,
# Basic-Auth keyword arguments
user: nil,
Method generator
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.generator(**kwargs)
if kwargs.empty?
DEFAULT
else
rules = []
- 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 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def poll
sockets = [@socket] + client_connections + server_connections
readable, _writtable, errors = IO.select(sockets,nil,sockets)
Method each
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def each
return enum_for(__method__) unless block_given?
io = IO.popen(command_argv('-v','-l',@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 parse
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(hexdump)
return enum_for(__method__,hexdump) unless block_given?
previous_address = nil
first_address = nil
Method generate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.generate(version: 2,
serial: 0,
not_before: Time.now,
not_after: not_before + ONE_YEAR,
subject: 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 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"