Method collect_folders_by_machine
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def collect_folders_by_machine
if @machine_synced_folders.empty?
{ 'default' => default_synced_folders }
else
folders = @machine_synced_folders.map do |name, synced_folders|
- 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 merge_with_defaults
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def merge_with_defaults(synced_folders)
default_synced_folders.tap do |merged|
synced_folders.each do |guest_path, opts|
if opts[:disabled]
merged.delete(guest_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 match_machines!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def match_machines!(search_string)
machines =
if (pattern = search_string[%r{^/(.+?)/$}, 1])
match_machines_by_regexp(pattern)
elsif search_string.include? ','
- 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"