fog/fog-openstack

View on GitHub
lib/fog/openstack/shared_file_system.rb

Summary

Maintainability
D
1 day
Test Coverage

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

    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

                      {
                        "name"              => "net_my1",
                        "segmentation_id"   => '',
                        "created_at"        => "2015-09-04T14:57:13.000000",
                        "neutron_subnet_id" => "53482b62-2c84-4a53-b6ab-30d9d9800d06",
      Severity: Minor
      Found in lib/fog/openstack/shared_file_system.rb and 1 other location - About 20 mins to fix
      lib/fog/openstack/shared_file_system.rb on lines 204..217

      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 28.

      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

                      {
                        "status"      => "new",
                        "domain"      => "",
                        "project_id"  => "16e1ab15c35a457e9c2b2aa189f544e1",
                        "name"        => "SecServ1",
      Severity: Minor
      Found in lib/fog/openstack/shared_file_system.rb and 1 other location - About 20 mins to fix
      lib/fog/openstack/shared_file_system.rb on lines 171..184

      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 28.

      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

            recognizes :openstack_auth_token, :openstack_management_url,
                       :persistent, :openstack_service_type, :openstack_service_name,
                       :openstack_tenant, :openstack_tenant_id,
                       :openstack_api_key, :openstack_username, :openstack_identity_endpoint,
                       :current_user, :current_tenant, :openstack_region,
      Severity: Minor
      Found in lib/fog/openstack/shared_file_system.rb and 1 other location - About 15 mins to fix
      lib/fog/openstack/identity/v2.rb on lines 8..19

      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 26.

      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

      There are no issues that match your filters.

      Category
      Status