fog/fog-openstack

View on GitHub

Showing 460 of 616 total issues

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

  module OpenStack
    class Network
      class Real
        def delete_lbaas_listener(listener_id)
          request(
lib/fog/openstack/compute/requests/delete_volume.rb on lines 2..23
lib/fog/openstack/network/requests/delete_floating_ip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ike_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ipsec_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_health_monitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_member.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_vip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_healthmonitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_l7policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_loadbalancer.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_network.rb on lines 2..23
lib/fog/openstack/network/requests/delete_port.rb on lines 2..23
lib/fog/openstack/network/requests/delete_rbac_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_subnet.rb on lines 2..23
lib/fog/openstack/network/requests/delete_subnet_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_vpn_service.rb on lines 2..23

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

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

  module OpenStack
    class Network
      class Real
        def delete_lb_member(member_id)
          request(
Severity: Major
Found in lib/fog/openstack/network/requests/delete_lb_member.rb and 18 other locations - About 1 hr to fix
lib/fog/openstack/compute/requests/delete_volume.rb on lines 2..23
lib/fog/openstack/network/requests/delete_floating_ip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ike_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ipsec_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_health_monitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_vip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_healthmonitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_l7policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_listener.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_loadbalancer.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_network.rb on lines 2..23
lib/fog/openstack/network/requests/delete_port.rb on lines 2..23
lib/fog/openstack/network/requests/delete_rbac_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_subnet.rb on lines 2..23
lib/fog/openstack/network/requests/delete_subnet_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_vpn_service.rb on lines 2..23

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

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

  module OpenStack
    class Network
      class Real
        def delete_port(port_id)
          request(
Severity: Major
Found in lib/fog/openstack/network/requests/delete_port.rb and 18 other locations - About 1 hr to fix
lib/fog/openstack/compute/requests/delete_volume.rb on lines 2..23
lib/fog/openstack/network/requests/delete_floating_ip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ike_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ipsec_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_health_monitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_member.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_vip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_healthmonitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_l7policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_listener.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_loadbalancer.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_network.rb on lines 2..23
lib/fog/openstack/network/requests/delete_rbac_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_subnet.rb on lines 2..23
lib/fog/openstack/network/requests/delete_subnet_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_vpn_service.rb on lines 2..23

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

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

  module OpenStack
    class Network
      class Real
        def delete_subnet(subnet_id)
          request(
Severity: Major
Found in lib/fog/openstack/network/requests/delete_subnet.rb and 18 other locations - About 1 hr to fix
lib/fog/openstack/compute/requests/delete_volume.rb on lines 2..23
lib/fog/openstack/network/requests/delete_floating_ip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ike_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ipsec_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_health_monitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_member.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_vip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_healthmonitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_l7policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_listener.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_loadbalancer.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_network.rb on lines 2..23
lib/fog/openstack/network/requests/delete_port.rb on lines 2..23
lib/fog/openstack/network/requests/delete_rbac_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_subnet_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_vpn_service.rb on lines 2..23

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

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

  module OpenStack
    class Network
      class Real
        def delete_lbaas_loadbalancer(loadbalancer_id)
          request(
lib/fog/openstack/compute/requests/delete_volume.rb on lines 2..23
lib/fog/openstack/network/requests/delete_floating_ip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ike_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ipsec_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_health_monitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_member.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_vip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_healthmonitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_l7policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_listener.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_network.rb on lines 2..23
lib/fog/openstack/network/requests/delete_port.rb on lines 2..23
lib/fog/openstack/network/requests/delete_rbac_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_subnet.rb on lines 2..23
lib/fog/openstack/network/requests/delete_subnet_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_vpn_service.rb on lines 2..23

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

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

  module OpenStack
    class Network
      class Real
        def delete_network(network_id)
          request(
Severity: Major
Found in lib/fog/openstack/network/requests/delete_network.rb and 18 other locations - About 1 hr to fix
lib/fog/openstack/compute/requests/delete_volume.rb on lines 2..23
lib/fog/openstack/network/requests/delete_floating_ip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ike_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ipsec_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_health_monitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_member.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_vip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_healthmonitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_l7policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_listener.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_loadbalancer.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_port.rb on lines 2..23
lib/fog/openstack/network/requests/delete_rbac_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_subnet.rb on lines 2..23
lib/fog/openstack/network/requests/delete_subnet_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_vpn_service.rb on lines 2..23

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

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

  module OpenStack
    class Network
      class Real
        def delete_lb_pool(pool_id)
          request(
Severity: Major
Found in lib/fog/openstack/network/requests/delete_lb_pool.rb and 18 other locations - About 1 hr to fix
lib/fog/openstack/compute/requests/delete_volume.rb on lines 2..23
lib/fog/openstack/network/requests/delete_floating_ip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ike_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_ipsec_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_health_monitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_member.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lb_vip.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_healthmonitor.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_l7policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_listener.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_loadbalancer.rb on lines 2..23
lib/fog/openstack/network/requests/delete_lbaas_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_network.rb on lines 2..23
lib/fog/openstack/network/requests/delete_port.rb on lines 2..23
lib/fog/openstack/network/requests/delete_rbac_policy.rb on lines 2..23
lib/fog/openstack/network/requests/delete_subnet.rb on lines 2..23
lib/fog/openstack/network/requests/delete_subnet_pool.rb on lines 2..23
lib/fog/openstack/network/requests/delete_vpn_service.rb on lines 2..23

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

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 Baremetal
      class Real
        # Patch a node
        #
Severity: Major
Found in lib/fog/openstack/baremetal/requests/patch_node.rb and 2 other locations - About 1 hr to fix
lib/fog/openstack/baremetal/requests/patch_chassis.rb on lines 2..36
lib/fog/openstack/baremetal/requests/patch_port.rb on lines 2..36

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

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 Baremetal
      class Real
        # Patch a port
        #
Severity: Major
Found in lib/fog/openstack/baremetal/requests/patch_port.rb and 2 other locations - About 1 hr to fix
lib/fog/openstack/baremetal/requests/patch_chassis.rb on lines 2..36
lib/fog/openstack/baremetal/requests/patch_node.rb on lines 2..36

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

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 Baremetal
      class Real
        # Patch a chassis
        #
Severity: Major
Found in lib/fog/openstack/baremetal/requests/patch_chassis.rb and 2 other locations - About 1 hr to fix
lib/fog/openstack/baremetal/requests/patch_node.rb on lines 2..36
lib/fog/openstack/baremetal/requests/patch_port.rb on lines 2..36

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

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 list_images(_options = {})
            response = Excon::Response.new
            response.status = [200, 204][rand(2)]
            response.body = {
Severity: Major
Found in lib/fog/openstack/image/v2/requests/list_images.rb and 1 other location - About 1 hr to fix
lib/fog/openstack/image/v1/requests/list_public_images.rb on lines 16..30

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

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 OpenStack
    class Compute
      class Real
        def remove_aggregate_host(uuid, host_uuid)
          data = {'remove_host' => {'host' => host_uuid}}
Severity: Major
Found in lib/fog/openstack/compute/requests/remove_aggregate_host.rb and 1 other location - About 1 hr to fix
lib/fog/openstack/compute/requests/add_aggregate_host.rb on lines 2..25

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

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 OpenStack
    class Network
      class Real
        def get_lbaas_l7rule(l7policy_id, l7rule_id)
          request(
Severity: Major
Found in lib/fog/openstack/network/requests/get_lbaas_l7rule.rb and 1 other location - About 1 hr to fix
lib/fog/openstack/network/requests/get_lbaas_pool_member.rb on lines 2..23

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

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 OpenStack
    class Workflow
      class V2
        class Real
          def create_environment(definition)
lib/fog/openstack/workflow/v2/requests/update_environment.rb on lines 2..25

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

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 list_public_images(_options = {})
            response = Excon::Response.new
            response.status = [200, 204][rand(2)]
            response.body = {
Severity: Major
Found in lib/fog/openstack/image/v1/requests/list_public_images.rb and 1 other location - About 1 hr to fix
lib/fog/openstack/image/v2/requests/list_images.rb on lines 16..30

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

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 OpenStack
    class Network
      class Real
        def get_lbaas_pool_member(pool_id, member_id)
          request(
Severity: Major
Found in lib/fog/openstack/network/requests/get_lbaas_pool_member.rb and 1 other location - About 1 hr to fix
lib/fog/openstack/network/requests/get_lbaas_l7rule.rb on lines 2..23

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

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 OpenStack
    class Workflow
      class V2
        class Real
          def update_environment(definition)
lib/fog/openstack/workflow/v2/requests/create_environment.rb on lines 2..25

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

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 OpenStack
    class Compute
      class Real
        def add_aggregate_host(uuid, host_uuid)
          data = {'add_host' => {'host' => host_uuid}}
Severity: Major
Found in lib/fog/openstack/compute/requests/add_aggregate_host.rb and 1 other location - About 1 hr to fix
lib/fog/openstack/compute/requests/remove_aggregate_host.rb on lines 2..25

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

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 NFV
      class Vnfs < Fog::OpenStack::Collection
        model Fog::OpenStack::NFV::Vnf
Severity: Major
Found in lib/fog/openstack/nfv/models/vnfs.rb and 1 other location - About 1 hr to fix
lib/fog/openstack/nfv/models/vnfds.rb on lines 4..23

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

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 OpenStack
    class Baremetal
      class Real
        def unset_node_maintenance(node_uuid, parameters = nil)
          request(
lib/fog/openstack/baremetal/requests/set_node_maintenance.rb on lines 2..25

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

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