maestrodev/maestro-rightscale-plugin

View on GitHub
src/rightscale_api_helper.rb

Summary

Maintainability
F
2 wks
Test Coverage

File rightscale_api_helper.rb has 1278 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'right_api_client'
require 'rubygems'
require 'logger'
require 'optparse'
require 'open-uri'
Severity: Major
Found in src/rightscale_api_helper.rb - About 3 days to fix

    Method create_cloudflow_process has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
    Open

          def create_cloudflow_process(args)
            # for convenience
            cloudflow_name = args[:cloudflow_name]
            cloudflow_inputs = args[:cloudflow_inputs]
            cloudflow_definition = args[:cloudflow_definition]
    Severity: Minor
    Found in src/rightscale_api_helper.rb - About 1 day 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 create_cloudflow_process has 152 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          def create_cloudflow_process(args)
            # for convenience
            cloudflow_name = args[:cloudflow_name]
            cloudflow_inputs = args[:cloudflow_inputs]
            cloudflow_definition = args[:cloudflow_definition]
    Severity: Major
    Found in src/rightscale_api_helper.rb - About 6 hrs to fix

      Method get_access_token has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

            def get_access_token(args)
              api_url = args[:api_url] || DEFAULT_API_URL
              oauth_url = args[:oauth_url] || DEFAULT_OAUTH_URL
              refresh_token = args[:refresh_token]
              email = args[:email]
      Severity: Minor
      Found in src/rightscale_api_helper.rb - About 4 hrs 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 stop_servers_in_deployment has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

            def stop_servers_in_deployment(args)
              # for convenience
              deployment_id = args[:deployment_id]
              deployment_name = args[:deployment_name]
              wait_until_stopped = args[:wait_until_stopped]
      Severity: Minor
      Found in src/rightscale_api_helper.rb - About 3 hrs 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 get_access_token has 89 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def get_access_token(args)
              api_url = args[:api_url] || DEFAULT_API_URL
              oauth_url = args[:oauth_url] || DEFAULT_OAUTH_URL
              refresh_token = args[:refresh_token]
              email = args[:email]
      Severity: Major
      Found in src/rightscale_api_helper.rb - About 3 hrs to fix

        Method start_servers_in_deployment has 86 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def start_servers_in_deployment(args)
                # for convenience
                deployment_id = args[:deployment_id]
                deployment_name = args[:deployment_name]
                wait_until_started = args[:wait_until_started]
        Severity: Major
        Found in src/rightscale_api_helper.rb - About 3 hrs to fix

          Method wait has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          Open

                def wait(args)
                  # for readability
                  server_id = args[:server_id]
                  server_name = args[:server_name]
                  deployment_id = args[:deployment_id]
          Severity: Minor
          Found in src/rightscale_api_helper.rb - About 3 hrs 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 start_servers_in_deployment has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

                def start_servers_in_deployment(args)
                  # for convenience
                  deployment_id = args[:deployment_id]
                  deployment_name = args[:deployment_name]
                  wait_until_started = args[:wait_until_started]
          Severity: Minor
          Found in src/rightscale_api_helper.rb - About 3 hrs 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 get_server has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Open

                def get_server(args)
                  # for convenience
                  server_id = args[:server_id]
                  server_name = args[:server_name]
                  deployment_id = args[:deployment_id]
          Severity: Minor
          Found in src/rightscale_api_helper.rb - About 3 hrs 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 stop_servers_in_deployment has 81 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def stop_servers_in_deployment(args)
                  # for convenience
                  deployment_id = args[:deployment_id]
                  deployment_name = args[:deployment_name]
                  wait_until_stopped = args[:wait_until_stopped]
          Severity: Major
          Found in src/rightscale_api_helper.rb - About 3 hrs to fix

            Method wait has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def wait(args)
                    # for readability
                    server_id = args[:server_id]
                    server_name = args[:server_name]
                    deployment_id = args[:deployment_id]
            Severity: Major
            Found in src/rightscale_api_helper.rb - About 2 hrs to fix

              Method start has 69 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def start(args)
                      # for readability
                      server_id = args[:server_id]
                      server_name = args[:server_name]
                      deployment_id = args[:deployment_id]
              Severity: Major
              Found in src/rightscale_api_helper.rb - About 2 hrs to fix

                Method stop has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def stop(args)
                        # for readability
                        server_id = args[:server_id]
                        server_name = args[:server_name]
                        deployment_id = args[:deployment_id]
                Severity: Major
                Found in src/rightscale_api_helper.rb - About 2 hrs to fix

                  Method get_cloudflow_process has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                        def get_cloudflow_process(args)
                          # for convenience
                          process_id = args[:process_id]
                          timeout = args[:timeout] || DEFAULT_TIMEOUT
                          api_version = DEFAULT_API_VERSION
                  Severity: Major
                  Found in src/rightscale_api_helper.rb - About 2 hrs to fix

                    Method get_server has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          def get_server(args)
                            # for convenience
                            server_id = args[:server_id]
                            server_name = args[:server_name]
                            deployment_id = args[:deployment_id]
                    Severity: Major
                    Found in src/rightscale_api_helper.rb - About 2 hrs to fix

                      Method get_cloudflow_process has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def get_cloudflow_process(args)
                              # for convenience
                              process_id = args[:process_id]
                              timeout = args[:timeout] || DEFAULT_TIMEOUT
                              api_version = DEFAULT_API_VERSION
                      Severity: Minor
                      Found in src/rightscale_api_helper.rb - About 2 hrs 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 start has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def start(args)
                              # for readability
                              server_id = args[:server_id]
                              server_name = args[:server_name]
                              deployment_id = args[:deployment_id]
                      Severity: Minor
                      Found in src/rightscale_api_helper.rb - About 1 hr 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 initialize has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def initialize(args)
                              delay_connect = args[:delay_connect] || false
                              @logger = args[:logger] || Logger.new(STDOUT)
                              @verbose = args[:verbose]
                              @trace = args[:trace]
                      Severity: Minor
                      Found in src/rightscale_api_helper.rb - About 1 hr 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 connect has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def connect(args={}) # :nodoc:
                              indent = args[:indent] || ''
                              cookies = args[:cookies] || {}
                        
                              args_no_pass = args.reject {|key, _| key == :password }
                      Severity: Minor
                      Found in src/rightscale_api_helper.rb - About 1 hr 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 stop has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def stop(args)
                              # for readability
                              server_id = args[:server_id]
                              server_name = args[:server_name]
                              deployment_id = args[:deployment_id]
                      Severity: Minor
                      Found in src/rightscale_api_helper.rb - About 1 hr 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 connect has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            def connect(args={}) # :nodoc:
                              indent = args[:indent] || ''
                              cookies = args[:cookies] || {}
                        
                              args_no_pass = args.reject {|key, _| key == :password }
                      Severity: Minor
                      Found in src/rightscale_api_helper.rb - About 1 hr to fix

                        Method get_deployment has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def get_deployment(args)
                                # for convenience
                                deployment_id = args[:deployment_id]
                                deployment_name = args[:deployment_name]
                                indent = args[:indent] || ''
                        Severity: Minor
                        Found in src/rightscale_api_helper.rb - About 1 hr to fix

                          Method get_deployment has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def get_deployment(args)
                                  # for convenience
                                  deployment_id = args[:deployment_id]
                                  deployment_name = args[:deployment_name]
                                  indent = args[:indent] || ''
                          Severity: Minor
                          Found in src/rightscale_api_helper.rb - About 55 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

                          Avoid deeply nested control flow statements.
                          Open

                                  if !result.notices.nil?
                                    puts "#{result.notices.size} Notices starting server (id=#{options[:server_id]} name=#{options[:server_name]})"
                                    result.notices.each{|notice|
                                      puts "  #{notice.inspect}"
                                    }
                          Severity: Major
                          Found in src/rightscale_api_helper.rb - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                  elsif options[:operation] == 'stop-server'
                                    result = helper.stop(options)
                                    if options[:wait_until_stopped]
                                      puts "Server (id=#{options[:server_id]} name=#{options[:server_name]}) stopped"
                                    else
                            Severity: Major
                            Found in src/rightscale_api_helper.rb - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                if timeout_reset
                                                  timeout_left = timeout
                                                  reset = true
                                                end
                              Severity: Major
                              Found in src/rightscale_api_helper.rb - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                  if show_progress
                                                    @logger.info "#{indent}create_cloudflow_process(): Process state is now #{state}"
                                                  else
                                                    @logger.debug "#{indent}create_cloudflow_process(): Process state is now #{state}"
                                                  end
                                Severity: Major
                                Found in src/rightscale_api_helper.rb - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                    if show_progress
                                                      @logger.info "#{indent}create_cloudflow_process(): Process state is #{state} (#{timeout-timeout_left}/#{timeout})"
                                                    else
                                                      @logger.debug "#{indent}create_cloudflow_process(): Process state is #{state} (#{timeout-timeout_left}/#{timeout})"
                                                    end
                                  Severity: Major
                                  Found in src/rightscale_api_helper.rb - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    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 - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                              if result.success
                                                if options[:wait_until_started]
                                                  puts "Server (id=#{options[:server_id]} name=#{options[:server_name]}) started"
                                                  instance = result.value
                                                  puts "  resource_uid: #{instance.resource_uid}"
                                      Severity: Major
                                      Found in src/rightscale_api_helper.rb - About 45 mins to fix

                                        Avoid too many return statements within this method.
                                        Open

                                                        return Result.new(:success => false, :errors => result.errors, :notices => result.notices)
                                        Severity: Major
                                        Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                          Avoid too many return statements within this method.
                                          Open

                                                      return Result.new(:success => true, :errors => [e])
                                          Severity: Major
                                          Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                            Avoid too many return statements within this method.
                                            Open

                                                              return Result.new(:success => false, :errors => [Exception.new(response_hash['summary'])])
                                            Severity: Major
                                            Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                              Avoid too many return statements within this method.
                                              Open

                                                        return Result.new(:success => false, :errors => [e])
                                              Severity: Major
                                              Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                Avoid too many return statements within this method.
                                                Open

                                                          return Result.new(:success => false, :errors => [e])
                                                Severity: Major
                                                Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                  Avoid too many return statements within this method.
                                                  Open

                                                                    return Result.new(:success => false, :errors => [Exception.new('Timed out waiting for CloudFlow to complete')])
                                                  Severity: Major
                                                  Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                    Avoid too many return statements within this method.
                                                    Open

                                                            return Result.new(:success => true, :value => process_id)
                                                    Severity: Major
                                                    Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                          return Result.new(:success => false, :errors => [Exception.new("Couldn't find access token in response")], :value => data)
                                                      Severity: Major
                                                      Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                    return Result.new(:success => false, :errors => [e])
                                                        Severity: Major
                                                        Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                  return Result.new(:success => true, :value => server)
                                                          Severity: Major
                                                          Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                      return Result.new(:success => false, :errors => [Exception.new(e.response['error_description'])], :value => e.response)
                                                            Severity: Major
                                                            Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                                return Result.new(:success => false, :errors => [Exception.new(result.to_hash['error_description'])])
                                                              Severity: Major
                                                              Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                        return Result.new(:success => true, :value => instance)
                                                                Severity: Major
                                                                Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                                    return Result.new(:success => false, :errors => [Exception.new(data['error_description'])], :value => data)
                                                                  Severity: Major
                                                                  Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                              return Result.new(:success => false, :errors => [Exception.new('No refresh token was specified, nor was a username/password/account')])
                                                                    Severity: Major
                                                                    Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                return Result.new(:success => false, :errors => [Exception.new(e.response['error_description'])], :value => e.response)
                                                                      Severity: Major
                                                                      Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                    return Result.new(:success => false, :errors => [Exception.new(e.response['error_description'])], :value => e.response)
                                                                        Severity: Major
                                                                        Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                      return Result.new(:success => false, :errors => result.errors, :value => instance)
                                                                          Severity: Major
                                                                          Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                              return Result.new(:success => false, :errors => [Exception.new("#{reponse.code} #{response}")])
                                                                            Severity: Major
                                                                            Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                          return Result.new(:success => false, :errors => result.errors, :value => result.value)
                                                                              Severity: Major
                                                                              Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                                  return Result.new(:success => false, :errors => [Exception.new(result.to_hash['error_description'])])
                                                                                Severity: Major
                                                                                Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                                    return Result.new(:success => true, :value => access_token)
                                                                                  Severity: Major
                                                                                  Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                                      return Result.new(:success => false, :errors => [Exception.new('CloudFlow failed to complete successfully')])
                                                                                    Severity: Major
                                                                                    Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                                                      Avoid too many return statements within this method.
                                                                                      Open

                                                                                              return Result.new(:success => false, :errors => [Exception.new("Timed out after #{timeout}s waiting for Server (id=#{server_id}, name=#{server.name}, deployment_id=#{deployment_id}, deployment_name=#{deployment_name}) to reach state #{state}, currently in state #{server.state}")], :value => server)
                                                                                      Severity: Major
                                                                                      Found in src/rightscale_api_helper.rb - About 30 mins to fix

                                                                                        Avoid too many return statements within this method.
                                                                                        Open

                                                                                                          return Result.new(:success => false, :errors => [Exception.new("#{reponse.code} #{response}")])
                                                                                        Severity: Major
                                                                                        Found in src/rightscale_api_helper.rb - About 30 mins to fix

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

                                                                                                  if !result.notices.nil?
                                                                                                    puts "#{result.notices.size} Notices stopping server (id=#{options[:server_id]} name=#{options[:server_name]})"
                                                                                                    result.notices.each{|notice|
                                                                                                      puts "  #{notice.inspect}"
                                                                                          Severity: Major
                                                                                          Found in src/rightscale_api_helper.rb and 4 other locations - About 30 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 1535..1538
                                                                                          src/rightscale_api_helper.rb on lines 1599..1602
                                                                                          src/rightscale_api_helper.rb on lines 1635..1638
                                                                                          src/rightscale_api_helper.rb on lines 1654..1657

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

                                                                                                  if !result.notices.nil?
                                                                                                    puts "#{result.notices.size} Notices starting server (id=#{options[:server_id]} name=#{options[:server_name]})"
                                                                                                    result.notices.each{|notice|
                                                                                                      puts "  #{notice.inspect}"
                                                                                          Severity: Major
                                                                                          Found in src/rightscale_api_helper.rb and 4 other locations - About 30 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 1557..1560
                                                                                          src/rightscale_api_helper.rb on lines 1599..1602
                                                                                          src/rightscale_api_helper.rb on lines 1635..1638
                                                                                          src/rightscale_api_helper.rb on lines 1654..1657

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

                                                                                                    if !result.notices.nil?
                                                                                                      puts "#{result.notices.size} Notices stopping deployment (id=#{options[:deployment_id]} name=#{options[:deployment_name]})"
                                                                                                      result.notices.each{|notice|
                                                                                                        puts "  #{notice.inspect}"
                                                                                          Severity: Major
                                                                                          Found in src/rightscale_api_helper.rb and 4 other locations - About 30 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 1535..1538
                                                                                          src/rightscale_api_helper.rb on lines 1557..1560
                                                                                          src/rightscale_api_helper.rb on lines 1599..1602
                                                                                          src/rightscale_api_helper.rb on lines 1654..1657

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

                                                                                                  if !result.notices.nil?
                                                                                                    puts "#{result.notices.size} Notices starting deployment (id=#{options[:deployment_id]} name=#{options[:deployment_name]})"
                                                                                                    result.notices.each{|notice|
                                                                                                      puts "  #{notice.inspect}"
                                                                                          Severity: Major
                                                                                          Found in src/rightscale_api_helper.rb and 4 other locations - About 30 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 1535..1538
                                                                                          src/rightscale_api_helper.rb on lines 1557..1560
                                                                                          src/rightscale_api_helper.rb on lines 1635..1638
                                                                                          src/rightscale_api_helper.rb on lines 1654..1657

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

                                                                                                    if !result.notices.nil?
                                                                                                      puts "#{result.notices.size} Notices starting deployment (id=#{options[:deployment_id]} name=#{options[:deployment_name]})"
                                                                                                      result.notices.each{|notice|
                                                                                                        puts "  #{notice.inspect}"
                                                                                          Severity: Major
                                                                                          Found in src/rightscale_api_helper.rb and 4 other locations - About 30 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 1535..1538
                                                                                          src/rightscale_api_helper.rb on lines 1557..1560
                                                                                          src/rightscale_api_helper.rb on lines 1599..1602
                                                                                          src/rightscale_api_helper.rb on lines 1635..1638

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

                                                                                                  rescue RestClient::Exception => e
                                                                                                    @logger.error "#{indent}get_cloudflow_process(): Error fetching CloudFlow process: #{e.response}"
                                                                                                    return Result.new(:success => false, :errors => [Exception.new(e.response['error_description'])], :value => e.response)
                                                                                                  rescue => e
                                                                                                    @logger.error "#{indent}get_cloudflow_process(): Error fetching CloudFlow process: #{e.message}"
                                                                                          Severity: Minor
                                                                                          Found in src/rightscale_api_helper.rb and 3 other locations - About 30 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 937..943
                                                                                          src/rightscale_api_helper.rb on lines 1187..1193
                                                                                          src/rightscale_api_helper.rb on lines 1236..1242

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 32.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

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

                                                                                                  rescue RestClient::Exception => e
                                                                                                    @logger.error "#{indent}create_cloudflow_process(): Error creating CloudFlow process: #{e.response}"
                                                                                                    return Result.new(:success => false, :errors => [Exception.new(e.response['error_description'])], :value => e.response)
                                                                                                  rescue => e
                                                                                                    @logger.error "#{indent}create_cloudflow_process(): Error creating CloudFlow process: #{e.message}"
                                                                                          Severity: Minor
                                                                                          Found in src/rightscale_api_helper.rb and 3 other locations - About 30 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 1125..1131
                                                                                          src/rightscale_api_helper.rb on lines 1187..1193
                                                                                          src/rightscale_api_helper.rb on lines 1236..1242

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 32.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

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

                                                                                                    rescue RestClient::Exception => e
                                                                                                      @logger.error "#{indent}get_access_token(): error while getting access token: #{e.response}"
                                                                                                      return Result.new(:success => false, :errors => [Exception.new(e.response['error_description'])], :value => e.response)
                                                                                                    rescue => e
                                                                                                      @logger.error "#{indent}get_access_token(): error while getting access token: #{e}"
                                                                                          Severity: Minor
                                                                                          Found in src/rightscale_api_helper.rb and 3 other locations - About 30 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 937..943
                                                                                          src/rightscale_api_helper.rb on lines 1125..1131
                                                                                          src/rightscale_api_helper.rb on lines 1236..1242

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 32.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

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

                                                                                                    rescue RestClient::Exception => e
                                                                                                      @logger.error "#{indent}get_access_token(): error while getting access token: #{e.response}"
                                                                                                      return Result.new(:success => false, :errors => [Exception.new(e.response['error_description'])], :value => e.response)
                                                                                                    rescue => e
                                                                                                      @logger.error "#{indent}get_access_token(): error while getting access token: #{e}"
                                                                                          Severity: Minor
                                                                                          Found in src/rightscale_api_helper.rb and 3 other locations - About 30 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 937..943
                                                                                          src/rightscale_api_helper.rb on lines 1125..1131
                                                                                          src/rightscale_api_helper.rb on lines 1187..1193

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 32.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

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

                                                                                                  if !result.errors.nil?
                                                                                                    puts "#{result.errors.size} Errors creating CloudFlow process (id=#{options[:process_id]})"
                                                                                                    result.errors.each{|error|
                                                                                                      puts "  #{error.message}, backtrace=#{error.backtrace}"
                                                                                          Severity: Minor
                                                                                          Found in src/rightscale_api_helper.rb and 1 other location - About 30 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 1669..1672

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 32.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

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

                                                                                                  if !result.errors.nil?
                                                                                                    puts "#{result.errors.size} Errors getting CloudFlow process (id=#{options[:process_id]})"
                                                                                                    result.errors.each{|error|
                                                                                                      puts "  #{error.message}, backtrace=#{error.backtrace}"
                                                                                          Severity: Minor
                                                                                          Found in src/rightscale_api_helper.rb and 1 other location - About 30 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 1690..1693

                                                                                          Duplicated Code

                                                                                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                                                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                                                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                                                          Tuning

                                                                                          This issue has a mass of 32.

                                                                                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                                                                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                                                                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                                                                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                                                                          Refactorings

                                                                                          Further Reading

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

                                                                                                  if !result.notices.nil?
                                                                                                    puts "#{result.notices.size} Notices getting CloudFlow process (id=#{options[:process_id]})"
                                                                                                    result.notices.each{|notice|
                                                                                                      puts "  #{notice.inspect}"
                                                                                          Severity: Minor
                                                                                          Found in src/rightscale_api_helper.rb and 1 other location - About 20 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 1697..1700

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

                                                                                          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 options[:wait_until_started]
                                                                                                      puts "Deployment (id=#{options[:deployment_id]} name=#{options[:deployment_name]}) started"
                                                                                                    else
                                                                                                      puts "Deployment (id=#{options[:deployment_id]} name=#{options[:deployment_name]}) launched"
                                                                                          Severity: Minor
                                                                                          Found in src/rightscale_api_helper.rb and 1 other location - About 20 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 1543..1546

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

                                                                                          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.notices.nil?
                                                                                                    puts "#{result.notices.size} Notices creating CloudFlow process (id=#{options[:process_id]})"
                                                                                                    result.notices.each{|notice|
                                                                                                      puts "  #{notice.inspect}"
                                                                                          Severity: Minor
                                                                                          Found in src/rightscale_api_helper.rb and 1 other location - About 20 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 1676..1679

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

                                                                                          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 options[:wait_until_stopped]
                                                                                                    puts "Server (id=#{options[:server_id]} name=#{options[:server_name]}) stopped"
                                                                                                  else
                                                                                                    puts "Server (id=#{options[:server_id]} name=#{options[:server_name]}) stop requested"
                                                                                          Severity: Minor
                                                                                          Found in src/rightscale_api_helper.rb and 1 other location - About 20 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 1577..1580

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

                                                                                          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

                                                                                                        when 403
                                                                                                          @logger.error "#{indent}get_cloudflow_process(): #{response}"
                                                                                                          return Result.new(:success => false, :errors => [Exception.new("#{response}")], :value => result.to_hash)
                                                                                          Severity: Minor
                                                                                          Found in src/rightscale_api_helper.rb and 1 other location - About 20 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 914..916

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

                                                                                          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

                                                                                                        when 403
                                                                                                          @logger.error "#{indent}create_cloudflow_process(): #{response}"
                                                                                                          return Result.new(:success => false, :errors => [Exception.new("#{response}")], :value => result.to_hash)
                                                                                          Severity: Minor
                                                                                          Found in src/rightscale_api_helper.rb and 1 other location - About 20 mins to fix
                                                                                          src/rightscale_api_helper.rb on lines 1109..1111

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

                                                                                          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

                                                                                          There are no issues that match your filters.

                                                                                          Category
                                                                                          Status