Showing 65 of 82 total issues
Method inline_anchor_xref
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def inline_anchor_xref(node)
text = node.text
if text =~ /^\S+ (of|comma|parens|bare)\b/
# <<crossreference#fragment,section (of|comma|parens|bare): text>> = relref
matched = /(?<section>\S+)\s+(?<format>[a-z]+)(: )?(?<text>.*)$/.match node.text
- 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 admonition
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def admonition(node)
result = []
if node.parent.context == :preamble
note_attributes = {
# default title provided: title is mandatory
- 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 inline_anchor_xref
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def inline_anchor_xref(node)
text = node.text
if text =~ /^\S+ (of|comma|parens|bare)\b/
# <<crossreference#fragment,section (of|comma|parens|bare): text>> = relref
matched = /(?<section>\S+)\s+(?<format>[a-z]+)(: )?(?<text>.*)$/.match node.text
Method olist
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def olist(node)
result = []
result << noko do |xml|
type = OLIST_TYPES[node.style.to_sym]
Method cleanup
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cleanup(doc)
xmldoc = Nokogiri::XML(doc) do |config|
config.noent
end
Method admonition
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def admonition(node)
result = []
if node.parent.context == :preamble
note_attributes = {
removeInRFC: node.attr("remove-in-rfc"),
Method example
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def example(node)
figure_attributes = {
anchor: node.id,
align: node.attr("align"),
alt: node.alt,
Method dlist_naked
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dlist_naked(node, xml)
style = "hanging"
style = "empty" if node.attr("style") == "empty"
list_attributes = {
hangIndent: node.attr("hang-indent"),
Method example
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def example(node)
figure_attributes = {
anchor: node.id,
align: node.attr("align"),
alt: node.alt,
- 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 inline_quoted
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def inline_quoted(node)
noko do |xml|
case node.type
when :emphasis then xml.em node.text
when :strong
Method inline_quoted
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def inline_quoted(node)
noko do |xml|
case node.type
when :emphasis
xml.spanx node.text, style: "emph"
Method section
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def section(node)
if node.attr("style") == "bibliography" ||
node.parent.context == :section && node.parent.attr("style") == "bibliography"
result = ref_section(node)
else
Method ulist
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ulist(node)
result = []
result << noko do |xml|
ul_attributes = {
Method link
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def link(node)
result = []
result << noko do |xml|
links = (node.attr("link") || "").split(/,\s*/)
links.each do |link|
- 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 cleanup
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def cleanup(doc)
xmldoc = Nokogiri::XML(doc)
crefs = xmldoc.xpath("//cref")
# any crefs that are direct children of section should become children of the preceding
# paragraph, if it exists; otherwise, they need to be wrapped in a paragraph
- 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 extract_entities
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def extract_entities(node, xmldoc)
refs = xmldoc.xpath("//reference")
ret = []
biblio = cache_biblio(node)
refs.each do |ref|
- 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 quote
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def quote(node)
result = []
if node.blocks?
node.blocks.each do |b|
result << send(b.context, b)
- 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 current_location
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def current_location(node)
return "Line #{node.lineno}" if node.respond_to?(:lineno) && !node.lineno.nil? && !node.lineno.empty?
return "ID #{node.id}" if node.respond_to?(:id) && !node.id.nil?
while !node.nil? && (!node.respond_to?(:level) || node.level > 0) && node.context != :section
node = node.parent
- 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 workgroup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def workgroup(node, xml)
workgroups = cache_workgroup(node)
node.attr("workgroup")&.split(/, ?/)&.each do |wg|
if wg =~ / (Working Group)$/i
warn %(asciidoctor: WARNING (#{current_location(node)}): suffix "Working Group" will be stripped in published RFC from #{wg})
- 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 olist_naked
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def olist_naked(node, xml)
style = OLIST_TYPES[node.style.to_sym]
style = "empty" if node.attr("style") == "empty"
style = "format #{node.attr('format')}" unless node.attr("format").nil?
list_attributes = {
- 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"