Showing 116 of 225 total issues
Method utilization
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def utilization(queryParameters = {})
ensure_client && ensure_uri
uri = "#{@data['uri']}/utilization?"
queryParameters[:endDate] = convert_time(queryParameters[:endDate])
- 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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.add(client, file_path, data_options, timeout = OneviewSDK::Rest::READ_TIMEOUT)
data_options = Hash[data_options.map { |k, v| [k.to_s, v] }] # Convert symbols hash keys to string
raise InvalidFormat, 'ERROR: File with extension not supported!' unless ACCEPTED_FORMATS.include? File.extname(file_path)
raise IncompleteResource, 'Please set the name of the golden image!' unless data_options['name']
raise IncompleteResource, 'Please set the description of the golden image!' unless data_options['description']
- 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_uplink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_uplink(bay, port, type = nil, enclosure_index = 1)
enclosure_index = type && type.include?('Virtual Connect SE 16Gb FC Module for Synergy') ? -1 : enclosure_index
port = if type
fetch_relative_value_of(port, type)
else
- 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 resource_named
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.resource_named(type, _variant = nil)
new_type = type.to_s.downcase.gsub(/[ -_]/, '')
constants.each do |c|
klass = const_get(c)
next unless klass.is_a?(Class)
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(client, params = {}, api_ver = nil)
super
# Default values:
@data['enclosureType'] ||= 'C7000'
@data['state'] ||= 'Active'
- 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 appliance_api_version
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def appliance_api_version
options = { 'Content-Type' => :none, 'X-API-Version' => :none, 'auth' => :none }
response = rest_api(:get, '/rest/version', options)
version = response_handler(response)['currentVersion']
raise ConnectionError, "Couldn't get API version" unless 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 add_interconnect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_interconnect(bay, type, enclosure_index = 1)
parse_interconnect_map_template(bay, enclosure_index)
@data['interconnectMapTemplate']['interconnectMapEntryTemplates'].each do |entry|
entry['logicalLocation']['locationEntries'].each do |location|
if location['type'] == 'Bay' && location['relativeValue'] == bay
- 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 utilization
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def utilization(queryParameters = {})
ensure_client && ensure_uri
uri = "#{@data['uri']}/utilization?"
queryParameters[:endDate] = convert_time(queryParameters[:endDate])
- 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 utilization
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def utilization(queryParameters = {})
ensure_client && ensure_uri
uri = "#{@data['uri']}/utilization?"
queryParameters[:endDate] = convert_time(queryParameters[:endDate])
- 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(client, params = {}, api_ver = nil)
super
# Default values:
@data['logicalPortConfigInfos'] ||= []
@data['lacpTimer'] ||= 'Short' unless @data['networkType'] == 'FibreChannel' # FibreChannel does not need set up lacpTimer
- 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_volume_attachment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_volume_attachment(volume, attachment_options = {})
raise IncompleteResource, 'Volume not found!' unless volume.retrieve!
# Convert symbols keys to string
attachment_options = Hash[attachment_options.map { |k, v| [k.to_s, v] }]
self['sanStorage'] ||= {}
- 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 get_available_storage_system
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.get_available_storage_system(client, query = nil)
# For storage_system the query requires the ID instead the URI
if query && query['storage_system']
query['storage_system'].retrieve! unless query['storage_system']['uri']
query['storage_system_id'] = query['storage_system']['uri'].split('/').last
- 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 appliance_i3s_api_version
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def appliance_i3s_api_version
options = { 'Content-Type' => :none, 'X-API-Version' => :none, 'auth' => :none }
response = rest_api(:get, '/rest/version', options)
version = response_handler(response)['currentVersion']
raise ConnectionError, "Couldn't get API version" unless 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(client, params = {}, api_ver = nil)
raise InvalidClient, 'Must specify a valid client'\
unless client.is_a?(OneviewSDK::Client) || client.is_a?(OneviewSDK::ImageStreamer::Client)
@client = client
@logger = @client.logger
- 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 search
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def search(type)
resource_class = parse_type(type)
client_setup
filter = parse_hash(options['filter'])
matches = resource_class.find_by(@client, filter)
- 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 remove_volume_attachment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def remove_volume_attachment(id)
self['sanStorage'] ||= {}
self['sanStorage']['volumeAttachments'] ||= []
return if self['sanStorage'].empty? || self['sanStorage']['volumeAttachments'].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"