Showing 30 of 30 total issues
Method editor_table_entries
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def editor_table_entries(eds, ed_lbl, mail_lbl)
eds.each_with_index.with_object([]) do |(n, i), m|
mail = ""
n[:email] and
mail = "#{mail_lbl}<link target='mailto:#{n[:email]}'>" \
- 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 title_otherlangs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def title_otherlangs(node, xml)
node.attributes.each do |k, v|
/^(?:annex)?title-(?<lang>.+)$/ =~ k or next
lang == @lang and next
type = /^annex/.match?(k) ? "annex" : "main"
- 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 pub_class
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def pub_class(bib)
return 1 if bib.at("#{PUBLISHER}[abbreviation = 'ITU']")
return 1 if bib.at("#{PUBLISHER}[name = 'International " \
"Telecommunication Union']")
return 2 if bib.at("#{PUBLISHER}[abbreviation = 'ISO']")
- 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
Avoid too many return
statements within this method. Open
return 3 if bib.at("#{PUBLISHER}[name = 'International " \
Avoid too many return
statements within this method. Open
return 3 if bib.at("#{PUBLISHER}[abbreviation = 'IEC']")
Avoid too many return
statements within this method. Open
return 4 if bib.at("./docidentifier[@type][not(#{skip_docid} or " \
Method style_two_regex_not_prev
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def style_two_regex_not_prev(node, text, regex, regex_prev, warning)
text.nil? and return
arr = text.split(/\W+/)
arr.each_index do |i|
m = regex.match arr[i]
- 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 capitalise_unless_text_transform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def capitalise_unless_text_transform(elem)
css = nil
elem.traverse_topdown do |n|
n.name == "span" && /text-transform:/.match?(n["style"]) and
css = n
- 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 word_title_cleanup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def word_title_cleanup(docxml)
docxml.xpath("//p[@class = 'annex_obligation']").each do |h|
h.next_element&.name == "p" or next
h.next_element["class"] ||= "Normalaftertitle"
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"
Further reading
Method word_preface
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def word_preface(docxml)
super
abstractbox = docxml.at("//div[@id='abstractbox']")
historybox = docxml.at("//div[@id='historybox']")
sourcebox = docxml.at("//div[@id='sourcebox']")
- 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"