Showing 89 of 93 total issues
Method scale
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def scale
app = input[:app]
if input.has?(:instances)
instances = input[:instances, app.total_instances]
Method wrap_errors
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def wrap_errors
yield
rescue CFoundry::Timeout => e
err(e.message)
rescue Interrupt
Method service_matches
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def service_matches(i, options)
if app = options[:app]
return false unless app.services.include? i
end
Method log_error
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def log_error(e)
ensure_config_dir
msg = e.class.name
msg << ": #{e}" unless e.to_s.empty?
Method create_space
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_space
# TODO: ask org instead
return invoke :help,
:command => "create-space" if input[:organization].nil?
Method delete_service
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delete_service
if input[:all]
return unless input[:really, "ALL SERVICES", :bad]
client.service_instances.each do |i|
Method delete_org
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delete_org
org = input[:organization]
return unless input[:really, org]
spaces = org.spaces
Method bind_services
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def bind_services(app)
return unless input[:bind_services]
while true
invoke :bind_service, :app => app
- 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 log_error
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def log_error(e)
ensure_config_dir
msg = e.class.name
msg << ": #{e}" unless e.to_s.empty?
- 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 show_instance_logs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def show_instance_logs(app, i)
return unless i.id
logs =
with_progress(
- 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 wrap_errors
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def wrap_errors
yield
rescue CFoundry::Timeout => e
err(e.message)
rescue Interrupt
- 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 unmap_domain
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def unmap_domain
domain = input[:domain]
given_org = input.has?(:organization)
given_space = input.has?(:space)
- 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 switch_mode
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def switch_mode(app, mode)
mode = nil if mode == "none"
mode = "run" if mode == "" # no value given
return false if app.debug == mode
- 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 v1_unmap
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def v1_unmap
app = input[:app]
url = input[:url, app.urls] unless input[:all]
with_progress("Updating #{c(app.name, :name)}") do |s|
- 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 display_org_and_space
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def display_org_and_space
return unless v2?
if org = client.current_organization
line "organization: #{c(org.name, :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 display_apps_table
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def display_apps_table(apps)
table(
["name", "status", "usage", v2? && "plan", "runtime", "url"],
apps.collect { |a|
[ c(a.name, :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 org
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def org
org = input[:organization]
unless org
return if quiet?
- 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 crashes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def crashes
apps = input[:apps]
fail "No applications given." if apps.empty?
spaced(apps) do |app|
- 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 spaces
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def spaces
org = input[:organization]
spaces =
with_progress("Getting spaces in #{c(org.name, :name)}") do
org.spaces(:depth => quiet? ? 0 : 1).sort_by(&: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 select_org
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def select_org(input, info)
if input.has?(:organization) || !org_valid?(info[:organization])
org = input[:organization]
if org
with_progress("Switching to organization #{c(org.name, :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"