Showing 202 of 234 total issues
Method check_proxy_urls
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def check_proxy_urls(urls)
url_doc = REXML::Document.new
doc_root = url_doc.add_element "proxy_url_request", {"password"=>@proxy_password}
urls_elem = doc_root.add_element "urls"
urls.each { | link |
- 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 add_responses
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def add_responses(request, response_xml)
results = response_xml.at('map[@name ="cite_id"] map[@name="WOS"]')
unless (results)
error_message = "#{self.id}: "
- 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 raw_search_title
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def raw_search_title(rft)
# Just make one call to create metadata hash
metadata = rft.metadata
title = nil
if rft.format == 'journal' && metadata['atitle']
- 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 journal_search
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def journal_search
@batch_size = batch_size
@start_result_num = (page * batch_size) - (batch_size - 1)
@search_context_object = context_object_from_params
if (! params["rft.object_id"].blank? ||
- 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 create_new_request!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def self.create_new_request!( args )
# all of these are required
params = args[:params]
session = args[:session]
- 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 roll_up_responses
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def roll_up_responses(list, options = {})
options = options.reverse_merge(:coverage_sensitive => true)
prefixes = @roll_up_prefixes
- 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 create_fulltext_service_response
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_fulltext_service_response(request, items)
return nil if items.empty?
count = 0
- 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_web_links
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def do_web_links(request, data)
# some noview items will have a snippet view, but we have no way to tell
info_views = find_entries(data, ViewPartialValue)
viewability = ViewPartialValue
Method edition_statement
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def edition_statement(marc, options = {})
options[:include_repro_info] ||= true
options[:exclude_533_fields] = ['7','f','b', 'e']
parts = Array.new
Method nature_of_contents
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def nature_of_contents(marc)
types = {'m'=>'dissertation','t'=>'report','j'=>'patent'}
idx = nil
if self.record_type(marc) == 'BKS'
idx = 24
Method handle
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle(request)
ids = {
:isbn => request.referent.isbn,
:oclc => request.referent.oclcnum,
:lccn => request.referent.lccn
Method preempted_by
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def preempted_by(uml_request, for_type_generated=nil)
preempted_by = @preempted_by
return false if preempted_by.nil?
preempted_by = [preempted_by] unless preempted_by.kind_of?(Array)
preemption = nil
Method determine_coverage_boundaries
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def determine_coverage_boundaries(target)
# machine actionable coverage elements, used for collapsing
if (in_node = target.at_xpath("./coverage/in"))
year = in_node.at_xpath("year").try(:text).try(:to_i)
if year && year != 0
Method journal_search
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def journal_search
@batch_size = batch_size
@start_result_num = (page * batch_size) - (batch_size - 1)
@search_context_object = context_object_from_params
if (! params["rft.object_id"].blank? ||
Method handle
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle(request)
unless ( sufficient_metadata?(request.referent))
return request.dispatched(self, true)
end
Method list_with_limit
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def list_with_limit(id, list, options = {}, &block)
# backwards compatible to when third argument was just a number
# for limit.
options = {:limit => options} unless options.kind_of?(Hash)
options[:limit] ||= 5
- 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 sfx4_db_to_ctxobj
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def sfx4_db_to_ctxobj(title_rows)
title_rows.collect do |sfx_obj|
ctx = OpenURL::ContextObject.new
# Start out wtih everything in search, to preserve date/vol/etc
ctx.import_context_object( context_object_from_params )
- 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 filter
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def filter(referent)
issn = get_identifier(:urn, "issn", referent)
return unless issn
# normalize removing hyphen
- 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 should_skip_menu
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def should_skip_menu
# From usabilty test, do NOT skip if coming from A-Z list/journal lookup.
# First, is it over-ridden in url?
if ( params['umlaut.skip_resolve_menu'] == 'false')
return nil
Method brief_citation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def brief_citation(request, options = {})
options[:include_labels] ||= false
rv =""
cite = request.referent.to_citation
title = truncate(cite[:title].strip, :length => 70, :separator => ' ')