Showing 115 of 121 total issues
Avoid too many return
statements within this method. Open
return :ial if self =~ InlineAttributeList
Avoid too many return
statements within this method. Open
return :xml_instr if self =~ /\A\s*<\?/
Avoid too many return
statements within this method. Open
return :text if self =~ /\A[ ]{0,3}<\w+:\/\//
Avoid too many return
statements within this method. Open
return :definition if self =~ Definition
Avoid too many return
statements within this method. Open
return :abbreviation if self =~ Abbreviation
Avoid too many return
statements within this method. Open
return :text # else, it's just text
Avoid too many return
statements within this method. Open
return :header3 if self =~ /\A(#)+\s*\S+/
Avoid too many return
statements within this method. Open
return :ald if self =~ AttributeDefinitionList
Method to_latex_header
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_latex_header
header_levels = %w(section subsection subsubsection)
h = header_levels[self.level - 1] || 'paragraph'
title = children_to_latex
- 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 tell_me_the_future
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def tell_me_the_future
s = ""
num_e = 0
@lines_index.upto(@lines.size - 1) do |i|
- 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 split_cells
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def split_cells(s, allowBlank = false)
if allowBlank
if /^[|].*[|]$/ =~ s # handle the simple and decorated table cases
s.split('|', -1)[1..-2] # allow blank cells, but only keep the inner elements of the cells
elsif /^.*[|]$/ =~ s
- 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 consume_whitespace
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def consume_whitespace
while c = cur_char
break unless (c == ' ' || c == "\t")
ignore_char
end
- 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 latex_color
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def latex_color(s, command='color')
if s =~ /\A\#([1-9A-F]{1,2})([1-9A-F]{1,2})([1-9A-F]{1,2})\z/i
# convert from 0-255 or 0-15 to 0.0-1.0
r, g, b = [$1, $2, $3].map {|c| c.hex / (c.length == 1 ? 15.0 : 255.0) }
"\\#{command}[rgb]{%0.2f,%0.2f,%0.2f}" % [r, g, 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 to_latex_link
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_latex_link
id = self.ref_id || children_to_s
ref = @doc.refs[sanitize_ref_id(id)] || @doc.refs[sanitize_ref_id(children_to_s)]
if ref
url = ref[:url]
- 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 to_html_citation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_html_citation
span = xelem('span')
span['class'] = 'maruku-citation'
span << xtext('[')
self.cites.each do |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"