Showing 7 of 22 total issues
Method parser
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parser # rubocop:disable Metrics/MethodLength, Metrics/AbcSize
OptionParser.new do |opts|
opts.banner = banner_usages + "\nOptions:"
opts.on('-m', '--machine MACHINE', 'Target Vagrant machine(s).',
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 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"
Further reading
Method find
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def find(host_directory)
start_directory = File.expand_path(@vagrant_cwd || host_directory)
cur_directory = start_directory
filenames = filenames_to_check
- 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
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def match(host_directory, machine_search_string = nil)
real_host_directory = File.expand_path(host_directory)
synced_folders_by_machine = @vagrant_config.collect_folders_by_machine
if machine_search_string
- 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute(command, guest_directory = nil, interactive = true,
user_ssh_options = '')
if command.empty?
# No command, so run a login shell
command = 'exec $SHELL -l'
- 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"