Showing 65 of 369 total issues
Method push_item
has 109 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.push_item(item)
attributes = item.fetch("attributes", {})
doi = attributes.fetch("doi", nil)
return nil unless doi.present? && cached_doi_ra(doi) == "DataCite"
Method push_item
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def self.push_item(item)
attributes = item.fetch("attributes", {})
doi = attributes.fetch("doi", nil)
return nil unless doi.present? && cached_doi_ra(doi) == "DataCite"
- 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 push_item
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.push_item(item)
attributes = item.fetch("attributes", {})
doi = attributes.fetch("doi", nil)
return nil if doi.blank?
File base.rb
has 335 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "bolognese"
class Base
include Importable
include Cacheable
Method push_item
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def self.push_item(item)
attributes = item.fetch("attributes", {})
doi = attributes.fetch("doi", nil)
return nil if doi.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
Class Base
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
include Importable
include Cacheable
include ::Bolognese::MetadataUtils
Method parse_record
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_record(sqs_msg: nil, data: nil)
id = "https://doi.org/#{data['id']}"
response = get_datacite_json(id)
related_identifiers = Array.wrap(response.fetch("relatedIdentifiers",
nil)).select do |r|
Method push_item
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.push_item(item)
doi = item.fetch("DOI", nil)
return nil if doi.blank?
pid = normalize_doi(doi)
Method push_item
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.push_item(item)
attributes = item.fetch("attributes", {})
related_identifiers = Array.wrap(attributes.fetch("relatedIdentifiers",
nil))
skip_doi = related_identifiers.any? do |related_identifier|
Method push_item
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.push_item(item)
attributes = item.fetch("attributes", {})
doi = attributes.fetch("doi", nil)
return nil if doi.blank?
Method push_item
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.push_item(item)
doi = item.fetch("doi")
pid = normalize_doi(doi)
related_identifiers = item.fetch("relatedIdentifier", [])
skip_doi = related_identifiers.any? do |related_identifier|
Method push_item
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.push_item(item)
attributes = item.fetch("attributes", {})
doi = attributes.fetch("doi", nil)
return nil if doi.blank?
Method push_item
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def self.push_item(item)
attributes = item.fetch("attributes", {})
related_identifiers = Array.wrap(attributes.fetch("relatedIdentifiers",
nil))
skip_doi = related_identifiers.any? do |related_identifier|
- 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 push_item
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def self.push_item(item)
doi = item.fetch("DOI", nil)
return nil if doi.blank?
pid = normalize_doi(doi)
- 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 push_item
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.push_item(item)
attributes = item.fetch("attributes", {})
doi = attributes.fetch("doi", nil)
return nil if doi.blank?
Method push_item
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.push_item(item)
attributes = item.fetch("attributes", {})
doi = attributes.fetch("doi", nil)
return nil if doi.blank?
Method push_item
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.push_item(item)
attributes = item.fetch("attributes", {})
doi = attributes.fetch("doi", nil)
return nil if doi.blank?
Method push_item
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.push_item(item)
attributes = item.fetch("attributes", {})
doi = attributes.fetch("doi", nil)
return nil if doi.blank?
Method push_item
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.push_item(item)
doi = item.fetch("DOI", nil)
return nil if doi.blank?
pid = normalize_doi(doi)
Method push_item
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.push_item(item)
doi = item.fetch("DOI", nil)
return nil if doi.blank?
pid = normalize_doi(doi)