Showing 13 of 22 total issues
Class Converter
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Converter < ISO::Converter
def org_abbrev
super.merge("Japanese Industrial Standards" => "JIS")
end
Class PresentationXMLConvert
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class PresentationXMLConvert < IsoDoc::Iso::PresentationXMLConvert
def inline(docxml)
super
strong(docxml)
end
Method list2para_style
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def list2para_style(listtype, depth)
case listtype
when "ol"
ret = case depth
when "1" then "margin-left: 36.0pt;"
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 class: "normref_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 make_tr_attr_style
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_tr_attr_style(cell, row, rowmax, totalrows, opt)
Method list_item_anchor_names
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def list_item_anchor_names(list, list_anchor, depth, prev_label,
refer_list)
Method xref_init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def xref_init(lang, script, _klass, labels, options)
Method make_tr_attr
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_tr_attr(cell, row, totalrows, header, bordered)
Method output
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def output(xml, inname, outname, format, options = {})
Method make_tr_attr_style
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def make_tr_attr_style(cell, row, rowmax, totalrows, opt)
top = row.zero? ? "#{SW1} 1.5pt;" : "none;"
bottom = "#{SW1} #{rowmax >= totalrows ? '1.5' : '1.0'}pt;"
ret = <<~STYLE.gsub(/\n/, "")
border-top:#{top}mso-border-top-alt:#{top}
- 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 list_item_anchor_names
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def list_item_anchor_names(list, list_anchor, depth, prev_label,
refer_list)
c = Counter.new(list["start"] ? list["start"].to_i - 1 : 0)
list.xpath(ns("./li")).each do |li|
bare_label, label =
- 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 back_clauses_anchor_names
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def back_clauses_anchor_names(xml)
clause_order_back(xml).each do |a|
xml.xpath(ns(a[:path])).each do |c|
if c["commentary"] == "true" then commentary_names(c)
else preface_names(c)
- 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 organization
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def organization(xml, org, node = nil, default_org = nil)
org.is_a?(Hash) && org[:name] or org = { name: org }
abbrevs = org_abbrev
name_str = org[:name].is_a?(Hash) ? org[:name]["en"] : org[:name]
n = abbrevs.invert[org[:name]] and org = { name: n, abbr: org[: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"