lib/minke/docker/docker_runner.rb
Method create_and_run_container
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
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_and_run_blocking_container
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
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 build_image
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
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 create_and_run_container
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
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