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 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
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 manifest_file
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def manifest_file
return @manifest_file if @manifest_file
unless path = input[:manifest]
where = Dir.pwd
- 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
Consider simplifying this complex logical expression. Open
if svc[:label] == "user-provided"
invoke :create_service,
name: name,
offering: CF::Service::UPDummy.new,
app: app,
Method setup_services
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def setup_services(app, info)
return if !info[:services] || info[:services].empty?
offerings = client.services
Method create_manifest_for
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_manifest_for(app, path)
meta = {
"name" => app.name,
"memory" => human_size(app.memory * 1024 * 1024, 0),
"instances" => app.total_instances,
Method apps_in_manifest
has 32 lines of code (exceeds 25 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
Method create_manifest_for
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_manifest_for(app, path)
meta = {
"name" => app.name,
"memory" => human_size(app.memory * 1024 * 1024, 0),
"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"