Showing 4 of 4 total issues
Method print_introduction_msg
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.print_introduction_msg(configuration)
return if configuration.silent
puts "Starting My Local Put.io - version #{VERSION}"
puts "https://github.com/rafaelbiriba/my-local-putio"
puts "============================================="
- 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 process_file
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process_file(file, path)
file_path = File.join(path, file.name)
if file.content_type == "application/x-directory"
while !directory_empty?(file)
fetch_files(id: file.id, path: file_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 check_for_available_space_on_destinations!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def check_for_available_space_on_destinations!(needed_space)
return unless configuration.disk_threshold
[configuration.local_destination, configuration.temp_destination].each do |path|
free_space = get_folder_free_space(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 validate_args!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_args!
unless @token
puts "Missing token"
exit
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"