Showing 29 of 29 total issues
Method xref_check
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def xref_check(xml)
ret = []
xml.xpath("//xref | //relref").each do |x|
t = xml.at(".//*[@anchor = '#{x['target']}']") ||
xml.at(".//*[@pn = '#{x['target']}']") or
- 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 RfcConvert
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class RfcConvert < ::IsoDoc::Convert
def para_attrs(node)
{ keepWithNext: node["keep-with-next"],
keepWithPrevious: node["keep-with-previous"],
indent: node["indent"],
Class RfcConvert
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class RfcConvert < ::IsoDoc::Convert
def em_parse(node, out)
out.em do |e|
node.children.each { |n| parse(n, e) }
end
Class RfcConvert
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class RfcConvert < ::IsoDoc::Convert
def make_front(out, isoxml)
info(isoxml, out)
out.front do |front|
title isoxml, front
Method xref_check
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def xref_check(xml)
ret = []
xml.xpath("//xref | //relref").each do |x|
t = xml.at(".//*[@anchor = '#{x['target']}']") ||
xml.at(".//*[@pn = '#{x['target']}']") or
Method common_rfc_pis
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def common_rfc_pis(node)
rfc_pis = {
artworkdelimiter: node.at(ns("//pi/artworkdelimiter"))&.text,
artworklines: node.at(ns("//pi/artworklines"))&.text,
authorship: node.at(ns("//pi/authorship"))&.text,
Method set_pi
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_pi(node, pi)
rfc_pis = {
artworkdelimiter: node.attr("artworkdelimiter"),
artworklines: node.attr("artworklines"),
authorship: node.attr("authorship"),
Method rfc_attributes
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rfc_attributes(docxml)
# t = Time.now.getutc
obs = xpath_comma(docxml
.xpath(ns("//bibdata/relation[@type = 'obsoletes']/bibitem/docidentifier[not(@scope)]")))
upd = xpath_comma(docxml
Method termnote_anchor_names
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def termnote_anchor_names(docxml)
docxml.xpath(ns("//term[descendant::termnote]")).each do |t|
c = IsoDoc::XrefGen::Counter.new
notes = t.xpath(ns("./termnote"))
notes.each do |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 biblio_list
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def biblio_list(node, div, _biblio)
i = 0
node.xpath(ns("./bibitem | ./note")).each do |b|
next if implicit_reference(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 address
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def address(addr, phone, fax, email, uri, out)
Method u_cleanup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def u_cleanup(xmldoc)
xmldoc.traverse do |n|
next unless n.text?
next unless %w(t blockquote li dd preamble td th annotation)
.include? n.parent.name
- 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 xml2rfc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def xml2rfc(isodoc_node, inname, outname, format, options)
Method clause_parse_title
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def clause_parse_title(_node, div, clause, _out, _heading_attrs = {})
Method output
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def output(isodoc_node, inname, outname, format, options = {})
Method xref_init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def xref_init(lang, script, klass, i18n, options)
Method tr_parse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def tr_parse(node, out, ord, totalrows, header)
Method make_generic_footnote_text
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def make_generic_footnote_text(node, fnref)
first = node.first_element_child
noko do |xml|
xml.fn do |_div|
xml.t **attr_code(anchor: first ? first["id"] : nil) do |div|
- 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 para_parse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def para_parse(node, out)
out.t **attr_code(para_attrs(node)) do |p|
unless @termdomain.empty?
p << "<#{@termdomain}> "
@termdomain = ""
- 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 make_table_footnote_text
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def make_table_footnote_text(node, _fnid, fnref)
first = node.first_element_child
noko do |xml|
xml.t **attr_code(anchor: first ? first["id"] : nil) do |div|
div << "[#{fnref}] "
- 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"