maestrodev/maestro-rightscale-plugin

View on GitHub

Showing 76 of 122 total issues

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

    File right_scale_worker.rb has 652 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'maestro_plugin'
    require 'rubygems'  # Unsure why this is required
    require 'rightscale_api_helper'
    
    module MaestroDev
    Severity: Major
    Found in src/right_scale_worker.rb - About 1 day 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 start has 77 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def start
                      Maestro.log.info "Starting RightScale Worker"
                
                      # make sure we have all the necessary fields
                      validate_server_fields()
              Severity: Major
              Found in src/right_scale_worker.rb - About 3 hrs to fix

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

                      def get_server
                        Maestro.log.info "Retrieving RightScale server information into the Composition"
                  
                        # TODO: much duplication with start, but refactor after other changes for deployments land
                  
                Severity: Major
                Found in src/right_scale_worker.rb - About 2 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_deployment has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          def start_deployment
                            Maestro.log.info "Starting RightScale Deployment"
                      
                            deployment_id = get_field('deployment_id')
                            deployment_name = get_field('deployment_name')
                    Severity: Major
                    Found in src/right_scale_worker.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 wait has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def wait
                                Maestro.log.info "Waiting for RightScale Worker"
                          
                                # make sure we have all the necessary fields
                                validate_server_fields()
                        Severity: Major
                        Found in src/right_scale_worker.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
                              Severity
                              Category
                              Status
                              Source
                              Language