Similar blocks of code found in 2 locations. Consider refactoring.
def fip_name(params = {})
raise ArgumentError, 'Invalid Arguments' unless check_arguments(params, 'ip', 'name')
path = '/fips/name'
query = {}
query[:ip] = params[:ip] if params.key?(:ip)
Similar blocks of code found in 2 locations. Consider refactoring.
def fip_attach(params = {})
raise ArgumentError, 'Invalid Arguments' unless check_arguments(params, 'container', 'ip')
path = '/fips/attach'
query = {}
query[:ip] = params[:ip] if params.key?(:ip)
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring.
def initialize(client, path, query = {}, verb = 'GET', body = '', optional_headers = {})
Similar blocks of code found in 3 locations. Consider refactoring.
def container_stats(params = {})
raise ArgumentError, 'Invalid arguments.' unless check_arguments(params, 'id')
path = '/containers/' + params[:id] + '/stats'
query = {}
query[:stream] = params[:stream] if params.key?(:stream)
Similar blocks of code found in 3 locations. Consider refactoring.
def kill_container(params = {})
raise ArgumentError, 'Invalid arguments.' unless check_arguments(params, 'id')
path = '/containers/' + params[:id] + '/kill'
query = {}
query[:signal] = params[:signal] if params.key?(:signal)
Similar blocks of code found in 3 locations. Consider refactoring.
def stop_container(params = {})
raise ArgumentError, 'Invalid arguments.' unless check_arguments(params, 'id')
path = '/containers/' + params[:id] + '/stop'
query = {}
query[:t] = params[:t] if params.key?(:t)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring.
def initialize(client, path, query = {}, verb = 'GET', body = '')
Method compose_down
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def compose_down(params = {})
raise ArgumentError, 'Invalid arguments.' unless check_arguments(params, 'project')
path = '/compose/down'
query = {}
query[:project] = params[:project] if params.key?(:project)
Similar blocks of code found in 2 locations. Consider refactoring.
def remove_volume(params = {})
raise ArgumentError, 'Invalid arguments.' unless check_arguments(params, 'id')
path = '/volumes/' + params[:id]
Hyperb::Request.new(self, path, {}, 'delete').perform
Similar blocks of code found in 2 locations. Consider refactoring.
def remove_func(params = {})
raise ArgumentError, 'Invalid arguments.' unless check_arguments(params, 'name')
path = '/funcs/' + params[:name]
Hyperb::Request.new(self, path, {}, 'delete').perform