lib/isodoc/function/to_word_html.rb
Method parse
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def parse(node, out)
if node.text? then text_parse(node, out)
else
case node.name
when "em" then em_parse(node, out)
Method top_element_render
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
def top_element_render(e, out)
case e.name
when "abstract" then abstract e, out
when "foreword" then foreword e, out
when "introduction" then introduction e, out
- 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 boilerplate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def boilerplate(node, out)
@bare and return
boilerplate = node.at(ns("//boilerplate")) or return
out.div class: "authority" do |s|
boilerplate.children.each do |n|
- 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"