Showing 40 of 46 total issues
Method request_uri
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def request_uri(method, uri, options = {})
uri = URI.parse(uri)
unless uri.is_a?(URI::HTTP)
raise InvalidTarget.new(@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 succeed_to_load
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def succeed_to_load(options={})
response_body = Helper.load_fixtures(options[:fixture] || "fake_cc_user")
response_body["metadata"]["guid"] = options[:id] || "user-id-1"
if options[:no_organizations]
- 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 to_many
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def to_many(plural, opts = {})
to_many_relations[plural] = opts
singular = plural.to_s.sub(/s$/, "").to_sym
- 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 add_client_methods
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_client_methods(klass)
singular = klass.object_name
plural = klass.plural_object_name
define_base_client_methods do
Class App
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class App < Model
include CFoundry::UploadHelpers
attribute :name, :string
to_one :space
Method to_one
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def to_one(name, opts = {})
to_one_relations[name] = opts
association_name = opts[:as] || name
default = opts[:default]
- 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 to_many
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_many(plural, opts = {})
to_many_relations[plural] = opts
singular = plural.to_s.sub(/s$/, "").to_sym
Class Model
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Model
include ActiveModel::Validations
@@objects = {}
Method request_uri
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
def request_uri(method, uri, options = {})
uri = URI.parse(uri)
unless uri.is_a?(URI::HTTP)
raise InvalidTarget.new(@target)
Method add_client_methods
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def add_client_methods(klass)
singular = klass.object_name
plural = klass.plural_object_name
define_base_client_methods do
- 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 attribute
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def attribute(name, type, opts = {})
attributes[name] = opts
json_name = opts[:at] || name
default = opts[:default]
- 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 BaseClient
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class BaseClient # :nodoc:
include CFoundry::ProxyOptions
extend Forwardable
Method to_one
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_one(name, opts = {})
to_one_relations[name] = opts
association_name = opts[:as] || name
default = opts[:default]
Method health
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def health
if state == "STARTED"
healthy_count = running_instances
expected = 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 create!
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def create!
payload = {}
@manifest ||= {}
@manifest[:entity] ||= {}
- 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_request
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def log_request(time, request, response)
return unless @log
data = log_data(time, request, response)
- 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!
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create!
payload = {}
@manifest ||= {}
@manifest[:entity] ||= {}
Method attribute
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def attribute(name, type, opts = {})
attributes[name] = opts
json_name = opts[:at] || name
default = opts[:default]
Method upload_app
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def upload_app(guid, zipfile = nil, resources = [])
payload = {}
payload[:resources] = MultiJson.dump(resources)
if zipfile
- 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 has_summary
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def has_summary(actions = {})
#
# def summary
#
define_method(:summary) do