Showing 156 of 616 total issues
Method data
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.data
@data ||= Hash.new do |hash, key|
hash[key] = {
:shares => [
{
Method data
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.data
@data ||= Hash.new do |hash, key|
hash[key] = {
:zones => [{
"id" => "a86dba58-0043-4cc6-a1bb-69d5e86f3ca3",
Class Server
has 47 methods (exceeds 20 allowed). Consider refactoring. Open
class Server < Fog::Compute::Server
identity :id
attribute :instance_name, :aliases => 'OS-EXT-SRV-ATTR:instance_name'
attribute :addresses
Method data
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.data
@data ||= Hash.new do |hash, key|
qos_policy_id = Fog::UUID.uuid
network_id = Fog::UUID.uuid
extension_id = Fog::UUID.uuid
File token_test.rb
has 411 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'test_helper'
require 'auth_helper'
describe Fog::OpenStack::Auth::Token do
describe 'V3' do
File network.rb
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Fog
module OpenStack
class Network < Fog::Service
requires :openstack_auth_url
recognizes :openstack_auth_token, :openstack_management_url,
Method create_server
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
def create_server(name, image_ref, flavor_ref, options = {})
data = {
'server' => {
'flavorRef' => flavor_ref,
'name' => name
- 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 data
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.data
@data ||= Hash.new do |hash, key|
chassis_uuid = Fog::UUID.uuid
instance_uuid = Fog::UUID.uuid
node_uuid = Fog::UUID.uuid
File shared_file_system.rb
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Fog
module OpenStack
class SharedFileSystem < Fog::Service
SUPPORTED_VERSIONS = /v2(\.0)*/
SUPPORTED_MICROVERSION = '2.15'.freeze
File compute.rb
has 324 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Fog
module OpenStack
class Compute < Fog::Service
SUPPORTED_VERSIONS = /v2\.0|v2\.1/
SUPPORTED_MICROVERSION = '2.15'.freeze
File server.rb
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'fog/compute/models/server'
require 'fog/openstack/compute/models/metadata'
module Fog
module OpenStack
Method data
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.data
@data ||= Hash.new do |hash, key|
hash[key] = {
:last_modified => {
:images => {},
Method list_metrics
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list_metrics(_options = {})
response = Excon::Response.new
response.status = 200
response.body = [
{
Method setup
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def setup(options)
if options.respond_to?(:config_service?) && options.config_service?
configure(options)
return
end
- 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_server
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_server(name, image_ref, flavor_ref, options = {})
response = Excon::Response.new
response.status = 202
server_id = Fog::Mock.random_numbers(6).to_s
File v2.rb
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'fog/openstack/dns'
module Fog
module OpenStack
class DNS
Method create_server
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_server(name, image_ref, flavor_ref, options = {})
data = {
'server' => {
'flavorRef' => flavor_ref,
'name' => name
Class Image
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Image < Fog::OpenStack::Model
identity :id
attribute :name
attribute :visibility # public or private
Method get_limits
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_limits(_options = {})
rate_limits = [
{'regex' => '.*',
'limit' => [
{'next-available' => '2012-11-22T16:13:44Z',
Method create_server
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def create_server(name, image_ref, flavor_ref, options = {})
response = Excon::Response.new
response.status = 202
server_id = Fog::Mock.random_numbers(6).to_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"