Showing 53 of 85 total issues
Method get_blob_raw
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_blob_raw(container, blob, key = access_key, options = {})
raise ArgumentError, "No access key specified" unless key
url = File.join(properties.primary_endpoints.blob, container, blob)
url += "?snapshot=" + options[:date] if options[:date]
Method delete_unmanaged_storage
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delete_unmanaged_storage(vm, options)
sas = Azure::Armrest::StorageAccountService.new(configuration)
storage_account = sas.get_from_vm(vm)
Method read
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read(sas_url, options = {})
# The same restrictions that apply to the StorageAccount method also apply here.
range = options[:range] if options[:range]
range ||= options[:start_byte]..options[:end_byte] if options[:start_byte] && options[:end_byte]
range ||= options[:start_byte]..options[:start_byte] + options[:length] - 1 if options[:start_byte] && options[:length]
Method add_file_content
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_file_content(share, file, key = access_key, options = {})
raise ArgumentError, "No access key specified" unless key
timeout = options.delete(:timeout)
content = options.delete(:content)
Method files
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def files(share, key = access_key, options = {})
raise ArgumentError, "No access key specified" unless key
query = "comp=list&restype=directory"
- 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 build_id_string
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_id_string(resource_group = nil, *args)
id_string = File.join('', 'subscriptions', configuration.subscription_id)
id_string = File.join(id_string, 'resourceGroups', resource_group) if resource_group
id_string = File.join(id_string, 'providers', @provider, @service_name)
Method delete_associated_nics
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def delete_associated_nics(vm, options)
nis = Azure::Armrest::Network::NetworkInterfaceService.new(configuration)
nics = vm.properties.network_profile.network_interfaces.map(&:id)
if options[:ip_addresses]
Method initialize
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(args)
# Use defaults, and override with provided arguments
options = {
:api_version => '2015-01-01',
:accept => 'application/json',
Method create_blob_snapshot
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_blob_snapshot(container, blob, key = access_key, options = {})
raise ArgumentError, "No access key specified" unless key
timeout = options.delete(:timeout) # Part of request
Method __setobj__
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __setobj__
excl_list = self.class.send(:excl_list)
@hashobj.each do |key, value|
snake = key.to_s.gsub(/\W/, '_').underscore
- 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 containers
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def containers(key = access_key, options = {})
raise ArgumentError, "No access key specified" unless key
query = "comp=list"
skip_defs = options[:skip_accessors_definition]
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(args)
# Use defaults, and override with provided arguments
options = {
:api_version => '2015-01-01',
:accept => 'application/json',
- 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
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(offer, sku, version, location = @location, publisher = @publisher)
Method copy_blob
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def copy_blob(src_container, src_blob, dst_container, dst_blob = nil, key = access_key)
Method file_response
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def file_response(key, query, request_type = 'get', payload = '', *args)
Method copy_file
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def copy_file(src_container, src_file, dst_container = src_container, dst_file = nil, key = access_key)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(configuration, service_name, subservice_name, default_provider, options)
Method rest_execute
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def rest_execute(url, body = nil, http_method = :get, encode = true, max_retries = 3)
Method build_url
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_url(provider, resource_type, resource_name, resource_group, options)
Method list
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def list(provider, resource_type, resource_name, resource_group = nil, options = {})