Skip to content

Instantly share code, notes, and snippets.

@nuheluxulu
Created April 18, 2019 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nuheluxulu/dd89a5551b2071795b663137ae3a8f10 to your computer and use it in GitHub Desktop.
Save nuheluxulu/dd89a5551b2071795b663137ae3a8f10 to your computer and use it in GitHub Desktop.
def initialize(**opts)
@list_type = opts[:list_type] || 'ALL'
@search_term = opts[:search_term] || ''
begin
@page = Integer(opts[:page])
rescue ArgumentError
@page = 1
end
begin
@page_size = Integer(opts[:page_size])
rescue ArgumentError
@page_size = 20
end
begin
@page_size = Integer(opts[:page_size])
rescue ArgumentError
@page_size = 20
end
@sort_by = opts[:sort_by] || ''
end
C: Metrics/CyclomaticComplexity: Cyclomatic complexity for initialize is too high. [7/6]
C: Metrics/MethodLength: Method has too many lines. [18/10]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment