Method process
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def process(path, top_dir, recurse = true)
dirs = []
results = []
path = File.expand_path(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 get_folder_settings
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_folder_settings(file)
unless File.file?(file)
@logger.debug(@class_name) { "Harvest directory config file was not found '#{file}'." }
return {}
end
Method process
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process(path, top_dir, recurse = true)
dirs = []
results = []
path = File.expand_path(path)
Method run
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def run(input, recurse = true)
results = []
@logger.info(@class_name) { 'Gathering files.' }
- 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 get_folder_settings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_folder_settings(file)
unless File.file?(file)
@logger.debug(@class_name) { "Harvest directory config file was not found '#{file}'." }
return {}
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 file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def file(path, top_dir, dir_settings = {})
unless File.file?(path)
msg = "'#{path}' is not a file."
@logger.error(@class_name) { msg }
fail ArgumentError, msg
- 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"