maestrodev/maestro-rightscale-plugin

View on GitHub

Showing 46 of 122 total issues

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

        if wait_until_stopped
          timeout_left = timeout
          start_time = Time.now.to_i
  
          # waiting for each server in the deployment that we just stopped or we're actively trying to shut down
Severity: Major
Found in src/rightscale_api_helper.rb and 1 other location - About 6 hrs to fix
src/rightscale_api_helper.rb on lines 657..701

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

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 wait_until_started
          timeout_left = timeout
          start_time = Time.now.to_i
  
          # waiting for each server in the deployment
Severity: Major
Found in src/rightscale_api_helper.rb and 1 other location - About 6 hrs to fix
src/rightscale_api_helper.rb on lines 775..819

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

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 response_hash && response_hash.is_a?(Hash) && response_hash.has_key?('summary')
                  @logger.error "#{indent}create_cloudflow_process(): Error creating CloudFlow process: summary: #{response_hash['summary']}"
                  return Result.new(:success => false, :errors => [Exception.new(response_hash['summary'])])
                elsif result.to_hash.has_key?('create_cloudflow_process')
                  @logger.error "#{indent}create_cloudflow_process(): Error creating CloudFlow process: error_description: #{result.to_hash['error_description']}"
Severity: Major
Found in src/rightscale_api_helper.rb and 1 other location - About 2 hrs to fix
src/rightscale_api_helper.rb on lines 1113..1122

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

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 response_hash && response_hash.is_a?(Hash) && response_hash.has_key?('summary')
                  @logger.error "#{indent}get_cloudflow_process(): Error fetching CloudFlow process: summary: #{response_hash['summary']}"
                  return Result.new(:success => false, :errors => [Exception.new(response_hash['summary'])])
                elsif result.to_hash.has_key?('error_description')
                  @logger.error "#{indent}get_cloudflow_process(): Error fetching CloudFlow process: error_description: #{result.to_hash['error_description']}"
Severity: Major
Found in src/rightscale_api_helper.rb and 1 other location - About 2 hrs to fix
src/rightscale_api_helper.rb on lines 925..934

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

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

        if server_id && server_id.to_i > 0
          write_output "Looking up server by id=#{server_id}\n"
        elsif server_name && server_name != ''
          if deployment_id
            write_output "Looking up server by nickname=#{server_name} deployment_id=#{deployment_id}\n"
Severity: Major
Found in src/right_scale_worker.rb and 2 other locations - About 1 hr to fix
src/right_scale_worker.rb on lines 246..264
src/right_scale_worker.rb on lines 420..438

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

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

        if server_id && server_id.to_i > 0
          write_output "Looking up server by id=#{server_id}\n"
        elsif server_name && server_name != ''
          if deployment_id
            write_output "Looking up server by nickname=#{server_name} deployment_id=#{deployment_id}\n"
Severity: Major
Found in src/right_scale_worker.rb and 2 other locations - About 1 hr to fix
src/right_scale_worker.rb on lines 246..264
src/right_scale_worker.rb on lines 344..362

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

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

        if server_id && server_id.to_i > 0
          write_output "Looking up server by id=#{server_id}\n"
        elsif server_name && server_name != ''
          if deployment_id
            write_output "Looking up server by nickname=#{server_name} deployment_id=#{deployment_id}\n"
Severity: Major
Found in src/right_scale_worker.rb and 2 other locations - About 1 hr to fix
src/right_scale_worker.rb on lines 344..362
src/right_scale_worker.rb on lines 420..438

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

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

        if server.nil?
          @logger.error "#{indent}wait(): Server (id=#{server_id}, name=#{server.name}, deployment_id=#{deployment_id}, deployment_name=#{deployment_name} state=#{server.state}) cannot be found"
          return Result.new(:success => false, :errors => [Exception.new("Cannot find Server (id=#{server_id}, name=#{server.name}, deployment_id=#{deployment_id}, deployment_name=#{deployment_name}) to wait for")])
Severity: Major
Found in src/rightscale_api_helper.rb and 2 other locations - About 1 hr to fix
src/rightscale_api_helper.rb on lines 163..165
src/rightscale_api_helper.rb on lines 264..266

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

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

        if server.nil?
          @logger.error "#{indent}start(): Server (id=#{server_id}, name=#{server.name}, deployment_id=#{deployment_id}, deployment_name=#{deployment_name} state=#{server.state}) cannot be found"
          return Result.new(:success => false, :errors => [Exception.new("Cannot find Server (id=#{server_id}, name=#{server.name}, deployment_id=#{deployment_id}, deployment_name=#{deployment_name}) to stop")])
Severity: Major
Found in src/rightscale_api_helper.rb and 2 other locations - About 1 hr to fix
src/rightscale_api_helper.rb on lines 163..165
src/rightscale_api_helper.rb on lines 367..369

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

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

        if server.nil?
          @logger.error "#{indent}start(): Server (id=#{server_id}, name=#{server.name}, deployment_id=#{deployment_id}, deployment_name=#{deployment_name} state=#{server.state}) cannot be found"
          return Result.new(:success => false, :errors => [Exception.new("Cannot find Server (id=#{server_id}, name=#{server.name}, deployment_id=#{deployment_id}, deployment_name=#{deployment_name}) to start")])
