HewlettPackard/oneview-chef

View on GitHub

Showing 29 of 86 total issues

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

module OneviewCookbook
  module ImageStreamer
    # Module for Image Streamer API 600 Resources
    module API600
      # Get resource class that matches the type given
Severity: Major
Found in libraries/resource_providers/image_streamer/api600.rb and 9 other locations - About 1 hr to fix
libraries/resource_providers/image_streamer/api1000.rb on lines 14..30
libraries/resource_providers/image_streamer/api1020.rb on lines 14..30
libraries/resource_providers/image_streamer/api1600.rb on lines 14..30
libraries/resource_providers/image_streamer/api2000.rb on lines 14..30
libraries/resource_providers/image_streamer/api2010.rb on lines 14..30
libraries/resource_providers/image_streamer/api2020.rb on lines 14..30
libraries/resource_providers/image_streamer/api300.rb on lines 12..28
libraries/resource_providers/image_streamer/api500.rb on lines 14..30
libraries/resource_providers/image_streamer/api800.rb on lines 14..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 63.

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

module OneviewCookbook
  module ImageStreamer
    # Module for Image Streamer API 1020 Resources
    module API1020
      # Get resource class that matches the type given
Severity: Major
Found in libraries/resource_providers/image_streamer/api1020.rb and 9 other locations - About 1 hr to fix
libraries/resource_providers/image_streamer/api1000.rb on lines 14..30
libraries/resource_providers/image_streamer/api1600.rb on lines 14..30
libraries/resource_providers/image_streamer/api2000.rb on lines 14..30
libraries/resource_providers/image_streamer/api2010.rb on lines 14..30
libraries/resource_providers/image_streamer/api2020.rb on lines 14..30
libraries/resource_providers/image_streamer/api300.rb on lines 12..28
libraries/resource_providers/image_streamer/api500.rb on lines 14..30
libraries/resource_providers/image_streamer/api600.rb on lines 14..30
libraries/resource_providers/image_streamer/api800.rb on lines 14..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 63.

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

module OneviewCookbook
  module ImageStreamer
    # Module for Image Streamer API 2020 Resources
    module API2020
      # Get resource class that matches the type given
Severity: Major
Found in libraries/resource_providers/image_streamer/api2020.rb and 9 other locations - About 1 hr to fix
libraries/resource_providers/image_streamer/api1000.rb on lines 14..30
libraries/resource_providers/image_streamer/api1020.rb on lines 14..30
libraries/resource_providers/image_streamer/api1600.rb on lines 14..30
libraries/resource_providers/image_streamer/api2000.rb on lines 14..30
libraries/resource_providers/image_streamer/api2010.rb on lines 14..30
libraries/resource_providers/image_streamer/api300.rb on lines 12..28
libraries/resource_providers/image_streamer/api500.rb on lines 14..30
libraries/resource_providers/image_streamer/api600.rb on lines 14..30
libraries/resource_providers/image_streamer/api800.rb on lines 14..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 63.

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

module OneviewCookbook
  module ImageStreamer
    # Module for Image Streamer API 1600 Resources
    module API1600
      # Get resource class that matches the type given
Severity: Major
Found in libraries/resource_providers/image_streamer/api1600.rb and 9 other locations - About 1 hr to fix
libraries/resource_providers/image_streamer/api1000.rb on lines 14..30
libraries/resource_providers/image_streamer/api1020.rb on lines 14..30
libraries/resource_providers/image_streamer/api2000.rb on lines 14..30
libraries/resource_providers/image_streamer/api2010.rb on lines 14..30
libraries/resource_providers/image_streamer/api2020.rb on lines 14..30
libraries/resource_providers/image_streamer/api300.rb on lines 12..28
libraries/resource_providers/image_streamer/api500.rb on lines 14..30
libraries/resource_providers/image_streamer/api600.rb on lines 14..30
libraries/resource_providers/image_streamer/api800.rb on lines 14..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 63.

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

module OneviewCookbook
  module ImageStreamer
    # Module for Image Streamer API 300 Resources
    module API300
      # Get resource class that matches the type given
Severity: Major
Found in libraries/resource_providers/image_streamer/api300.rb and 9 other locations - About 1 hr to fix
libraries/resource_providers/image_streamer/api1000.rb on lines 14..30
libraries/resource_providers/image_streamer/api1020.rb on lines 14..30
libraries/resource_providers/image_streamer/api1600.rb on lines 14..30
libraries/resource_providers/image_streamer/api2000.rb on lines 14..30
libraries/resource_providers/image_streamer/api2010.rb on lines 14..30
libraries/resource_providers/image_streamer/api2020.rb on lines 14..30
libraries/resource_providers/image_streamer/api500.rb on lines 14..30
libraries/resource_providers/image_streamer/api600.rb on lines 14..30
libraries/resource_providers/image_streamer/api800.rb on lines 14..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 63.

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

