irphilli/tracker_api

View on GitHub

Showing 6 of 22 total issues

Method paginate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def paginate(path, options = {}, &block)
opts = parse_query_and_convenience_headers path, options.dup
auto_paginate = opts[:params].delete(:auto_paginate) { |k| @auto_paginate }
@last_response = request :get, opts
data = @last_response.body
Severity: Minor
Found in lib/tracker_api/client.rb - About 55 mins to fix

Method add_owner has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def add_owner(owner)
owner_id = if owner.kind_of?(Integer)
owner_id = owner
else
raise ArgumentError, 'Valid Person expected.' unless owner.instance_of?(Resources::Person)
Severity: Minor
Found in lib/tracker_api/resources/story.rb - About 35 mins to fix

Method request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def request(method, options = {})
url = options.fetch(:url)
params = options[:params] || {}
body = options[:body]
headers = options[:headers]
Severity: Minor
Found in lib/tracker_api/client.rb - About 35 mins to fix

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

def get(project_id, story_id: nil, epic_id: nil, params: {})
raise ArgumentError, 'One of story id or epic id must be provided.' if story_id.nil? && epic_id.nil?
 
comment_target_slug = !story_id.nil? ? "stories/#{story_id}" : "epics/#{epic_id}"
 
 
Severity: Minor
Found in lib/tracker_api/endpoints/comments.rb - About 25 mins to fix

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

def update(comment, params={})
raise ArgumentError, 'Valid comment required to update.' unless comment.instance_of?(Resources::Comment)
 
comment_target_slug = !comment.story_id.nil? ? "stories/#{comment.story_id}" : "epics/#{comment.epic_id}"
 
 
Severity: Minor
Found in lib/tracker_api/endpoints/comment.rb - About 25 mins to fix

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

def iterations(params={})
if params.include?(:number)
number = params[:number].to_i
raise ArgumentError, ':number must be > 0' unless number > 0
 
 
Severity: Minor
Found in lib/tracker_api/resources/project.rb - About 25 mins to fix
Severity
Category
Status
Source
Language