Showing 202 of 234 total issues
Method add_asin_service_responses
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_asin_service_responses(request, asin, item_url)
# we want to highlight Amazon to link to 'search in this book', etc.
if asin
# Search or Look inside the book offered? We only know by trying and
# then screen-scraping.
Function update
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.update = function() {
// Need to capture because we won't have 'this' inside the ajax
// success handler.
var myself = this;
var dataType = this.is_remote_url( this.umlaut_uri ) ? "jsonp" : "json";
Method included
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.included(klass)
klass.class_eval do
self.table_name = 'AZ_TITLE'
self.primary_key = 'AZ_TITLE_ID'
Method handle
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle(request)
scopus_search = scopus_search(request)
# we can't make a good query, nevermind.
return request.dispatched(self, true) if scopus_search.blank?
Method add_856_links
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_856_links(request, marc_records, options = {})
options[:default_service_type] ||= "fulltext"
options[:match_reliability] ||= ServiceResponse::MatchExact
responses_added = Hash.new
Method define_query
has a Cognitive Complexity of 15 (exceeds 5 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?
- 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_identifier
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_identifier(type, sub_scheme, referent, options = {} )
options[:multiple] ||= false
raise Exception.new("type must be :urn or :info") unless type == :urn or type == :info
- 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 enhance_referent
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def enhance_referent(request, data)
entry = data["items"].first
- 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 excluded?
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def excluded?(url)
return false if @exclude.blank?
@exclude.each do |entry|
if ((entry[0,1] == '/') && (entry[entry.length()-1 ,1 ] == '/'))
- 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 15 (exceeds 5 allowed). Consider refactoring. Open
def handle(request)
isbn = get_identifier(:urn, "isbn", request.referent)
issn = get_identifier(:urn, "issn", request.referent)
oclcnum = get_identifier(:info, "oclcnum", 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 nature_of_contents
has a Cognitive Complexity of 15 (exceeds 5 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
- 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 fetch_urls
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def fetch_urls
# Crazy crazy URLs to try to find PARSE_PARAMS in Sfx4 db that have a period in
# them, so they look like they might be URLs. Parse params could be at target service
# level, or at portfolio level; and could be in local overrides or in global kb.
# This is crazy crazy SQL to get this, sorry. Talking directly to SFX db isn't
Method enhance_referent
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def enhance_referent(key, value, metadata=true, private_data=false, options = {})
ActiveRecord::Base.connection_pool.with_connection do
return if value.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 find_by_title
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def find_by_title
connection = sfx4_db_connection
query_match_clause = case search_type_param
when "contains"
terms = title_query_param.split(" ")
- 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 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle(request)
ids_processed = []
holdings_added = 0
if (@identifier_search && url = blacklight_precise_search_url(request) )
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)
bibkeys = get_bibkeys(request.referent)
return request.dispatched(self, true) if bibkeys.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 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