fog/fog-profitbricks

View on GitHub

Showing 99 of 140 total issues

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

                  {
                    'id'        => dc1_id,
                    'type'      => 'datacenter',
                    'href'      => "https://api.profitbricks.com/rest/v2/datacenters/#{dc1_id}",
                    'metadata'  => {
Severity: Minor
Found in lib/fog/profitbricks/compute.rb and 1 other location - About 40 mins to fix
lib/fog/profitbricks/compute.rb on lines 267..284

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

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 reboot_server(datacenter_id, server_id)
          if server = data[:servers]['items'].find do |attrib|
            attrib['datacenter_id'] == datacenter_id && attrib['id'] == server_id
          end
Severity: Minor
Found in lib/fog/profitbricks/requests/compute/reboot_server.rb and 1 other location - About 40 mins to fix
lib/fog/profitbricks/requests/compute/remove_nic_association.rb on lines 26..37

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

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

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

                            'properties' => {
                              'name'                => 'Docker Registry Volume',
                              'type'                => 'HDD',
                              'size'                => 50,
                              'bus'                 => 'VIRTIO',
Severity: Minor
Found in lib/fog/profitbricks/compute.rb and 1 other location - About 30 mins to fix
lib/fog/profitbricks/compute.rb on lines 674..690

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

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 ProfitBricks
      class Real
        # Retrieves the status of the request
        #
Severity: Minor
Found in lib/fog/profitbricks/requests/compute/get_request_status.rb and 1 other location - About 30 mins to fix
lib/fog/profitbricks/requests/compute/get_all_shares.rb on lines 2..41

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

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 ProfitBricks
      class Real
        # Retrieve a full list of all the resources that are shared through this group
        # and lists the permissions granted to the group members for each shared resource.
Severity: Minor
Found in lib/fog/profitbricks/requests/compute/get_all_shares.rb and 1 other location - About 30 mins to fix
lib/fog/profitbricks/requests/compute/get_request_status.rb on lines 2..43

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

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

                  {
                    'id'              => 'dfcb40db-28b5-11e6-9336-52540005ab80',
                    'type'            => 'image',
                    'href'            => 'https://api.profitbricks.com/cloudapi/v4/um/resources/image/dfcb40db-28b5-11e6-9336-52540005ab80',
                    'metadata'        => {
Severity: Minor
Found in lib/fog/profitbricks/compute.rb and 1 other location - About 30 mins to fix
lib/fog/profitbricks/compute.rb on lines 1218..1235

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

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

                  {
                    'id'          => '3d52b13d-bec4-49de-ad05-fd2f8c687be6',
                    'type'        => 'snapshot',
                    'href'        => 'https://api.profitbricks.com/cloudapi/v4/um/resources/snapshot/3d52b13d-bec4-49de-ad05-fd2f8c687be6',
                    'metadata'    => {
Severity: Minor
Found in lib/fog/profitbricks/compute.rb and 1 other location - About 30 mins to fix
lib/fog/profitbricks/compute.rb on lines 1197..1214

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

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

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

                    'properties' => {
                      'name'                => 'Docker Registry Volume',
                      'type'                => 'HDD',
                      'size'                => 50,
                      'bus'                 => 'VIRTIO',
Severity: Minor
Found in lib/fog/profitbricks/compute.rb and 1 other location - About 30 mins to fix
lib/fog/profitbricks/compute.rb on lines 404..420

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

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

            'entities' => {
              'users' => {
                'id' => "#{group_id}/owns",
                'type' => 'collection',
                'href' => "https://api.profitbricks.com/cloudapi/v4/um/groups/#{group_id}/users",
Severity: Minor
Found in lib/fog/profitbricks/requests/compute/create_group.rb and 1 other location - About 30 mins to fix
lib/fog/profitbricks/requests/compute/create_user.rb on lines 78..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 33.

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

            'entities' => {
              'owns' => {
                'id' => "#{user_id}/owns",
                'type' => 'collection',
                'href' => "https://api.profitbricks.com/cloudapi/v4/um/users/#{user_id}/owns",
Severity: Minor
Found in lib/fog/profitbricks/requests/compute/create_user.rb and 1 other location - About 30 mins to fix
lib/fog/profitbricks/requests/compute/create_group.rb on lines 79..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 33.

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 ProfitBricks
      class Real
        # Retrieves a list of requests
        #
Severity: Minor
Found in lib/fog/profitbricks/requests/compute/get_all_requests.rb and 1 other location - About 30 mins to fix
lib/fog/profitbricks/requests/compute/get_all_ip_blocks.rb on lines 2..51

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

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 ProfitBricks
      class Real
        # Retrieve a list of IP Blocks
        #
Severity: Minor
Found in lib/fog/profitbricks/requests/compute/get_all_ip_blocks.rb and 1 other location - About 30 mins to fix
lib/fog/profitbricks/requests/compute/get_all_requests.rb on lines 2..38

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

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

          if nic = data[:nics]["items"].find do |attribute|
            attribute["datacenter_id"] == datacenter_id && attribute["server_id"] == server_id && attribute["id"] == nic_id
          end
          else
            raise Fog::Errors::NotFound, "The requested nic resource could not be found"
Severity: Minor
Found in lib/fog/profitbricks/requests/compute/delete_nic.rb and 1 other location - About 30 mins to fix
lib/fog/profitbricks/requests/compute/get_all_firewall_rules.rb on lines 58..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 32.

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

          if nics = data[:firewall_rules]['items'].select do |attrib|
            attrib['datacenter_id'] == datacenter_id && attrib['server_id'] == server_id && attrib['nic_id'] == nic_id
          end
          else
            raise Fog::Errors::NotFound, 'The resource could not be found'
Severity: Minor
Found in lib/fog/profitbricks/requests/compute/get_all_firewall_rules.rb and 1 other location - About 30 mins to fix
lib/fog/profitbricks/requests/compute/delete_nic.rb on lines 31..35

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

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

  module Compute
    class ProfitBricks
      class Real
        # Get all virtual data centers
        #
Severity: Major
Found in lib/fog/profitbricks/requests/compute/get_all_datacenters.rb and 6 other locations - About 25 mins to fix
lib/fog/profitbricks/requests/compute/get_all_contract_resources.rb on lines 2..50
lib/fog/profitbricks/requests/compute/get_all_groups.rb on lines 2..57
lib/fog/profitbricks/requests/compute/get_all_images.rb on lines 2..61
lib/fog/profitbricks/requests/compute/get_all_resources.rb on lines 2..61
lib/fog/profitbricks/requests/compute/get_all_snapshots.rb on lines 2..61
lib/fog/profitbricks/requests/compute/get_all_users.rb on lines 2..65

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

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

  module Compute
    class ProfitBricks
      class Real
        # Retrieve a list of all snapshots
        #
Severity: Major
Found in lib/fog/profitbricks/requests/compute/get_all_snapshots.rb and 6 other locations - About 25 mins to fix
lib/fog/profitbricks/requests/compute/get_all_contract_resources.rb on lines 2..50
lib/fog/profitbricks/requests/compute/get_all_datacenters.rb on lines 2..54
lib/fog/profitbricks/requests/compute/get_all_groups.rb on lines 2..57
lib/fog/profitbricks/requests/compute/get_all_images.rb on lines 2..61
lib/fog/profitbricks/requests/compute/get_all_resources.rb on lines 2..61
lib/fog/profitbricks/requests/compute/get_all_users.rb on lines 2..65

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

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

  module Compute
    class ProfitBricks
      class Real
        # Retrieves a list of all resources and optionally their group associations.
        # Please note that this API call can take a significant amount of time to return when
Severity: Major
Found in lib/fog/profitbricks/requests/compute/get_all_resources.rb and 6 other locations - About 25 mins to fix
lib/fog/profitbricks/requests/compute/get_all_contract_resources.rb on lines 2..50
lib/fog/profitbricks/requests/compute/get_all_datacenters.rb on lines 2..54
lib/fog/profitbricks/requests/compute/get_all_groups.rb on lines 2..57
lib/fog/profitbricks/requests/compute/get_all_images.rb on lines 2..61
lib/fog/profitbricks/requests/compute/get_all_snapshots.rb on lines 2..61
lib/fog/profitbricks/requests/compute/get_all_users.rb on lines 2..65

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

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

      class Real
        # Creates a load balancer within the data center. Load balancers can be used for public or private IP traffic
        #
        # ==== Parameters
        # * datacenter_id<~String> - Required, UUID of the virtual data center
Severity: Minor
Found in lib/fog/profitbricks/requests/compute/create_load_balancer.rb and 2 other locations - About 25 mins to fix
lib/fog/profitbricks/requests/compute/create_lan.rb on lines 4..107
lib/fog/profitbricks/requests/compute/create_server.rb on lines 4..130

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

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

  module Compute
    class ProfitBricks
      class Real
        # Displays a list of all available images.
        #
Severity: Major
Found in lib/fog/profitbricks/requests/compute/get_all_images.rb and 6 other locations - About 25 mins to fix
lib/fog/profitbricks/requests/compute/get_all_contract_resources.rb on lines 2..50
lib/fog/profitbricks/requests/compute/get_all_datacenters.rb on lines 2..54
lib/fog/profitbricks/requests/compute/get_all_groups.rb on lines 2..57
lib/fog/profitbricks/requests/compute/get_all_resources.rb on lines 2..61
lib/fog/profitbricks/requests/compute/get_all_snapshots.rb on lines 2..61
lib/fog/profitbricks/requests/compute/get_all_users.rb on lines 2..65

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

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

  module Compute
    class ProfitBricks
      class Real
        # Get all contract resources
        #
lib/fog/profitbricks/requests/compute/get_all_datacenters.rb on lines 2..54
lib/fog/profitbricks/requests/compute/get_all_groups.rb on lines 2..57
lib/fog/profitbricks/requests/compute/get_all_images.rb on lines 2..61
lib/fog/profitbricks/requests/compute/get_all_resources.rb on lines 2..61
lib/fog/profitbricks/requests/compute/get_all_snapshots.rb on lines 2..61
lib/fog/profitbricks/requests/compute/get_all_users.rb on lines 2..65

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

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