Showing 236 of 236 total issues
Method get_data
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_data(request)
ids = get_identifiers(request.referent)
return nil if ids.blank?
ol_keys = do_id_query(ids)
return nil if ol_keys.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 handle
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def handle(request)
ids = {
:isbn => request.referent.isbn,
:oclc => request.referent.oclcnum,
:lccn => request.referent.lccn
- 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_parameters
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_parameters(rft)
# API supports oclcnum, isbn, or lccn, and can provide more than one of each.
get_bibkey_parameters(rft) do |isbn, lccn, oclcnum|
keys = Array.new
- 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_copies
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_copies(request, bib_array, options = {})
#debugger
# default
options[:match_reliability] ||= ServiceResponse::MatchExact
Function success
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
success: function(umlaut_response) {
for (var i = 0; i < myself.section_targets.length; i++) {
var section_target = myself.section_targets[i];
var umlaut_html_section = myself.find_umlaut_response_section(umlaut_response, section_target.umlaut_section_id);
Method parse_perl_data
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.parse_perl_data(doc)
co = OpenURL::ContextObject.new
co.referent.set_format('journal') # default
Method gen_lamr_request
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def gen_lamr_request(request)
output = ""
builder = Builder::XmlMarkup.new(:target => output, :indent => 2)
builder.instruct!(:xml, :encoding => "UTF-8")
Method illiad_query_parameters
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def illiad_query_parameters(request)
metadata = request.referent.metadata
qp = {}
Method blacklight_keyword_search_url
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def blacklight_keyword_search_url(request, options = {})
options[:format] ||= "atom"
options[:content_format] ||= "marc"
clauses = []
- 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 scopus_search
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def scopus_search(request)
if (doi = get_doi(request.referent))
return CGI.escape( "DOI(#{phrase(doi)})" )
elsif (pmid = get_pmid(request.referent))
- 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 find_or_create
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def self.find_or_create(params, session, a_rails_request, options = {} )
# Pull out the http params that are for the context object,
- 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 scopus_query
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def scopus_query(request)
if (doi = get_doi(request.referent))
return "DOI(#{phrase(doi)})"
elsif (pmid = get_pmid(request.referent))
- 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 check_holdings
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def check_holdings(holdings, request)
return if holdings.empty?
# These need to moved to services.yml
electronic_locations = ['INTERNET', 'NETLIBRARY', 'GALILEO']
holdings.each do | holding |
Method define_query
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def define_query(rft)
oclcnum = get_identifier(:info, "oclcnum", rft)
metadata = rft.metadata
# Do we have enough info to do a query with sufficient precision?
Method check_proxy_urls
has 34 lines of code (exceeds 25 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 |
Method add_responses
has 34 lines of code (exceeds 25 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}: "
Method create_partial_volume_responses
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_partial_volume_responses(request, ht_json)
items = ht_json.values.first["items"]
full_ids = items.collect do |i|
i["fromRecord"] if (is_serial_part?(i) && full_view?(i))
end.compact.uniq
Method roll_up_responses
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def roll_up_responses(list, options = {})
options = options.reverse_merge(:coverage_sensitive => true)
prefixes = @roll_up_prefixes
Method create_new_request!
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.create_new_request!( args )
# all of these are required
params = args[:params]
session = args[:session]
Method add_holdings
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_holdings(holdings_url, options = {})
options[:match_reliability] ||= ServiceResponse::MatchExact
options[:marc_data] ||= {}
atom = Nokogiri::XML( http_fetch(holdings_url).body )