Showing 22 of 22 total issues

Use a guard clause instead of wrapping the code inside a conditional expression. (https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals)
Open

      unless @multiplex_manager.active?(@machine_name)
Severity: Minor
Found in lib/avsh/ssh_command_executor.rb by rubocop

Use a guard clause instead of wrapping the code inside a conditional expression

Example:

# bad
def test
  if something
    work
  end
end

# good
def test
  return unless something
  work
end

# also good
def test
  work if something
end

# bad
if something
  raise 'exception'
else
  ok
end

# good
raise 'exception' if something
ok

When using method_missing, define respond_to_missing? and fall back on super. (https://github.com/bbatsov/ruby-style-guide#no-method-missing)
Open

      def self.method_missing(*)
        DummyConfig
      end
Severity: Minor
Found in lib/avsh/vagrantfile_environment.rb by rubocop

This cop checks for the presence of method_missing without also defining respond_to_missing? and falling back on super.

Example:

#bad
def method_missing(name, *args)
  # ...
end

#good
def respond_to_missing?(name, include_private)
  # ...
end

def method_missing(name, *args)
  # ...
  super
end
Severity
Category
Status
Source
Language