Showing 23 of 23 total issues
Method create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.create(options = {}, conn = Docker.connection)
container = options.delete('Container')
# Podman does not attach these by default but does require them to be attached
if ::Docker.podman?(conn)
- 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 file_hash_from_paths
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def file_hash_from_paths(local_paths)
local_paths.each_with_object({}) do |local_path, file_hash|
unless File.exist?(local_path)
raise ArgumentError, "#{local_path} does not exist."
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 stats
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def stats(options = {})
if block_given?
options[:read_timeout] ||= 10
options[:idempotent] ||= false
parser = lambda do |chunk, remaining_bytes, total_bytes|
- 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"