lib/astrails/safe/local.rb
Method cleanup
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def cleanup
return unless keep = config[:keep, :local]
puts "listing files #{base}" if verbose?
- 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 save
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def save
puts "command: #{@backup.command}" if verbose?
# FIXME: probably need to change this to smth like @backup.finalize!
@backup.path = full_path # need to do it outside DRY_RUN so that it will be avialable for S3 DRY_RUN
- 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"