Method examine_cell
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def self.examine_cell(x, y, value, vcol, vrow, vcorner, cell)
cell.category = ""
cell.category_given_tr = ""
cell.separator = ""
cell.conflicted = false
- 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 examine_cell
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.examine_cell(x, y, value, vcol, vrow, vcorner, cell)
cell.category = ""
cell.category_given_tr = ""
cell.separator = ""
cell.conflicted = false
Method render
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def render(rows)
return if (rows.width==0||rows.height==0)
render = self
render.begin_table()
change_row = -1
- 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
File diff_render.rb
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Coopy
class DiffRender
def initialize
@text_to_insert = []
Method sample_css
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sample_css()
return ".highlighter .add
background-color: #7fff7f
end
Method render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render(rows)
return if (rows.width==0||rows.height==0)
render = self
render.begin_table()
change_row = -1
Method mark_spaces
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def self.mark_spaces(sl, sr)
return sl if (sl==sr)
return sl if (sl.nil? || sr.nil?)
slc = sl.gsub(" ","")
src = sr.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 mark_spaces
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.mark_spaces(sl, sr)
return sl if (sl==sr)
return sl if (sl.nil? || sr.nil?)
slc = sl.gsub(" ","")
src = sr.gsub(" ","")
Method examine_cell
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.examine_cell(x, y, value, vcol, vrow, vcorner, cell)
Avoid deeply nested control flow statements. Open
if (tokens.length>=3)
ref = pretty_tokens[0]
pretty_tokens[0] = mark_spaces(ref,tokens[2])
pretty_tokens[2] = mark_spaces(tokens[2],ref)
end
Avoid deeply nested control flow statements. Open
cell.pvalue = tokens[0] if (cell.conflicted)
Avoid deeply nested control flow statements. Open
offset = cell.conflicted ? 1 : 0
Avoid deeply nested control flow statements. Open
if (tokens.length == 0)
pretty_tokens = ['','']
end
Avoid deeply nested control flow statements. Open
if (part!=full)
if (cell.value.index(full))
div = full
cat = "conflict"
cell.conflicted = true
Avoid deeply nested control flow statements. Open
if (tokens.length>=2)
pretty_tokens[0] = mark_spaces(tokens[0],tokens[1])
pretty_tokens[1] = mark_spaces(tokens[1],tokens[0])
end