Class Node
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
class Node
include Executable
include Instrumentable
# @!attribute address
Method update
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def update(database, collection, selector, change, concern, options = {})
Method ensure_connected
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def ensure_connected(&block)
unless (conn = stack(:connection)).empty?
return yield(conn.first)
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 insert
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def insert(database, collection, documents, concern, options = {})
Method remove
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def remove(database, collection, selector, concern, options = {})
Method refresh
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def refresh
if address.resolve(self)
begin
@refreshed_at = Time.now
configure(command("admin", ismaster: 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 connection
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def connection
connection_acquired = false
begin
pool.with do |conn|
connection_acquired = true
- 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"