Showing 6 of 6 total issues
Class Parser
has 48 methods (exceeds 20 allowed). Consider refactoring. Open
class Parser
COUNTRIES = %w[USA].freeze
TYPES = {
"book-chapter" => "inbook",
File parser.rb
has 409 lines of code (exceeds 250 allowed). Consider refactoring. Open
module RelatonDoi
class Parser
COUNTRIES = %w[USA].freeze
TYPES = {
Method parse_place
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parse_place # rubocop:disable Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize
pub_location = @src["publisher-location"] || fetch_location
return [] unless pub_location
pls1, pls2 = pub_location.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 get_by_id
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_by_id(id) # rubocop:disable Metrics/AbcSize,Metrics/MethodLength
# resp = Serrano.works ids: id
n = 0
url = "https://api.crossref.org/works/#{CGI.escape(id)}"
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 parse_series
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse_series # rubocop:disable Metrics/AbcSize, Metrics/MethodLength, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
types = %w[inbook incollection inproceedings]
return [] if !@src["container-title"] || types.include?(@item[:type]) || @src["type"] == "report-component"
con_ttl = if main_sub_titles.any? || project_titles.any?
- 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 parse_link
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_link # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity
disprefered_links = %w[similarity-checking text-mining]
links = []
if @src["URL"]
links << RelatonBib::TypedUri.new(type: "DOI", content: @src["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"