Showing 7 of 9 total issues
Method finalize!
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def finalize!
@enabled = true if @enabled == UNSET_VALUE
@roles = nil if @roles == UNSET_VALUE
@roles = expand_paths(@roles) if @roles
@environments = nil if @environments == UNSET_VALUE
- 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 select_cookbooks
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def select_cookbooks(path)
cookbook_paths = []
if path.nil?
cookbook_paths = []
elsif path.respond_to?('empty?') && path.empty?
- 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 chef_repo_path=
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def chef_repo_path=(path)
@chef_repo_path = File.expand_path(path)
@roles = path_exists?("#{path}/roles") ? "#{path}/roles" : nil
@environments = path_exists?("#{path}/environments") ? "#{path}/environments" : nil
@nodes = path_exists?("#{path}/nodes") ? "#{path}/nodes" : nil
- 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 upload_data_bags
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def upload_data_bags(env)
path = env[:machine].config.chef_zero.data_bags
if path && path.is_a?(String) && File.directory?(path)
data_bags = Dir.glob("#{path}/*").select{|d| File.directory? d}
- 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 select_items
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def select_items(path)
if path.nil?
path = []
elsif path.respond_to?('empty?') && path.empty?
path = []
- 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 upload_environments
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def upload_environments(env)
path = env[:machine].config.chef_zero.environments
existing_envs = @conn.environment.all
environments = select_items(path)
- 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 upload_roles
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def upload_roles(env)
path = env[:machine].config.chef_zero.roles
existing_roles = @conn.role.all
roles = select_items(path)
- 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"