Showing 196 of 247 total issues
Method try_next
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def try_next
raise StopIteration.new if closed?
retried = false
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 set_cert
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_cert(context, options)
# Since we clear cert_text during processing, we need to examine
# ssl_cert_object here to avoid considering it if we have also
# processed the text.
if options[:ssl_cert]
- 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 find_command
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def find_command
document = BSON::Document.new
document.store(FIND, collection)
document.store(FILTER, query_filter)
OPTION_MAPPINGS.each do |legacy, option|
- 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 validate_address_str!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate_address_str!(address_str)
case address_str
when /\A\[[\d:]+\](?::(\d+))?\z/
# ipv6 with optional port
if port_str = $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 initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(options)
options = Options::Mapper.transform_keys_to_symbols(options)
options = Options::Mapper.transform_values_to_strings(options).freeze
if options[:w]
- 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 retry_write_allowed?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def retry_write_allowed?(session, write_concern)
unless session && session.retry_writes?
return false
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 initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(host, port, host_name, timeout, family, options = {})
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(address, cluster, monitoring, event_listeners, options = {})
Method command_completed
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def command_completed(result, address, operation_id, payload, duration)
Method command_succeeded
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def command_succeeded(result, address, operation_id, payload, duration)
Method generate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.generate(address, operation_id, command_payload, reply_payload, duration)
Method finalize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.finalize(cursor_id, cluster, op_spec, server, session)
Method insert_one
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def insert_one(documents, server, operation_id, session, txn_num)
Method update_one
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_one(documents, server, operation_id, session, txn_num)
Method update_many
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def update_many(documents, server, operation_id, session, txn_num)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(database, collection, selector, update, options = {})
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(host, port, timeout, family, options = {})
Method delete_many
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete_many(documents, server, operation_id, session, txn_num)
Method delete_one
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete_one(documents, server, operation_id, session, txn_num)
Method server_type
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def server_type
return :arbiter if arbiter?
return :ghost if ghost?
return :sharded if mongos?
return :primary if primary?
- 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"