Showing 5 of 5 total issues
Method response
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def response
server.forward_port(resource.uri.port) do |address, port|
url = "#{resource.uri.scheme}://#{address}:#{port}"
options = {:url => url}
Method define
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def define(name, *args, &block)
address = args.shift
options = args.any? ? args.shift : {}
if block
st = OpenStruct.new
- 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 response
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def response
server.forward_port(resource.uri.port) do |address, port|
url = "#{resource.uri.scheme}://#{address}:#{port}"
options = {:url => url}
- 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 _ssh_start_args
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _ssh_start_args
config = {}
if @options[:ssh]
config = @options[:ssh]
- 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 fetch_all_addresses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fetch_all_addresses
result = []
uname = ssh_exec('uname -s')
case uname
when /(FreeBSD|OpenBSD)/
- 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"