Showing 93 of 93 total issues
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"
Further reading
Method instances
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def instances
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 ask_with_other
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def ask_with_other(message, all, choices, default, other)
Method ask_space
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def ask_space(org)
spaces = org.spaces(:depth => 0)
if spaces.empty?
unless 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 ask_with_other
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def ask_with_other(message, all, choices, default, other)
choices = choices.sort_by(&:name)
choices << other if other
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 check_application
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def check_application(app)
if app.debug == "suspend"
line "Application is in suspended debugging mode."
line "It will wait for you to attach to it before starting."
return
- 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 apply_changes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def apply_changes(app)
app.memory = megabytes(input[:memory]) if input.has?(:memory)
app.total_instances = input[:instances] if input.has?(:instances)
app.command = input[:command] if input.has?(:command)
app.production = input[:plan].upcase.start_with?("P") if input.has?(:plan)
- 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 logs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def logs
app = input[:app]
instances =
if input[:all] || input[:instance] == "all"
- 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 domains
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def domains
space = input[:space]
domains =
if input[:all]
- 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 clear_space
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def clear_space(space)
apps = space.apps
services = space.service_instances
return true if apps.empty? && services.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 create_services
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_services(app)
return unless input[:create_services]
while true
invoke :create_service, { :app => app }, :plan => :interact
- 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_service
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def display_service(i)
if quiet?
line i.name
elsif v2?
plan = i.service_plan
- 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 ask_organization
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def ask_organization
orgs = client.organizations(:depth => 0)
if orgs.empty?
unless 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 determine_runtime
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def determine_runtime(framework)
return input[:runtime] if input.has?(:runtime)
detected_runtimes =
if framework.name == "standalone"
- 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 false unless File.fnmatch(provider, plan.service.provider)
Avoid too many return
statements within this method. Open
return false unless File.fnmatch(version, i.version)
Avoid too many return
statements within this method. Open
return false unless File.fnmatch(plan.upcase, plan.name.upcase)
Avoid too many return
statements within this method. Open
return false unless File.fnmatch(version, plan.service.version)
Method precondition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def precondition
check_target
check_logged_in
return unless v2?
- 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"