module OneviewCookbook
  module ImageStreamer
    # Module for Image Streamer API 1000 Resources
    module API1000
      # Get resource class that matches the type given
Severity: Major
Found in libraries/resource_providers/image_streamer/api1000.rb and 9 other locations - About 1 hr to fix
libraries/resource_providers/image_streamer/api1020.rb on lines 14..30
libraries/resource_providers/image_streamer/api1600.rb on lines 14..30
libraries/resource_providers/image_streamer/api2000.rb on lines 14..30
libraries/resource_providers/image_streamer/api2010.rb on lines 14..30
libraries/resource_providers/image_streamer/api2020.rb on lines 14..30
libraries/resource_providers/image_streamer/api300.rb on lines 12..28
libraries/resource_providers/image_streamer/api500.rb on lines 14..30
libraries/resource_providers/image_streamer/api600.rb on lines 14..30
libraries/resource_providers/image_streamer/api800.rb on lines 14..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 63.

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

module OneviewCookbook
  module ImageStreamer
    # Module for Image Streamer API 800 Resources
    module API800
      # Get resource class that matches the type given
Severity: Major
Found in libraries/resource_providers/image_streamer/api800.rb and 9 other locations - About 1 hr to fix
libraries/resource_providers/image_streamer/api1000.rb on lines 14..30
libraries/resource_providers/image_streamer/api1020.rb on lines 14..30
libraries/resource_providers/image_streamer/api1600.rb on lines 14..30
libraries/resource_providers/image_streamer/api2000.rb on lines 14..30
libraries/resource_providers/image_streamer/api2010.rb on lines 14..30
libraries/resource_providers/image_streamer/api2020.rb on lines 14..30
libraries/resource_providers/image_streamer/api300.rb on lines 12..28
libraries/resource_providers/image_streamer/api500.rb on lines 14..30
libraries/resource_providers/image_streamer/api600.rb on lines 14..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 63.

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

module OneviewCookbook
  module ImageStreamer
    # Module for Image Streamer API 2010 Resources
    module API2010
      # Get resource class that matches the type given
Severity: Major
Found in libraries/resource_providers/image_streamer/api2010.rb and 9 other locations - About 1 hr to fix
libraries/resource_providers/image_streamer/api1000.rb on lines 14..30
libraries/resource_providers/image_streamer/api1020.rb on lines 14..30
libraries/resource_providers/image_streamer/api1600.rb on lines 14..30
libraries/resource_providers/image_streamer/api2000.rb on lines 14..30
libraries/resource_providers/image_streamer/api2020.rb on lines 14..30
libraries/resource_providers/image_streamer/api300.rb on lines 12..28
libraries/resource_providers/image_streamer/api500.rb on lines 14..30
libraries/resource_providers/image_streamer/api600.rb on lines 14..30
libraries/resource_providers/image_streamer/api800.rb on lines 14..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 63.

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

module OneviewCookbook
  module ImageStreamer
    # Module for Image Streamer API 2000 Resources
    module API2000
      # Get resource class that matches the type given
Severity: Major
Found in libraries/resource_providers/image_streamer/api2000.rb and 9 other locations - About 1 hr to fix
libraries/resource_providers/image_streamer/api1000.rb on lines 14..30
libraries/resource_providers/image_streamer/api1020.rb on lines 14..30
libraries/resource_providers/image_streamer/api1600.rb on lines 14..30
libraries/resource_providers/image_streamer/api2010.rb on lines 14..30
libraries/resource_providers/image_streamer/api2020.rb on lines 14..30
libraries/resource_providers/image_streamer/api300.rb on lines 12..28
libraries/resource_providers/image_streamer/api500.rb on lines 14..30
libraries/resource_providers/image_streamer/api600.rb on lines 14..30
libraries/resource_providers/image_streamer/api800.rb on lines 14..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 63.

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

module OneviewCookbook
  module ImageStreamer
    # Module for Image Streamer API 500 Resources
    module API500
      # Get resource class that matches the type given
