Showing 30 of 32 total issues
Class Converter
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class Converter < Standoc::Converter
def metadata_status(node, xml)
stage = node.attr("status") || node.attr("docstage") || "published"
stage = "draft" if node.attributes.has_key?("draft")
xml.status do |s|
Class PresentationXMLConvert
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
def initialize(options)
@hierarchical_assets = options[:hierarchicalassets]
super
end
Method ddMMMMYYYY
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def ddMMMMYYYY(date1, date2)
m1 = /(?<yr>\d\d\d\d)-(?<mo>\d\d)-(?<dd>\d\d)/.match date1
m2 = /(?<yr>\d\d\d\d)-(?<mo>\d\d)-(?<dd>\d\d)/.match date2
if m1 && m1[:yr] && m1[:mo] && m1[:dd]
dd1 = m1[:dd].sub(/^0/, "")
- 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 Converter
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Converter < Standoc::Converter
XML_ROOT_TAG = "itu-standard".freeze
XML_NAMESPACE = "https://www.metanorma.org/ns/itu".freeze
register_for "itu"
Method biblio_list
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def biblio_list(clause, div, biblio)
div.table class: "biblio", border: "0" do |t|
i = 0
t.tbody do |tbody|
clause.elements.each do |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 ddMMMyyyy
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def ddMMMyyyy(date)
d = date.split("-").map { |x| x.sub(/^0/, "") }
case @lang
when "zh"
d[0] += "年" if d[0]
- 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 author
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def author(xml, _out)
sector = xml.at(ns("//bibdata/ext/editorialgroup/sector"))
set(:sector, sector.text) if sector
bureau(xml)
tc = xml.at(ns("//bibdata/ext/editorialgroup/committee"))
- 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, idents, _id, _standard, datefn, _bib)
Method annex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def annex(node, out)
@meta.get[:doctype_original] == "recommendation-annex" or
page_break(out)
out.div **attr_code(id: node["id"], class: "Section3") do |s|
annex_name(node, nil, s) unless node.at(ns("./title"))
- 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)
Method authority_cleanup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def authority_cleanup(docxml)
dest = docxml.at("//div[@class = 'draft-warning']")
auth = docxml.at("//div[@id = 'draft-warning']")
dest and auth and dest.replace(auth.remove)
%w(copyright license legal).each do |t|
- 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 meeting
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def meeting(isoxml)
resolution =
isoxml.at(ns("//bibdata/ext/doctype"))&.text == "resolution"
if o = isoxml.at(ns("//bibdata/ext/meeting-date/on"))&.text
set(:meeting_date, resolution ? ddMMMMYYYY(o, nil) : ddMMMYYYY(o))
- 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 output
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def output(isodoc_node, inname, outname, format, options={})
Method hierarchical_figure_body
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def hierarchical_figure_body(num, subfignum, counter, block, klass)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(lang, script, klass, labels, options)
Method termdef_warn
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def termdef_warn(text, regex, node, term, msg)
Method make_tr_attr
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_tr_attr(tcell, row, totalrows, header, bordered)
Method style_two_regex_not_prev
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def style_two_regex_not_prev(node, text, regex, regex_prev, warning)
Method xref_init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def xref_init(lang, script, _klass, i18n, options)
Method term_defs_boilerplate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def term_defs_boilerplate(div, _source, _term, _preface, _isodoc)