Showing 70 of 112 total issues
Method parse
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(node, out)
if node.text? then text_parse(node, out)
else
case node.name
when "em" then em_parse(node, out)
Class PresentationXMLConvert
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class PresentationXMLConvert < ::IsoDoc::Convert
def middle_title(docxml)
s = docxml.at(ns("//sections")) or return
t = @meta.get[:doctitle]
t.nil? || t.empty? and return
Class PresentationXMLConvert
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class PresentationXMLConvert < ::IsoDoc::Convert
def non_locality_elems(node)
node.children.reject do |c|
%w{locality localityStack location}.include? c.name
end
Class Metadata
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Metadata
attr_accessor :fonts_options, :labels
def ns(xpath)
Common::ns(xpath)
Class PresentationXMLConvert
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class PresentationXMLConvert < ::IsoDoc::Convert
def lower2cap(text)
/^[[:upper:]][[:upper:]]/.match?(text) and return text
text.capitalize
end
Class PresentationXMLConvert
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class PresentationXMLConvert < ::IsoDoc::Convert
def designation(docxml)
docxml.xpath(ns("//term")).each { |t| merge_second_preferred(t) }
docxml.xpath(ns("//preferred | //admitted | //deprecates"))
.each { |p| designation1(p) }
Class PresentationXMLConvert
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
class PresentationXMLConvert < ::IsoDoc::Convert
def citeas(xmldoc)
xmldoc.xpath(ns("//eref | //origin | //quote/source")).each do |e|
e["bibitemid"] && e["citeas"] or next
a = @xrefs.anchor(e["bibitemid"], :xref, false) and e["citeas"] = a
Class PresentationXMLConvert
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class PresentationXMLConvert < ::IsoDoc::Convert
def references(docxml)
bibliography_bibitem_number(docxml)
renderings = references_render(docxml)
docxml.xpath(ns("//references/bibitem")).each do |x|
Method biblio_list
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def biblio_list(refs, div, biblio)
i = 0
refs.children.each do |b|
if b.name == "bibitem"
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 top_element_render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def top_element_render(e, out)
case e.name
when "abstract" then abstract e, out
when "foreword" then foreword e, out
when "introduction" then introduction e, out
- 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 new_subseq_increment1
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def new_subseq_increment1(node)
/^(?<b>.*?)(?<n>\d*)(?<a>[a-zA-Z]*)$/ =~ node["number"]
if !n.empty? || !a.empty?
@letter_override = @letter = a unless a.empty?
@number_override = @num = n.to_i unless n.empty?
- 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 scss_fontheader
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def scss_fontheader(is_html_css)
b = options[:bodyfont] || "Arial"
h = options[:headerfont] || "Arial"
m = options[:monospacefont] || "Courier New"
ns = options[:normalfontsize] || (is_html_css ? "1.0em" : "12.0pt")
- 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_tr_attr
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def make_tr_attr(cell, row, totalrows, header, bordered)
style = cell.name == "th" ? "font-weight:bold;" : ""
cell["align"] and style += "text-align:#{cell['align']};"
cell["valign"] and style += "vertical-align:#{cell['valign']};"
rowmax = cell["rowspan"] ? row + cell["rowspan"].to_i - 1 : row
- 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 norm_ref
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def norm_ref(node, out)
node["hidden"] != "true" or return
out.div do |div|
clause_name(node, node.at(ns("./title")), div, nil)
if node.name == "clause"
- 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_ref_entry_code
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def biblio_ref_entry_code(ordinal, ids, _id, _standard, datefn, _bib)
Method anchor_linkend
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def anchor_linkend(node, linkend)
node["style"] == "id" and
return anchor_id_postproc(node)
node["citeas"].nil? && node["bibitemid"] and
return @xrefs.anchor(node["bibitemid"], :xref) || "???"
- 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_attribution
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def quote_attribution(node, out)
author = node.at(ns("./author"))
source = node.at(ns("./source"))
return if author.nil? && source.nil?
- 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_remove_pb_before_annex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def word_remove_pb_before_annex(docxml)
docxml.xpath("//div[p/br]").each do |d|
/^WordSection\d+_\d+$/.match(d["class"]) or next
(d.elements[0].name == "p" && !d.elements[0].elements.empty?) or next
(d.elements[0].elements[0].name == "br" &&
- 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 preface_move1
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def preface_move1(clause, preface, float, prev, xpath)
preface.elements.each do |x|
((x.name == "floating-title" || x.at(xpath)) &&
xpath != "./self::*[not(following-sibling::*)]") or prev = x
# after.include?(x.name) or next
- 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 norm_ref_entry_code
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def norm_ref_entry_code(_ordinal, idents, _ids, _standard, datefn, _bib)