Showing 27 of 27 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 34 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 29 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 address
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def address(addr, phone, fax, email, uri, out)
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 clause_parse_title
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def clause_parse_title(_node, div, clause, _out, _heading_attrs = {})
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 output
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def output(isodoc_node, inname, outname, format, options = {})
Method xml2rfc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def xml2rfc(isodoc_node, inname, outname, format, options)
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_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 admonition_parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def admonition_parse(node, out)
type = node["type"]
name = admonition_name(node, type)
out.aside anchor: node["id"] do |t|
admonition_name_parse(node, t, name) if 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 date_attr
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def date_attr(date)
date.nil? and return nil
if date.length == 4 && date =~ /^\d\d\d\d$/ then { year: date }
elsif /^\d\d\d\d-?\d\d$/.match?(date)
m = /^(?<year>\d\d\d\d)-(?<month>\d\d)$/.match date
- 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_postamble
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def make_postamble(docxml)
docxml.xpath("//figure").each do |f|
a = f.at("./artwork | ./sourcecode") || next
name = f.at("./name")&.remove
b = a.xpath("./preceding-sibling::*")&.remove
- 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"