Showing 102 of 102 total issues
Class CLI
has 44 methods (exceeds 20 allowed). Consider refactoring. Open
class CLI < Mothership
include CF::Interactive
include CF::Spacing
option :help, :desc => "Show command usage", :alias => "-h",
File cli.rb
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yaml"
require "socket"
require "net/http"
require "json/ext"
require "multi_json"
Method tabular
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def tabular(*rows)
spacings = []
rows.each do |row|
next unless row
- 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 setup_services
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def setup_services(app, info)
return if !info[:services] || info[:services].empty?
offerings = client.services
- 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 a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def login
show_context
expected_prompts = if input[:sso]
[:username, :passcode]
- 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 apps_in_manifest
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def apps_in_manifest(input = nil, use_name = true, &blk)
names_or_paths =
if input.has?(:apps)
# names may be given but be [], which will still cause
# interaction, so use #direct instead of #[] here
- 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 tail
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def tail
app = input[:app]
lines = Queue.new
max_len = 0
- 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
Class VMrun
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class VMrun
attr_reader :vmx, :vmrun
def initialize(config)
@platform = config[:platform]
Class CFTunnel
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class CFTunnel
HELPER_NAME = "caldecott"
HELPER_APP = File.expand_path("../helper-app", __FILE__)
# bump this AND the version info reported by HELPER_APP/server.rb
Method wrap_with_optional_name
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def wrap_with_optional_name(name_made_optional, cmd, input, fail_without_app)
return cmd.call if input[:all]
unless manifest
# if the command knows how to handle this
- 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_service
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def create_service
offerings = client.services
if input[:provider]
offerings.reject! { |s| s.provider != input[:provider] }
- 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 17 (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
File manifests.rb
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "yaml"
require "set"
require "cf/cli/service/create"
require "manifests/loader"
Method client
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def client(target = client_target)
return @@client if defined?(@@client) && @@client
return unless target
info = target_info(target)
- 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 matches
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def matches(opts = {})
service = opts[:service]
plan = opts[:plan]
provider = opts[:provider]
version = opts[:version]
- 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_service
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_service
offerings = client.services
if input[:provider]
offerings.reject! { |s| s.provider != input[:provider] }
Method login
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def login
show_context
expected_prompts = if input[:sso]
[:username, :passcode]
Method map_domain
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def map_domain
domain = client.domain_by_name(input[:name])
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 scale
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def scale
app = input[:app]
if input.has?(:instances)
instances = input[:instances, app.total_instances]
- 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 load_all
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def self.load_all
# auto-load gems with 'cf-plugin' in their name
matching =
if Gem::Specification.respond_to? :find_all
Gem::Specification.find_all 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"