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 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_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 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_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"