Method build_unirpc_message
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def build_unirpc_message(
version_byte: 0x6c,
other_version_byte: 0x01,
body_length_override: 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 recv_unirpc_message
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
def recv_unirpc_message(sock, first_result_is_status: false)
# Receive the header
header = sock.get_once(0x18)
# Make sure we received all of it
Method build_unirpc_message
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_unirpc_message(
version_byte: 0x6c,
other_version_byte: 0x01,
body_length_override: nil,
Method recv_unirpc_message
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def recv_unirpc_message(sock, first_result_is_status: false)
# Receive the header
header = sock.get_once(0x18)
# Make sure we received all of it
- 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 unirpc_get_version
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def unirpc_get_version
# These are the services we've found that return version numbers
['defcs', 'udserver'].each do |service|
vprint_status("Trying to get version number from service #{service}...")
connect
- 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"