fog/fog-openstack

View on GitHub

Showing 616 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                   => [
                {
Severity: Major
Found in lib/fog/openstack/shared_file_system.rb - About 1 day to fix

    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",
    Severity: Major
    Found in lib/fog/openstack/dns/v2.rb - About 7 hrs to fix

      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
      Severity: Minor
      Found in lib/fog/openstack/compute/models/server.rb - About 6 hrs to fix

        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
        Severity: Major
        Found in lib/fog/openstack/network.rb - About 6 hrs to fix

          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
          Severity: Minor
          Found in unit/auth/token_test.rb - About 5 hrs to fix

            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,
            Severity: Minor
            Found in lib/fog/openstack/network.rb - About 5 hrs to fix

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                module OpenStack
                  class Volume
                    class V2 < Fog::OpenStack::Volume
                      class Mock
                        def self.data
              Severity: Major
              Found in lib/fog/openstack/volume/v2/mock.rb and 2 other locations - About 4 hrs to fix
              lib/fog/openstack/volume/v1/mock.rb on lines 2..62
              lib/fog/openstack/volume/v3/mock.rb on lines 2..62

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 163.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                module OpenStack
                  class Volume
                    class V3 < Fog::OpenStack::Volume
                      class Mock
                        def self.data
              Severity: Major
              Found in lib/fog/openstack/volume/v3/mock.rb and 2 other locations - About 4 hrs to fix
              lib/fog/openstack/volume/v1/mock.rb on lines 2..62
              lib/fog/openstack/volume/v2/mock.rb on lines 2..62

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 163.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 3 locations. Consider refactoring.
              Open

                module OpenStack
                  class Volume
                    class V1 < Fog::OpenStack::Volume
                      class Mock
                        def self.data
              Severity: Major
              Found in lib/fog/openstack/volume/v1/mock.rb and 2 other locations - About 4 hrs to fix
              lib/fog/openstack/volume/v2/mock.rb on lines 2..62
              lib/fog/openstack/volume/v3/mock.rb on lines 2..62

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 163.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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
              Severity: Minor
              Found in lib/fog/openstack/compute/requests/create_server.rb - About 4 hrs to fix

              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
              Severity: Major
              Found in lib/fog/openstack/baremetal.rb - About 4 hrs to fix

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                      class Mock
                        def self.data
                          @data ||= Hash.new do |hash, key|
                            hash[key] = {
                              :users   => {},
                Severity: Major
                Found in lib/fog/openstack/metric.rb and 3 other locations - About 4 hrs to fix
                lib/fog/openstack/container_infra.rb on lines 66..118
                lib/fog/openstack/event.rb on lines 28..80
                lib/fog/openstack/metering.rb on lines 40..92

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 149.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                      class Mock
                        def self.data
                          @data ||= Hash.new do |hash, key|
                            hash[key] = {
                              :users   => {},
                Severity: Major
                Found in lib/fog/openstack/metering.rb and 3 other locations - About 4 hrs to fix
                lib/fog/openstack/container_infra.rb on lines 66..118
                lib/fog/openstack/event.rb on lines 28..80
                lib/fog/openstack/metric.rb on lines 34..86

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 149.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                        class Mock
                          def self.data
                            @data ||= Hash.new do |hash, key|
                              hash[key] = {
                                :images => {}
                Severity: Major
                Found in lib/fog/openstack/image/v1.rb and 1 other location - About 4 hrs to fix
                lib/fog/openstack/image/v2.rb on lines 48..100

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 149.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                      class Mock
                        def self.data
                          @data ||= Hash.new do |hash, key|
                            hash[key] = {
                              :users   => {},
                Severity: Major
                Found in lib/fog/openstack/event.rb and 3 other locations - About 4 hrs to fix
                lib/fog/openstack/container_infra.rb on lines 66..118
                lib/fog/openstack/metering.rb on lines 40..92
                lib/fog/openstack/metric.rb on lines 34..86

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 149.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 4 locations. Consider refactoring.
                Open

                      class Mock
                        def self.data
                          @data ||= Hash.new do |hash, key|
                            hash[key] = {
                              :users   => {},
                Severity: Major
                Found in lib/fog/openstack/container_infra.rb and 3 other locations - About 4 hrs to fix
                lib/fog/openstack/event.rb on lines 28..80
                lib/fog/openstack/metering.rb on lines 40..92
                lib/fog/openstack/metric.rb on lines 34..86

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 149.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                        class Mock
                          def self.data
                            @data ||= Hash.new do |hash, key|
                              hash[key] = {
                                :images => {}
                Severity: Major
                Found in lib/fog/openstack/image/v2.rb and 1 other location - About 4 hrs to fix
                lib/fog/openstack/image/v1.rb on lines 42..94

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 149.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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
                Severity: Minor
                Found in lib/fog/openstack/shared_file_system.rb - About 4 hrs to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  module Fog
                    module OpenStack
                      class Volume
                        class V2 < Fog::OpenStack::Volume
                          SUPPORTED_VERSIONS = /v2(\.(0-9))*/
                  Severity: Major
                  Found in lib/fog/openstack/volume/v2.rb and 1 other location - About 3 hrs to fix
                  lib/fog/openstack/volume/v3.rb on lines 4..90

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 134.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  module Fog
                    module OpenStack
                      class Volume
                        class V3 < Fog::OpenStack::Volume
                          SUPPORTED_VERSIONS = /v3(\.(0-9))*/
                  Severity: Major
                  Found in lib/fog/openstack/volume/v3.rb and 1 other location - About 3 hrs to fix
                  lib/fog/openstack/volume/v2.rb on lines 4..90

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 134.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Severity
                  Category
                  Status
                  Source
                  Language