Showing 20 of 20 total issues
Method extract_link_data
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def extract_link_data(link_type: 'full')
lambda do |record, accumulator, _context|
return unless record.fields('856').any?
link_data_all = []
- Read upRead up
- Create a ticketCreate a ticket
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 process_subject_browse_facet
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def process_subject_browse_facet(standard_fields:, pst_fields:)
lambda do |record, accumulator|
return unless record.is_a? MARC::Record
subjects = []
- Read upRead up
- Create a ticketCreate a ticket
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 process_genre
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def process_genre(fields)
lambda do |record, accumulator|
return nil unless record.is_a? MARC::Record
genres = []
- Read upRead up
- Create a ticketCreate a ticket
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 resolve_007
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def resolve_007
[].tap do |results|
Traject::MarcExtractor.cached('007').collect_matching_lines(record) do |field, _spec, _extractor|
results << case field.value[0]
when 'g'
- Read upRead up
- Create a ticketCreate a ticket
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 each
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def each
return enum_for(:each) unless block_given?
combinable_records.each do |records_to_combine|
if records_to_combine.length == 1
- Read upRead up
- Create a ticketCreate a ticket
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 resolve_949a
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def resolve_949a
[].tap do |results|
Traject::MarcExtractor.cached('949a').collect_matching_lines(record) do |field, spec, extractor|
field_949a = extractor.collect_subfields(field, spec).first
results << 'Blu-ray' if /BLU-RAY/i.match?(field_949a)
- Read upRead up
- Create a ticketCreate a ticket
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 resolve_538a
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def resolve_538a
[].tap do |results|
Traject::MarcExtractor.cached('538a', alternate_script: false).collect_matching_lines(record) do |field, spec, extractor|
field_538a = extractor.collect_subfields(field, spec).first
results << 'Blu-ray' if field_538a&.match?(Regexp.union(/Bluray/i, /Blu-ray/i, /Blu ray/i))
- Read upRead up
- Create a ticketCreate a ticket
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 process_subject_browse_facet
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def process_subject_browse_facet(standard_fields:, pst_fields:)
lambda do |record, accumulator|
return unless record.is_a? MARC::Record
subjects = []
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
'Games/Toys' if %w[r m].include?(record.leader[6]) &&
(%w[g w].include?(record.leader[16]) ||
(record['006'] && record['006'].value[9] == 'g') ||
(record['008'] && (%w[g w].include?(record['008'].value[33]) || record['008'].value[26] == 'g')))
- Create a ticketCreate a ticket
Method units
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def units
[].tap do |collection|
unit = PeriodicalHoldings.new
record.fields(PeriodicalHoldings.tags.values).map do |field|
case field.tag
- Read upRead up
- Create a ticketCreate a ticket
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 resolve_300a
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def resolve_300a
[].tap do |results|
Traject::MarcExtractor.cached('300a', alternate_script: false).collect_matching_lines(record) do |field, spec, extractor|
field300a = extractor.collect_subfields(field, spec).first
results << 'Photo' if /photograph/i.match?(field300a)
- Read upRead up
- Create a ticketCreate a ticket
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 extract_series_title_display
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def extract_series_title_display
lambda do |record, accumulator|
index_string = []
fields = record.fields
- Read upRead up
- Create a ticketCreate a ticket
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 extract_iiif_manifest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def extract_iiif_manifest
lambda do |record, accumulator|
return unless record.fields('856').any?
record.fields('856').each do |field|
- Read upRead up
- Create a ticketCreate a ticket
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 resolve_300
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def resolve_300
[].tap do |results|
Traject::MarcExtractor.cached('300abcdefghijklmnopqrstuvwxyz', alternate_script: false)
.collect_matching_lines(record) do |field, spec, extractor|
field300 = extractor.collect_subfields(field, spec).first
- Read upRead up
- Create a ticketCreate a ticket
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 reduce_dupe_rows
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def reduce_dupe_rows(rows)
rows.reduce do |memo, rec|
next memo unless memo['access'] != rec['access']
{ 'local_id' => memo['local_id'],
- Read upRead up
- Create a ticketCreate a ticket
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 combinable_records
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def combinable_records(&block)
return enum_for(:combinable_records) unless block
# See https://github.com/jruby/jruby/issues/5275;
enumerable = if defined?(JRUBY_VERSION)
- Read upRead up
- Create a ticketCreate a ticket
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 process_subject_hierarchy
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process_subject_hierarchy(fields)
lambda do |record, accumulator|
return unless record.is_a? MARC::Record
subjects = []
- Read upRead up
- Create a ticketCreate a ticket
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 process_publication_date
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process_publication_date
lambda do |record, accumulator|
return nil unless record.is_a? MARC::Record
processor = Processors::PubDate.new
- Read upRead up
- Create a ticketCreate a ticket
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 games
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def games
'Games/Toys' if %w[r m].include?(record.leader[6]) &&
(%w[g w].include?(record.leader[16]) ||
(record['006'] && record['006'].value[9] == 'g') ||
(record['008'] && (%w[g w].include?(record['008'].value[33]) || record['008'].value[26] == 'g')))
- Read upRead up
- Create a ticketCreate a ticket
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 resolve_300b_347b
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def resolve_300b_347b
[].tap do |results|
Traject::MarcExtractor.cached('300b:347b', alternate_script: false).collect_matching_lines(record) do |field, spec, extractor|
field_300b_347b = extractor.collect_subfields(field, spec).first
results << 'MPEG-4' if /MP4/i.match?(field_300b_347b)
- Read upRead up
- Create a ticketCreate a ticket
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"