lib/isodoc/bipm/presentation_xml_convert.rb
Class PresentationXMLConvert
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
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
Method norm_ref_entry_code
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
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
Open
def biblio_ref_entry_code(ordinal, ids, _id, _standard, datefn, _bib)
Method prefix_name
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
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"