Showing 202 of 234 total issues
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 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_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 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_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 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 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 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 xml_to_holdings
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def xml_to_holdings(xml)
data = {}
data[:call_number] = xml_choose_first(xml,
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 )
Method handle
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def handle(request)
unless ( sufficient_metadata?(request.referent))
return request.dispatched(self, true)
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 find_by_title
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def find_by_title
ctx = context_object_from_params
search_results = []
sfx_url = umlaut_config.sfx_base_url
- 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 dispatch_background!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def dispatch_background!
# Now we do some crazy magic, start a Thread to run our background
# services. We are NOT going to wait for this thread to join,
# we're going to let it keep doing it's thing in the background after
# we return a response to the browser
- 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"