Showing 70 of 112 total issues
Method quote_attribution
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def quote_attribution(node, out)
author = node.at(ns("./author"))
source = node.at(ns("./source"))
return if author.nil? && source.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"
Further reading
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 preface_move1
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def preface_move1(clause, preface, float, prev, xpath)
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
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_tr_attr(cell, row, totalrows, header, bordered)
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 hierarchical_permission_body
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def hierarchical_permission_body(id, block, label, klass, model)
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 make_tr_attr
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_tr_attr(cell, row, totalrows, header, bordered)
Method anchor_struct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def anchor_struct(lbl, container, elem, type, unnumb = false)
Method xref_init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def xref_init(lang, script, _klass, i18n, options)
Method clause_parse_title
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def clause_parse_title(node, div, title, out, header_class = {})
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(lang, script, klass, i18n, 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, locale, i18n, fonts_options = {})
Method tr_parse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def tr_parse(node, out, ord, totalrows, header)
Method sequential_permission_body
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def sequential_permission_body(id, elem, label, klass, model, container: false)
Method clause_parse_title1
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def clause_parse_title1(node, div, title, _out, header_class = {})
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}"))
(node.children.empty? and node.add_child("<#{elem}></#{elem}>")) or
node.children.first.previous = "<#{elem}></#{elem}>"
- 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"