Showing 459 of 459 total issues

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

  module Compute
    class VcloudDirector
      class Real
        # Retrieves a list of vdcs in the organization.
        #
lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89

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

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 9 locations. Consider refactoring.
Open

  module Compute
    class VcloudDirector
      class Real
        # Retrieves a list of users for organization the org admin belongs to
        # by using REST API general QueryHandler.
lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

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

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 9 locations. Consider refactoring.
Open

  module Compute
    class VcloudDirector
      class Real
        # Retrieves a list of groups for organization the org admin belongs to
        # by using REST API general QueryHandler.
lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

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

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 9 locations. Consider refactoring.
Open

  module Compute
    class VcloudDirector
      class Real
        # Retrieves a list of vAppTemplates using REST API general
        # QueryHandler.
lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

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

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 9 locations. Consider refactoring.
Open

  module Compute
    class VcloudDirector
      class Real
        # Retrieves a list of vApps by using REST API general QueryHandler.
        #
lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

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

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 9 locations. Consider refactoring.
Open

  module Compute
    class VcloudDirector
      class Real
        # Retrieves a media list by using REST API general QueryHandler.
        #
lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_disks_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

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

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 9 locations. Consider refactoring.
Open

  module Compute
    class VcloudDirector
      class Real
        # Retrieves a disk list by using REST API general QueryHandler.
        #
lib/fog/vcloud_director/requests/compute/get_catalogs_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_groups_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_medias_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_organizations_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_users_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_vapp_templates_from_query.rb on lines 2..90
lib/fog/vcloud_director/requests/compute/get_vapps_in_lease_from_query.rb on lines 2..89
lib/fog/vcloud_director/requests/compute/get_vdcs_from_query.rb on lines 2..89

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

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 list_vms has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

        def list_vms(filter={})
          vms=[]
          vmpool = ::OpenNebula::VirtualMachinePool.new(client)
          if filter[:id].nil?
            vmpool.info!(-2,-1,-1,-1)
Severity: Minor
Found in lib/fog/opennebula/requests/compute/list_vms.rb - About 5 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

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

  module Compute
    class VcloudDirector
      class Real
        require 'fog/vcloud_director/parsers/compute/vm'

Severity: Major
Found in lib/fog/vcloud_director/requests/compute/get_template_vm.rb and 1 other location - About 5 hrs to fix
lib/fog/vcloud_director/requests/compute/get_vm.rb on lines 2..68

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

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 Compute
    class VcloudDirector
      class Real
        require 'fog/vcloud_director/parsers/compute/vm'

Severity: Major
Found in lib/fog/vcloud_director/requests/compute/get_vm.rb and 1 other location - About 5 hrs to fix
lib/fog/vcloud_director/requests/compute/get_template_vm.rb on lines 2..68

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

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

Class Server has 38 methods (exceeds 20 allowed). Consider refactoring.
Open

      class Server < Fog::Vcloud::Model
        include Fog::Vcloud::Compute::Helpers::Status

        identity :href, :aliases => :Href
        attribute :links, :aliases => :Link, :type => :array
Severity: Minor
Found in lib/fog/vcloud/models/compute/server.rb - About 5 hrs to fix

    Method get_vdc has 124 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            def get_vdc(vdc_id)
              response = Excon::Response.new
    
              unless vdc = data[:vdcs][vdc_id]
                raise Fog::Compute::VcloudDirector::Forbidden.new(
    Severity: Major
    Found in lib/fog/vcloud_director/requests/compute/get_vdc.rb - About 4 hrs to fix

      Method put_network_connection_system_section_vapp has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

              def put_network_connection_system_section_vapp(id, options={})
                options = options.dup
      
                # Mutate options to new format.
                deprecated = {

      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 save has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
      Open

              def save
                unless persisted?
                  #Lame ...
                  raise RuntimeError, "Should not be here"
                else
      Severity: Minor
      Found in lib/fog/vcloud/models/compute/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

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

        module Compute
          class VcloudDirector
            class Real
              extend Fog::Deprecation
              deprecate :put_vm_memory, :put_memory
      Severity: Major
      Found in lib/fog/vcloud_director/requests/compute/put_memory.rb and 1 other location - About 4 hrs to fix
      lib/fog/vcloud_director/requests/compute/put_cpu.rb on lines 2..82

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

      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 Compute
          class VcloudDirector
            class Real
              extend Fog::Deprecation
              deprecate :put_vm_cpu, :put_cpu
      Severity: Major
      Found in lib/fog/vcloud_director/requests/compute/put_cpu.rb and 1 other location - About 4 hrs to fix
      lib/fog/vcloud_director/requests/compute/put_memory.rb on lines 2..82

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

      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 DNS
          class Rage4
            class Real
              # Create a record
              # ==== Parameters
      Severity: Major
      Found in lib/fog/rage4/requests/dns/create_record.rb and 1 other location - About 3 hrs to fix
      lib/fog/rage4/requests/dns/update_record.rb on lines 2..54

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

      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 DNS
          class Rage4
            class Real
              # Updates an existing record
              # ==== Parameters
      Severity: Major
      Found in lib/fog/rage4/requests/dns/update_record.rb and 1 other location - About 3 hrs to fix
      lib/fog/rage4/requests/dns/create_record.rb on lines 2..54

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

      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 compute.rb has 311 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'fog/vcloud/core'
      
      module Fog
        module Vcloud
          class Collection < Fog::Collection
      Severity: Minor
      Found in lib/fog/vcloud/compute.rb - About 3 hrs to fix

        Method list_networks has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

                def list_networks(filter = { })
                  networks=[]
                  netpool = ::OpenNebula::VirtualNetworkPool.new(client)
                  if filter[:id].nil?
                    netpool.info!(-2,-1,-1)
        Severity: Minor
        Found in lib/fog/opennebula/requests/compute/list_networks.rb - About 3 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

        Severity
        Category
        Status
        Source
        Language