drish/hyperb

View on GitHub

Showing 10 of 10 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

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)
Severity: Minor
Found in lib/hyperb/network/fips.rb and 1 other location - About 55 mins to fix
lib/hyperb/network/fips.rb on lines 40..46

Similar blocks of code found in 2 locations. Consider refactoring.
Open

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)
Severity: Minor
Found in lib/hyperb/network/fips.rb and 1 other location - About 55 mins to fix
lib/hyperb/network/fips.rb on lines 115..121

Method initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def initialize(client, path, query = {}, verb = 'GET', body = '', optional_headers = {})
Severity: Minor
Found in lib/hyperb/request.rb - About 45 mins to fix

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    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)
    Severity: Major
    Found in lib/hyperb/containers/containers.rb and 2 other locations - About 45 mins to fix
    lib/hyperb/containers/containers.rb on lines 51..56
    lib/hyperb/containers/containers.rb on lines 232..237

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    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)
    Severity: Major
    Found in lib/hyperb/containers/containers.rb and 2 other locations - About 45 mins to fix
    lib/hyperb/containers/containers.rb on lines 51..56
    lib/hyperb/containers/containers.rb on lines 213..218

    Similar blocks of code found in 3 locations. Consider refactoring.
    Open

    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)
    Severity: Major
    Found in lib/hyperb/containers/containers.rb and 2 other locations - About 45 mins to fix
    lib/hyperb/containers/containers.rb on lines 213..218
    lib/hyperb/containers/containers.rb on lines 232..237

    Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def initialize(client, path, query = {}, verb = 'GET', body = '')
    Severity: Minor
    Found in lib/hyperb/request.rb - About 35 mins to fix

      Method compose_down has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      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)
      Severity: Minor
      Found in lib/hyperb/compose/compose.rb - About 25 mins to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      def remove_volume(params = {})
      raise ArgumentError, 'Invalid arguments.' unless check_arguments(params, 'id')
      path = '/volumes/' + params[:id]
      Hyperb::Request.new(self, path, {}, 'delete').perform
      Severity: Minor
      Found in lib/hyperb/volumes/volumes.rb and 1 other location - About 15 mins to fix
      lib/hyperb/funcs/funcs.rb on lines 103..106

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

      def remove_func(params = {})
      raise ArgumentError, 'Invalid arguments.' unless check_arguments(params, 'name')
      path = '/funcs/' + params[:name]
      Hyperb::Request.new(self, path, {}, 'delete').perform
      Severity: Minor
      Found in lib/hyperb/funcs/funcs.rb and 1 other location - About 15 mins to fix
      lib/hyperb/volumes/volumes.rb on lines 73..76
      Severity
      Category
      Status
      Source
      Language