crowbar/crowbar-client

View on GitHub

Showing 143 of 143 total issues

Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

          argv,
          stdin = STDIN,
          stdout = STDOUT,
          stderr = STDERR,
          kernel = Kernel
Severity: Minor
Found in lib/crowbar/client/util/runner.rb - About 35 mins to fix

Method execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def execute
            request.process do |request|
              case request.code
              when 200
                formatter = Formatter::Nested.new(
Severity: Minor
Found in lib/crowbar/client/command/restricted/show.rb - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def execute
            validate_params!(args_with_options)

            request.process do |request|
              unless request.code == 200
Severity: Minor
Found in lib/crowbar/client/command/upgrade/database.rb - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method disable_restart has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        def disable_restart(cookbook, value)
          unless ["true", "false"].include? value.downcase
            msg = "#{value} is not a valid value for this command. Please use true or false"
            raise SimpleCatchableError(msg)
          end
Severity: Minor
Found in lib/crowbar/client/app/services.rb - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method content_from has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def content_from(request)
            [].tap do |row|
              request.parsed_response["checks"].each do |check_id, values|
                # make the check_id server agnostic
                # the check_id could be named differently in the server response
Severity: Minor
Found in lib/crowbar/client/command/upgrade/prechecks.rb - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Method execute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

          def execute
            request.process do |request|
              case request.code
              when 200
                formatter = Formatter::Nested.new(
Severity: Minor
Found in lib/crowbar/client/command/node/show.rb - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

  module Client
    module Command
      module Repository
        #
        # Implementation for the repository deactivate all command
Severity: Major
Found in lib/crowbar/client/command/repository/deactivate_all.rb and 7 other locations - About 35 mins to fix
lib/crowbar/client/command/backup/create.rb on lines 18..37
lib/crowbar/client/command/backup/restore.rb on lines 18..37
lib/crowbar/client/command/host_ip/deallocate.rb on lines 18..37
lib/crowbar/client/command/interface/disable.rb on lines 18..37
lib/crowbar/client/command/repository/activate_all.rb on lines 18..37
lib/crowbar/client/command/restricted/ping.rb on lines 18..37
lib/crowbar/client/command/virtual_ip/deallocate.rb on lines 18..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 34.

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

            json = begin
              file = File.read(
                options[:file]
              )

Severity: Minor
Found in lib/crowbar/client/command/proposal/create.rb and 1 other location - About 35 mins to fix
lib/crowbar/client/command/proposal/edit.rb on lines 96..111

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

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

  module Client
    module Command
      module Interface
        #
        # Implementation for the interface disable command
Severity: Major
Found in lib/crowbar/client/command/interface/disable.rb and 7 other locations - About 35 mins to fix
lib/crowbar/client/command/backup/create.rb on lines 18..37
lib/crowbar/client/command/backup/restore.rb on lines 18..37
lib/crowbar/client/command/host_ip/deallocate.rb on lines 18..37
lib/crowbar/client/command/repository/activate_all.rb on lines 18..37
lib/crowbar/client/command/repository/deactivate_all.rb on lines 18..37
lib/crowbar/client/command/restricted/ping.rb on lines 18..37
lib/crowbar/client/command/virtual_ip/deallocate.rb on lines 18..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 34.

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

            json = begin
              file = File.read(
                options[:file]
              )

Severity: Minor
Found in lib/crowbar/client/command/proposal/edit.rb and 1 other location - About 35 mins to fix
lib/crowbar/client/command/proposal/create.rb on lines 94..109

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

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

  module Client
    module Command
      module Backup
        #
        # Implementation for the backup restore command
Severity: Major
Found in lib/crowbar/client/command/backup/restore.rb and 7 other locations - About 35 mins to fix
lib/crowbar/client/command/backup/create.rb on lines 18..37
lib/crowbar/client/command/host_ip/deallocate.rb on lines 18..37
lib/crowbar/client/command/interface/disable.rb on lines 18..37
lib/crowbar/client/command/repository/activate_all.rb on lines 18..37
lib/crowbar/client/command/repository/deactivate_all.rb on lines 18..37
lib/crowbar/client/command/restricted/ping.rb on lines 18..37
lib/crowbar/client/command/virtual_ip/deallocate.rb on lines 18..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 34.

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

  module Client
    module Command
      module Restricted
        #
        # Implementation for the restricted ping command
Severity: Major
Found in lib/crowbar/client/command/restricted/ping.rb and 7 other locations - About 35 mins to fix
lib/crowbar/client/command/backup/create.rb on lines 18..37
lib/crowbar/client/command/backup/restore.rb on lines 18..37
lib/crowbar/client/command/host_ip/deallocate.rb on lines 18..37
lib/crowbar/client/command/interface/disable.rb on lines 18..37
lib/crowbar/client/command/repository/activate_all.rb on lines 18..37
lib/crowbar/client/command/repository/deactivate_all.rb on lines 18..37
lib/crowbar/client/command/virtual_ip/deallocate.rb on lines 18..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 34.

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

  module Client
    module Command
      module Backup
        #
        # Implementation for the backup create command
Severity: Major
Found in lib/crowbar/client/command/backup/create.rb and 7 other locations - About 35 mins to fix
lib/crowbar/client/command/backup/restore.rb on lines 18..37
lib/crowbar/client/command/host_ip/deallocate.rb on lines 18..37
lib/crowbar/client/command/interface/disable.rb on lines 18..37
lib/crowbar/client/command/repository/activate_all.rb on lines 18..37
lib/crowbar/client/command/repository/deactivate_all.rb on lines 18..37
lib/crowbar/client/command/restricted/ping.rb on lines 18..37
lib/crowbar/client/command/virtual_ip/deallocate.rb on lines 18..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 34.

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

  module Client
    module Command
      module Repository
        #
        # Implementation for the repository activate all command
Severity: Major
Found in lib/crowbar/client/command/repository/activate_all.rb and 7 other locations - About 35 mins to fix
lib/crowbar/client/command/backup/create.rb on lines 18..37
lib/crowbar/client/command/backup/restore.rb on lines 18..37
lib/crowbar/client/command/host_ip/deallocate.rb on lines 18..37
lib/crowbar/client/command/interface/disable.rb on lines 18..37
lib/crowbar/client/command/repository/deactivate_all.rb on lines 18..37
lib/crowbar/client/command/restricted/ping.rb on lines 18..37
lib/crowbar/client/command/virtual_ip/deallocate.rb on lines 18..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 34.

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 Client
    module Command
      module Services
        #
        # Implementation for the List Restarts command
Severity: Minor
Found in lib/crowbar/client/command/services/clear_restart.rb and 1 other location - About 35 mins to fix
lib/crowbar/client/command/services/disable_restart.rb on lines 18..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 34.

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

  module Client
    module Command
      module VirtualIP
        #
        # Implementation for the virtual IP deallocate command
Severity: Major
Found in lib/crowbar/client/command/virtual_ip/deallocate.rb and 7 other locations - About 35 mins to fix
lib/crowbar/client/command/backup/create.rb on lines 18..37
lib/crowbar/client/command/backup/restore.rb on lines 18..37
lib/crowbar/client/command/host_ip/deallocate.rb on lines 18..37
lib/crowbar/client/command/interface/disable.rb on lines 18..37
lib/crowbar/client/command/repository/activate_all.rb on lines 18..37
lib/crowbar/client/command/repository/deactivate_all.rb on lines 18..37
lib/crowbar/client/command/restricted/ping.rb on lines 18..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 34.

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 Client
    module Command
      module Services
        #
        # Implementation for the List Restarts command
Severity: Minor
Found in lib/crowbar/client/command/services/disable_restart.rb and 1 other location - About 35 mins to fix
lib/crowbar/client/command/services/clear_restart.rb on lines 18..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 34.

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

  module Client
    module Command
      module HostIP
        #
        # Implementation for the host IP deallocate command
Severity: Major
Found in lib/crowbar/client/command/host_ip/deallocate.rb and 7 other locations - About 35 mins to fix
lib/crowbar/client/command/backup/create.rb on lines 18..37
lib/crowbar/client/command/backup/restore.rb on lines 18..37
lib/crowbar/client/command/interface/disable.rb on lines 18..37
lib/crowbar/client/command/repository/activate_all.rb on lines 18..37
lib/crowbar/client/command/repository/deactivate_all.rb on lines 18..37
lib/crowbar/client/command/restricted/ping.rb on lines 18..37
lib/crowbar/client/command/virtual_ip/deallocate.rb on lines 18..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 34.

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 Client
    module Command
      #
      # Module for the repository command implementations
      #
Severity: Minor
Found in lib/crowbar/client/command/repository.rb and 1 other location - About 30 mins to fix
lib/crowbar/client/request/repository.rb on lines 18..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 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 Client
    module Request
      #
      # Module for the repository request implementations
      #
Severity: Minor
Found in lib/crowbar/client/request/repository.rb and 1 other location - About 30 mins to fix
lib/crowbar/client/command/repository.rb on lines 18..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 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

Severity
Category
Status
Source
Language