Showing 16 of 22 total issues
Method action_start_server
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def action_start_server
Vagrant::Action::Builder.new.tap do |b|
b.use Call, CheckProvider do |env, b2|
next if !env[:result]
- 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
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def validate(machine)
errors = _detected_errors
if backed_by_cloud_provider?(machine)
machine.ui.warn("Disabling vagrant-notify, cloud provider #{machine.provider_name} in use.")
- 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 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = 'Usage: vagrant notify'
o.separator ''
Method execute
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def execute
options = {}
opts = OptionParser.new do |o|
o.banner = 'Usage: vagrant notify'
o.separator ''
- 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 call
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
message = notify_provision_messages(env) unless env[:machine].config.notify.enable == false
system(message[:start]) unless env[:machine].config.notify.enable == false
begin
- 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 action_status_server
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def action_status_server
Vagrant::Action::Builder.new.tap do |b|
b.use Call, CheckProvider do |env, b2|
next if !env[:result]
- 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
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def validate(machine)
errors = _detected_errors
if backed_by_cloud_provider?(machine)
machine.ui.warn("Disabling vagrant-notify, cloud provider #{machine.provider_name} in use.")
Method run
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.run(id, port, bind_ip, sender_app, sender_params_str, sender_params_escape, machine_name='default', provider='virtualbox')
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(id, sender_app, sender_params_str, sender_params_escape, machine_name = :default, provider = :virtualbox)
Method action_stop_server
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def action_stop_server
Vagrant::Action::Builder.new.tap do |b|
b.use Call, CheckProvider do |env, b2|
next if !env[:result]
- 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 valid_process?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def valid_process?(pid)
if RUBY_PLATFORM =~ /mswin|msys|mingw|cygwin|bccwin|wince|emc/
Vagrant::Notify::Action::Windows::ProcessInfo.queryProcess(pid) if pid
else
Process.getpgid(pid.to_i) if pid
- 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 queryProcess
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.queryProcess(pid)
return false unless pid =~ /\A\d+\z/
result = `c\:/Windows/System32/wbem/WMIC.exe process where \"ProcessID = '#{pid}'\" get ProcessID,Commandline /format:list 2>nul`
querypid = false
result.split(/\r?\n/).each do |line|
- 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 next_available_port
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def next_available_port(bind_ip)
# Determine a list of usable ports for us to use
usable_ports = Set.new(@env[:machine].config.vm.usable_port_range)
# Pass one, remove all defined host ports from usable ports
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.run(id, port, bind_ip, sender_app, sender_params_str, sender_params_escape, machine_name='default', provider='virtualbox')
#id = env[:machine].id
#machine_name = env[:machine].name
#provider = env[:machine].provider_name
#sender_app = env[:machine].config.sender_app
- 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 call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
begin
unless env[:machine].config.notify.enable == false
host_dir = Pathname("/tmp/vagrant-notify/#{env[:machine].index_uuid}")
FileUtils.mkdir_p host_dir.to_s unless host_dir.exist?
- 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 which
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def which(cmd)
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
exts.each { |ext|
exe = File.join(path, "#{cmd}#{ext}")
- 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"