Method php_cmd_as_string
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def php_cmd_as_string
bin_path_tries = [
"/usr/bin/php5",
"/usr/bin/php"
]
- 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 check_php_process_startup
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def check_php_process_startup
$stderr.print "Waiting for PHP-script to be ready.\n" if @debug
started = false
@stdout.each_line do |line|
puts "Line: #{line}" if @debug
- 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_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_data(data)
if data.is_a?(PhpProcess::ProxyObject)
return {type: :proxyobj, id: data.args[:id]}
elsif data.is_a?(PhpProcess::CreatedFunction)
return {type: :php_process_created_function, id: data.args[:id]}
- 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 destroy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def destroy
@destroyed = true
@stdout.close if @stdout && !@stdout.closed?
@stdin.close if @stdin && !@stdin.closed?
@stderr.close if @stderr && !@stderr.closed?
- 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
Avoid too many return
statements within this method. Open
return data