Showing 14 of 14 total issues
Method enumerate_uris
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def enumerate_uris
Enumerator.new do |yielder|
# For each of the sets
opts[:uris].each do |uri|
loop do
- 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 enumerate_records
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
def enumerate_records(identifiers)
batch = []
# get meta.xml for each identifier in the batch
identifiers.each do |id|
meta_uri = "#{DOWNLOAD_BASE_URI}/#{id}/#{id}_meta.xml"
Method enumerate_records
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def enumerate_records
Enumerator.new do |en|
request_opts = opts.deep_dup
@id_source.batches.each do |ids|
request_opts['params']['naIds'] = ids.join(',')
- 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 record_ids
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def record_ids
Enumerator.new do |en|
cursor = nil
loop do
cursor_param = cursor ? "&cursor=#{cursor}" : ''
- 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 enumerate_records
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def enumerate_records(identifiers)
batch = []
# get meta.xml for each identifier in the batch
identifiers.each do |id|
meta_uri = "#{DOWNLOAD_BASE_URI}/#{id}/#{id}_meta.xml"
- 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 language
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def language(opts)
genres = []
return genres unless language_material?(opts[:leader])
- 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 enumerate_records
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def enumerate_records
Enumerator.new do |en|
request_opts = opts.deep_dup
@id_source.batches.each do |ids|
request_opts['params']['naIds'] = ids.join(',')
Method initialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(uri, threads, max_records, record_class,
id_minter, harvester_name)
Method records
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def records
Enumerator.new do |en|
list_collections.each do |collection_uuid|
page_count = collection_page_count(collection_uuid, @opts[:batchsize])
- 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 each_collection
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def each_collection
Dir.open(uri).each do |path|
next unless path =~ /\.xml(\.gz)?/i
File.open(File.join(uri, path)) do |fh|
- 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 enumerate_records
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def enumerate_records
Enumerator.new do |yielder|
enumerate_uris.lazy.each_slice(opts[:threads]).each do |uris|
batch = []
- 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 projected
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def projected(opts)
return [] unless projected_medium?(opts[:leader])
opts[:cf_007].each_with_object([]) do |cf, genres|
if slide?(cf) || transparency?(cf)
- 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 enrich_value
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def enrich_value(value)
if value.is_a? String
return nil if is_placeholder? value
elsif value.respond_to?(:providedLabel)
return nil if value.providedLabel.find { |l| !is_placeholder?(l) }.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 name_tag_condition
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def name_tag_condition(name, tag)
lambda do |node|
return false unless node.name == name
tag.is_a?(Regexp) ? (node[:tag] =~ tag) : (node[:tag] == tag)
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"