Class Base
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
QUERY_PARAMS_FOR_SINGLE_FETCH = Set.new %i[expand fields]
QUERY_PARAMS_FOR_SEARCH = Set.new %i[expand fields startAt maxResults]
# A reference to the JIRA::Client used to initialize this resource.
File base.rb
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'active_support/core_ext/string'
require 'active_support/inflector'
require 'set'
module JIRA
Method maybe_nested_attribute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.maybe_nested_attribute(attributes, attribute_name, nested_under = nil)
return attributes[attribute_name] if nested_under.nil?
if nested_under.instance_of? Array
final = nested_under.inject(attributes) do |parent, key|
break if parent.nil?
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method set_attrs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def set_attrs(hash, clobber = true, target = nil)
target ||= @attrs
if clobber
target.merge!(hash)
hash
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(client, options = {})
@client = client
@attrs = options[:attrs] || {}
@expanded = options[:expanded] || false
@deleted = false
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method url
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def url
prefix = '/'
unless self.class.belongs_to_relationships.empty?
prefix = self.class.belongs_to_relationships.inject(prefix) do |prefix_so_far, relationship|
prefix_so_far.to_s + relationship.to_s + '/' + send("#{relationship}_id").to_s + '/'
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"