Showing 50 of 82 total issues
Method xref_init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def xref_init(lang, script, _klass, i18n, options)
Method clause_parse_title1
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def clause_parse_title1(node, div, title, _out, header_class = {})
Method tr_parse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def tr_parse(node, out, ord, totalrows, header)
Method anchor_struct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def anchor_struct(lbl, container, elem, type, unnumb = false)
Method preface_move1
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def preface_move1(clause, preface, float, prev, xpath)
Method make_tr_attr
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_tr_attr(cell, row, totalrows, header, bordered)
Method swap_renderer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def swap_renderer(oldklass, newklass, file, input_filename, debug)
Method make_tr_attr_style
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_tr_attr_style(row, rowmax, totalrows, _header, bordered)
Method case_with_markup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def case_with_markup(linkend, casing, script, firstonly: true)
seen = false
xml = Nokogiri::XML("<root>#{linkend}</root>")
xml.traverse do |b|
next unless b.text? && !seen
- 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 para_parse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def para_parse(node, out)
out.p **attr_code(para_attrs(node)) do |p|
unless @termdomain.empty?
p << "<#{@termdomain}> "
@termdomain = ""
- 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 trim_hash1
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def trim_hash1(hash)
hash.is_a?(Hash) or return hash
hash.each_with_object({}) do |(k, v), g|
blank?(v) and next
g[k] = case v
- 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 subsequence_increment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def subsequence_increment(node)
return increment_letter unless node["number"]
@base = ""
@letter_override = node["number"]
- 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 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
Avoid too many return
statements within this method. Open
return :roman if [3, 8].include? depth
Avoid too many return
statements within this method. Open
n = node["class"] and return n
Avoid too many return
statements within this method. Open
return :roman_upper if [5, 10].include? depth
Method localpath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def localpath(path)
return path if %r{^[A-Z]:|^/|^file:/}.match?(path)
return path unless (@sourcedir || @localdir) && path
File.expand_path(File.join((@sourcedir || @localdir), path))
- 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 example_table_parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def example_table_parse(node, out)
out.table **example_table_attr(node) do |t|
t.tr do |tr|
tr.td **EXAMPLE_TBL_ATTR do |td|
example_label(node, td, node.at(ns("./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"
Further reading
Method anchor_struct
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def anchor_struct(lbl, container, elem, type, unnumb = false)
ret = {}
ret[:label] = unnumb == "true" ? nil : anchor_struct_label(lbl, elem)
ret[:xref] = anchor_struct_xref(unnumb == "true" ? "(??)" : lbl, elem)
ret[:xref].gsub!(/ $/, "")
- 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 agency1
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def agency1(xml)
agency = ""
publisher = []
xml.xpath(ns("//bibdata/contributor[xmlns:role/@type = 'publisher']/" \
"organization")).each do |org|
- 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"