Method shell_command_synchronous
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def shell_command_synchronous(command, args, timeout)
start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC, :millisecond)
command_id = send_command(command, args)
buffer = []
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 send_stdin
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def send_stdin(input, command_id)
open unless shell_id
stdin_msg = WinRM::WSMV::WriteStdin.new(
connection_opts,
- 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_stdout
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def read_stdout(command_id, &block)
open unless shell_id
begin
response_reader.read_output(command_output_message(shell_id, command_id), &block)
rescue WinRM::WinRMWSManFault => e
- 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"