Showing 13 of 15 total issues
Class PresentationXMLConvert
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
def convert1(docxml, filename, dir)
@jcgm = docxml&.at(ns("//bibdata/ext/editorialgroup/committee/" \
"@acronym"))&.value == "JCGM"
@xrefs.klass.jcgm = @jcgm
Class Xref
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Xref < IsoDoc::Xref
attr_accessor :jcgm
def initialize(lang, script, klass, i18n, options = {})
@iso = IsoDoc::Iso::Xref.new(lang, script, klass, i18n, options)
Method norm_ref_entry_code
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def norm_ref_entry_code(_ordinal, identifiers, _ids, _standard, datefn,
_bib)
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 annex_anchor_names
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def annex_anchor_names(docxml)
n = @jcgm ? Counter.new("@", skip_i: true) : Counter.new(0)
clause_order_annex(docxml).each_with_index do |a, i|
docxml.xpath(ns(a[:path])).each do |c|
if i.zero?
- 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 xref_init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def xref_init(lang, script, _klass, labels, options)
Method output
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def output(isodoc_node, inname, outname, format, options = {})
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(lang, script, klass, i18n, options = {})
Method main_anchor_names
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def main_anchor_names(xml)
@jcgm and return super
t = clause_order_main(xml)
n = Counter.new
t.each_with_index do |a, 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 prefix_name
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def prefix_name(node, delim, number, elem)
number.nil? || number.empty? and return
unless name = node.at(ns("./#{elem}[not(@type = 'quoted')]"))
node.at(ns("./#{elem}[@type = 'quoted']")) and return
(node.children.empty? and node.add_child("<#{elem}></#{elem}>")) 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
Method extract_indexterms
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def extract_indexterms(terms)
terms.each_with_object({}) do |t, v|
term = to_xml(t.at(ns("./primary"))&.children)
term2 = to_xml(t.at(ns("./secondary"))&.children)
term3 = to_xml(t.at(ns("./tertiary"))&.children)
- 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 metadata_committee
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def metadata_committee(node, xml)
return unless node.attr("committee-en") || node.attr("committee-fr")
xml.editorialgroup do |a|
metadata_committee1(node, a)
- 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 sequential_formula_names
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def sequential_formula_names(clause, container: false)
c = Counter.new
clause.xpath(ns(".//formula")).noblank.each do |t|
@anchors[t["id"]] = anchor_struct(
c.increment(t).print, container ? t : 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"