Showing 3 of 11 total issues
Method hook_add_files
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def hook_add_files
@flavor.class.before_add_files do |files, resource_action|
if :create == resource_action && fail_on_clobber
files.each do |file|
if File.exist?(destination_path(file))
- 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 hook_add_templates
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def hook_add_templates
@flavor.class.before_add_templates do |templates, resource_action|
if :create == resource_action && fail_on_clobber
templates.each do |template|
if File.exist?(destination_path(template))
- 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 initialize_generate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize_generate
super
@flavor.class.do_declare_resources do
c = ChefDK::Generator.context
if c.have_git && !c.skip_git_init
- 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"