Showing 21 of 24 total issues
Method create_and_run_container
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def create_and_run_container args
# update the timeout for the Excon Http Client
# set the chunk size to enable streaming of log files
::Docker.options = {:chunk_size => 1, :read_timeout => 3600}
container = ::Docker::Container.create(
- Read upRead up
- Create a ticketCreate a ticket
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_logger
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def self.create_logger(output, verbose = false)
Logger.new(output).tap do |l|
l.datetime_format = ''
l.formatter = proc do |severity, datetime, progname, msg|
if msg != nil
- Read upRead up
- Create a ticketCreate a ticket
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 read_task_section
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def read_task_section section, docker_config
Task.new.tap do |t|
t.consul_loader = read_consul_loader_section section['consul_loader'] unless section['consul_loader'] == nil
t.health_check = read_url section['health_check'] unless section['health_check'] == nil
t.docker = read_docker_section section['docker'] unless section['docker'] == nil
- Read upRead up
- Create a ticketCreate a ticket
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 process
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def process config
replace_variables config.template_location
replace_variables config.generate_settings.command unless config.generate_settings == nil || config.generate_settings.command == nil
replace_variables config.generate_settings.docker_file unless config.generate_settings == nil || config.generate_settings.docker_file == nil
- Read upRead up
- Create a ticketCreate a ticket
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 run_with_block
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def run_with_block
success = true
begin
@docker_network.create
- Read upRead up
- Create a ticketCreate a ticket
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 read
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def read config_file
b = binding
config = Config.new
file = ERB.new(File.read(config_file)).result b
- Read upRead up
- Create a ticketCreate a ticket
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 read_docker_section
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def read_docker_section section
DockerSettings.new.tap do |d|
d.build_image = section['build_image'] unless section['build_image'] == nil
d.build_docker_file = section['build_docker_file'] unless section['build_docker_file'] == nil
d.application_docker_file = section['application_docker_file'] unless section['application_docker_file'] == nil
- Read upRead up
- Create a ticketCreate a ticket
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 read_docker_registry
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def read_docker_registry section
DockerRegistrySettings.new.tap do |d|
d.url = section['url'].is_a?(Hash) ? read_secure(section['url']) : section['url']
d.user = section['user'].is_a?(Hash) ? read_secure(section['user']) : section['user']
d.password = section['password'].is_a?(Hash) ? read_secure(section['password']) : section['password']
- Read upRead up
- Create a ticketCreate a ticket
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_dependencies
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_dependencies task
project_name = "minke#{SecureRandom.urlsafe_base64(12)}".downcase.gsub(/[^0-9a-z ]/i, '')
network_name = ENV['DOCKER_NETWORK'] ||= "#{project_name}_default"
ENV['DOCKER_PROJECT'] = project_name
ENV['DOCKER_NETWORK'] = network_name
- Create a ticketCreate a ticket
Method run_command_in_container
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_command_in_container(command, blocking = false, links = nil, ports = nil)
begin
@logger.info "Running command: #{command}"
settings = @generator_config.build_settings.docker_settings
volumes = settings.binds.clone unless settings.binds == nil
- Create a ticketCreate a ticket
Method create_and_run_blocking_container
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_and_run_blocking_container args
host_config = get_port_bindings args
host_config['NetworkMode'] = @network
host_config['Binds'] = args[:volumes]
- Create a ticketCreate a ticket
Method process
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def process generator_name, output_folder
generator = get_generator generator_name
# process the files
@logger.info '# Modifiying templates'
- Read upRead up
- Create a ticketCreate a ticket
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 run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def run args = nil
@logger.info "## Running cucumber with tags #{args}"
compose_file = @config.compose_file_for(@task_name)
compose_file = File.expand_path(compose_file)
- Read upRead up
- Create a ticketCreate a ticket
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 build_image
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def build_image dockerfile_dir, name
::Docker.options = {:read_timeout => 6200}
begin
::Docker::Image.build_from_dir(dockerfile_dir, {:t => name}) do |v|
data = /{"stream.*:"(.*)".*/.match(v)
- Read upRead up
- Create a ticketCreate a ticket
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 run_command_in_container
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def run_command_in_container(command, blocking = false, links = nil, ports = nil)
begin
@logger.info "Running command: #{command}"
settings = @generator_config.build_settings.docker_settings
volumes = settings.binds.clone unless settings.binds == nil
- Read upRead up
- Create a ticketCreate a ticket
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_and_run_container
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_and_run_container args
# update the timeout for the Excon Http Client
# set the chunk size to enable streaming of log files
::Docker.options = {:chunk_size => 1, :read_timeout => 3600}
container = ::Docker::Container.create(
- Create a ticketCreate a ticket
Method run_with_block
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_with_block
success = true
begin
@docker_network.create
- Create a ticketCreate a ticket
Method read_url
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def read_url section
URL.new.tap do |url|
url.address = section['address']
url.port = section['port'] != nil ? section['port'].to_s : '80'
url.path = section['path'] != nil ? section['path'] : ''
- Read upRead up
- Create a ticketCreate a ticket
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 read_pre_post_section
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def read_pre_post_section section
TaskRunSettings.new.tap do |tr|
tr.tasks = section['tasks'] unless section['tasks'] == nil
tr.copy = read_copy_section section['copy'] unless section['copy'] == nil
end
- Read upRead up
- Create a ticketCreate a ticket
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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute command, ignore_error=false
@logger.debug command
Open3.popen2e(command) do |stdin, stdout_err, wait_thr|
while line = stdout_err.gets
- Read upRead up
- Create a ticketCreate a ticket
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"