Method build_spec
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_spec(location, bundle_type, deployment_group_id, file_exists_behavior, all_possible_lifecycle_events, deployment_group_name, application_name, appspec_filename)
Method s3_revision
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def s3_revision(location, uri, bundle_type)
bucket = uri.host
if (uri.path[0] != '/')
raise AWS::CodeDeploy::Local::CLIValidator::ValidationError.new("s3 location #{location} not in the expected format of 's3://bucket/key'")
end
- 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 initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(configuration_file_location = CONF_DEFAULT_LOCATION)
configuration_file_location ||= CONF_DEFAULT_LOCATION # Default gets set this way even if the input is nil
if IS_WINDOWS then self.class.configure_windows_certificate end
if File.file?(configuration_file_location) && File.readable?(configuration_file_location)
- 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 github_revision
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def github_revision(location, uri, bundle_type)
if uri.host == 'github.com' && match = uri.path.match(/\/([^\/]*)\/(.*)$/i)
owner, repository_name = match.captures
commit = 'HEAD'
elsif match = uri.path.match(/\/repos\/([^\/]*)\/([^\/]*)\/.*\/(.*)$/i)
- 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 revision
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def revision(location, bundle_type)
uri = URI.parse(location)
if (uri.scheme == 's3')
s3_revision(location, uri, bundle_type)
elsif (uri.scheme == 'https' && uri.host.end_with?('github.com'))
- 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"