Method status
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
def status
if options[:uuid]
begin
say(get_director_status["uuid"])
rescue => 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"
Further reading
Method status
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def status
if options[:uuid]
begin
say(get_director_status["uuid"])
rescue => e
File misc.rb
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Bosh::Cli::Command
class Misc < Base
DEFAULT_STATUS_TIMEOUT = 3 # seconds
# bosh version
Method set_target
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_target(director_url = nil, name = nil)
if director_url.nil?
show_target
return
end
Method login
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def login(username = nil, password = nil)
target_required
if interactive?
username = ask("Your username: ").to_s if username.blank?
- 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 set_target
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def set_target(director_url = nil, name = nil)
if director_url.nil?
show_target
return
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 login
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def login(username = nil, password = nil)
target_required
if interactive?
username = ask("Your username: ").to_s if username.blank?
Method show_target
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def show_target
if config.target
if interactive?
if config.target_name
name = "#{config.target} (#{config.target_name})"
- 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 print_feature_list
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def print_feature_list(features)
if features.respond_to?(:each)
features.each do |feature, info|
# Old director only returns status as a Boolean
if info.kind_of?(Hash)
- 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"