Showing 202 of 234 total issues
Method sort_boosted_responses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sort_boosted_responses(list)
return list unless @boost_targets.present?
preferred = []
other_targets = list
- 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 parse_for_fulltext_links
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_for_fulltext_links(marc, request)
eight_fifty_sixes = []
marc.find_all { | f| '856' === f.tag}.each do | link |
eight_fifty_sixes << link
end
- 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 section_title
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def section_title
section_title = nil
if @options.has_key? :section_title
# deprecation warning? Not sure the right way to do that.
- 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 do_truncate_to_db_limit!
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def do_truncate_to_db_limit!
self.class._truncate_to_db_limit_attributes.each do |attribute_name|
- 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 sort_sunk_responses
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sort_sunk_responses(list)
return list unless @sink_targets.present?
sunk = []
other_targets = list
- 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 is_conference?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def is_conference?(marc)
# Check the leader/008 for books and serials
return true if marc['008'].value[29,1] == '1' && marc.leader[6,1].match(/[at]/) && marc.leader[7,1].match(/[abcdms]/)
# Check the leader/008 for scores and recordings
return true if marc['008'].value[30,2] == 'c' && marc.leader[6,1].match(/[cdij]/) && marc.leader[7,1].match(/[abcdms]/)
- 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
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return request.dispatched(self, DispatchedService::FailedFatal, e)
Avoid too many return
statements within this method. Open
return request.dispatched(self, true)
Avoid too many return
statements within this method. Open
return false
Avoid too many return
statements within this method. Open
return options[:default_service_type]
Avoid too many return
statements within this method. Open
return request.dispatched(self, true)
Avoid too many return
statements within this method. Open
return "highlighted_link"
Avoid too many return
statements within this method. Open
return request.dispatched(self, true)
Avoid too many return
statements within this method. Open
return request.dispatched(self, true)
Avoid too many return
statements within this method. Open
return request.dispatched(self, DispatchedService::FailedFatal, e)
Avoid too many return
statements within this method. Open
return nil
Avoid too many return
statements within this method. Open
return false
Method get_identifiers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get_identifiers(rft)
isbn = get_identifier(:urn, "isbn", rft)
oclcnum = get_identifier(:info, "oclcnum", rft)
lccn = get_identifier(:info, "lccn", rft)
- 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 get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def get(path, headers=nil, &block)
limit = 6
tries = 0
response = 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"