Severity: Major
Found in libraries/resource_providers/image_streamer/api500.rb and 9 other locations - About 1 hr to fix
libraries/resource_providers/image_streamer/api1000.rb on lines 14..30
libraries/resource_providers/image_streamer/api1020.rb on lines 14..30
libraries/resource_providers/image_streamer/api1600.rb on lines 14..30
libraries/resource_providers/image_streamer/api2000.rb on lines 14..30
libraries/resource_providers/image_streamer/api2010.rb on lines 14..30
libraries/resource_providers/image_streamer/api2020.rb on lines 14..30
libraries/resource_providers/image_streamer/api300.rb on lines 12..28
libraries/resource_providers/image_streamer/api600.rb on lines 14..30
libraries/resource_providers/image_streamer/api800.rb on lines 14..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 63.

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

        def create_csr_request
          @item.retrieve! || raise("#{@resource_name} '#{@name}' not found!")
          @context.converge_by "Creating CSR request #{@new_resource.csr_data} for bay #{@new_resource.bay_number}" do
            @item.create_csr_request(@new_resource.csr_data, @new_resource.bay_number)
            csr_cert = @item.get_csr_request(@new_resource.bay_number)
libraries/resource_providers/api600/c7000/enclosure_provider.rb on lines 19..24

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

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

        def create_csr_request
          @item.retrieve! || raise("#{@resource_name} '#{@name}' not found!")
          @context.converge_by "Creating CSR request #{@new_resource.csr_data} for bay #{@new_resource.bay_number}" do
            @item.create_csr_request(@new_resource.csr_data, @new_resource.bay_number)
            csr_cert = @item.get_csr_request(@new_resource.bay_number)
libraries/resource_providers/api600/synergy/enclosure_provider.rb on lines 18..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

        def download_details_archive
          return unless download_validation
          Chef::Log.info("Downloading' #{@resource_type} '#{@name}' details to '#{@new_resource.file_path}'")
          @context.converge_by("Download' #{@resource_type} '#{@name}' details to '#{@new_resource.file_path}'") do
            @item.download_details_archive(@new_resource.file_path)
libraries/resource_providers/image_streamer/api300/golden_image_provider.rb on lines 53..57

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

        def download
          return unless download_validation
          Chef::Log.info("Downloading #{@resource_type} '#{@name}' to '#{@new_resource.file_path}'")
          @context.converge_by("Download #{@resource_type} '#{@name}' to '#{@new_resource.file_path}'") do
            @item.download(@new_resource.file_path)
libraries/resource_providers/image_streamer/api300/golden_image_provider.rb on lines 61..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 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

      def allocate_count
        Chef::Log.info "Allocating #{@new_resource.count} ID(s) #{@resource_name} '#{@name}'"
        @context.converge_by "#{@new_resource.count} ID(s) #{@resource_name} '#{@name}' were allocated." do
          @item.allocate_count(@new_resource.pool_type, @new_resource.count)
Severity: Minor
Found in libraries/resource_providers/api200/id_pool_provider.rb and 1 other location - About 35 mins to fix
libraries/resource_providers/api200/id_pool_provider.rb on lines 39..42

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

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

      def collect_ids
        Chef::Log.info "Removing the IDs #{@new_resource.id_list} #{@resource_name} '#{@name}'"
        @context.converge_by "The IDs #{@new_resource.id_list} #{@resource_name} '#{@name}'were removed." do
          @item.collect_ids(@new_resource.pool_type, @new_resource.id_list)
Severity: Minor
Found in libraries/resource_providers/api200/id_pool_provider.rb and 1 other location - About 35 mins to fix
libraries/resource_providers/api200/id_pool_provider.rb on lines 32..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 36.

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 API1800
    module C7000
      # EthernetNetworkProvider API1800 C7000 provider
      class EthernetNetworkProvider < API1600::C7000::EthernetNetworkProvider
        def delete_bulk
libraries/resource_providers/api1800/c7000/fcoe_network_provider.rb on lines 13..20

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

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

      def repair
        return false unless @item.retrieve!
        Chef::Log.info "Removing extra presentations from #{@resource_name} '#{@name}'"
        @context.converge_by "Removing extra presentations from #{@resource_name} '#{@name}'" do
          @item.repair
Severity: Minor
Found in libraries/resource_providers/api200/volume_provider.rb and 1 other location - About 25 mins to fix
libraries/resource_providers/api200/volume_attachment_provider.rb on lines 16..22

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

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

      def repair
        return false unless @item.retrieve!
        Chef::Log.info "Removing extra presentations from #{@resource_name} '#{@name}'"
        @context.converge_by "Removing extra presentations from #{@resource_name} '#{@name}'" do
          @item.repair
libraries/resource_providers/api200/volume_provider.rb on lines 77..83

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

  module API1800
    module C7000
      # FCoENetwork API1800 C7000 provider
      class FCoENetworkProvider < API1600::C7000::FCoENetworkProvider
        def delete_bulk
libraries/resource_providers/api1800/c7000/ethernet_network_provider.rb on lines 13..20

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