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'
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
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]
- Read upRead up
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]
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]
- Read upRead up
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]
- Read upRead up
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]
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]
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]
- Read upRead up
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]
- Read upRead up
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]
- Read upRead up
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]
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()
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
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]
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')
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]
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()
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]
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