Class Cookbook
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Cookbook
require_relative 'cookbook/metadata'
require_relative 'cookbook/syntax_check'
class << self
Method load_root
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def load_root
[].tap do |files|
Dir.glob(path.join('*'), File::FNM_DOTMATCH).each do |file|
next if File.directory?(file)
next if ignored?(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 load_recursively
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def load_recursively(category, category_dir, glob)
[].tap do |files|
file_spec = path.join(category_dir, '**', glob)
Dir.glob(file_spec, File::FNM_DOTMATCH).each do |file|
next if File.directory?(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 validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate
raise IOError, "No Cookbook found at: #{path}" unless path.exist?
unless syntax_checker.validate_ruby_files
raise Ridley::Errors::CookbookSyntaxError, "Invalid ruby files in cookbook: #{cookbook_name} (#{version})."
- 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"