Severity: Major
Found in src/rightscale_api_helper.rb and 2 other locations - About 1 hr to fix
src/rightscale_api_helper.rb on lines 264..266
src/rightscale_api_helper.rb on lines 367..369

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

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

        if !result.errors.nil?
          puts "#{result.errors.size} Errors starting deployment (id=#{options[:deployment_id]} name=#{options[:deployment_name]})"
          result.errors.each{|error|
            puts "  #{error.message}, backtrace=#{error.backtrace}"
Severity: Major
Found in src/rightscale_api_helper.rb and 4 other locations - About 40 mins to fix
src/rightscale_api_helper.rb on lines 1528..1531
src/rightscale_api_helper.rb on lines 1550..1553
src/rightscale_api_helper.rb on lines 1628..1631
src/rightscale_api_helper.rb on lines 1647..1650

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

        if !result.errors.nil?
          puts "#{result.errors.size} Errors stopping server (id=#{options[:server_id]} name=#{options[:server_name]})"
          result.errors.each{|error|
            puts "  #{error.message}, backtrace=#{error.backtrace}"
Severity: Major
Found in src/rightscale_api_helper.rb and 4 other locations - About 40 mins to fix
src/rightscale_api_helper.rb on lines 1528..1531
src/rightscale_api_helper.rb on lines 1592..1595
src/rightscale_api_helper.rb on lines 1628..1631
src/rightscale_api_helper.rb on lines 1647..1650

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

          if !result.errors.nil?
            puts "#{result.errors.size} Errors stopping deployment (id=#{options[:deployment_id]} name=#{options[:deployment_name]})"
            result.errors.each{|error|
              puts "  #{error.message}, backtrace=#{error.backtrace}"
Severity: Major
Found in src/rightscale_api_helper.rb and 4 other locations - About 40 mins to fix
src/rightscale_api_helper.rb on lines 1528..1531
src/rightscale_api_helper.rb on lines 1550..1553
src/rightscale_api_helper.rb on lines 1592..1595
src/rightscale_api_helper.rb on lines 1647..1650

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

        if !result.errors.nil?
          puts "#{result.errors.size} Errors starting server (id=#{options[:server_id]} name=#{options[:server_name]})"
          result.errors.each{|error|
            puts "  #{error.message}, backtrace=#{error.backtrace}"
Severity: Major
Found in src/rightscale_api_helper.rb and 4 other locations - About 40 mins to fix
src/rightscale_api_helper.rb on lines 1550..1553
src/rightscale_api_helper.rb on lines 1592..1595
src/rightscale_api_helper.rb on lines 1628..1631
src/rightscale_api_helper.rb on lines 1647..1650

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

          if !result.errors.nil?
            puts "#{result.errors.size} Errors starting deployment (id=#{options[:deployment_id]} name=#{options[:deployment_name]})"
            result.errors.each{|error|
              puts "  #{error.message}, backtrace=#{error.backtrace}"
Severity: Major
Found in src/rightscale_api_helper.rb and 4 other locations - About 40 mins to fix
src/rightscale_api_helper.rb on lines 1528..1531
src/rightscale_api_helper.rb on lines 1550..1553
src/rightscale_api_helper.rb on lines 1592..1595
src/rightscale_api_helper.rb on lines 1628..1631

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

        elsif server.state != STATE_OPERATIONAL
          @logger.error "#{indent}stop(): Not stopping Server (id=#{server_id}, name=#{server.name}, state=#{server.state}), not operational"
          return Result.new(:success => false, :errors => [Exception.new('Cannot stop server that is not in operational state')], :value => server)
Severity: Minor
Found in src/rightscale_api_helper.rb and 1 other location - About 35 mins to fix
src/rightscale_api_helper.rb on lines 175..177

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

        elsif server.state != STATE_INACTIVE
          @logger.error "#{indent}start(): Not starting Server (id=#{server_id}, name=#{server.name}, state=#{server.state}), not inactive"
          return Result.new(:success => false, :errors => [Exception.new('Cannot start server that is not in inactive state')], :value => server)
Severity: Minor
Found in src/rightscale_api_helper.rb and 1 other location - About 35 mins to fix
src/rightscale_api_helper.rb on lines 276..278

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

        if !result.errors.nil?
          @log_wrapper.info "#{result.errors.size} Errors stopping deployment (id=#{deployment_id} name=#{deployment_name})"
          result.errors.each{|error|
            @log_wrapper.error "  #{error.message}, backtrace=#{error.backtrace}"
Severity: Minor
Found in src/right_scale_worker.rb and 1 other location - About 35 mins to fix
src/right_scale_worker.rb on lines 521..524

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

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 !result.errors.nil?
          @log_wrapper.info "#{result.errors.size} Errors starting deployment (id=#{deployment_id} name=#{deployment_name})"
          result.errors.each{|error|
            @log_wrapper.error "  #{error.message}, backtrace=#{error.backtrace}"
Severity: Minor
Found in src/right_scale_worker.rb and 1 other location - About 35 mins to fix
src/right_scale_worker.rb on lines 611..614

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

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

        if server.nil?
          write_output "Error finding server by id=#{server_id}, name=#{server_name}, deployment_id=#{deployment_id}, deployment_name=#{deployment_name}\n"
          set_error "Error finding server by id=#{server_id}, name=#{server_name}, deployment_id=#{deployment_id}, deployment_name=#{deployment_name}\n"
          return
        end
Severity: Major
Found in src/right_scale_worker.rb and 3 other locations - About 30 mins to fix
src/right_scale_worker.rb on lines 167..171
src/right_scale_worker.rb on lines 370..374
src/right_scale_worker.rb on lines 448..452

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