Method plot_quality
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def plot_quality(comp, cont, qual)
css_class = ["success","info","warning","danger"]
comp_l = comp > 80.0 ? 0 : comp > 50.0 ? 1 : comp > 20.0 ? 2 : 3
cont_l = cont < 4.0 ? 0 : cont < 10.0 ? 1 : cont < 16.0 ? 2 : 3
qual_l = qual > 80.0 ? 0 : qual > 50.0 ? 1 : qual > 20.0 ? 2 : 3
- 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 plot_quality_deprecated
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def plot_quality_deprecated(comp, cont, qual)
cols = ["rgba(92,184,92,1)", "rgba(91,192,222,1)",
"rgba(240,173,78,1)", "rgba(217,83,79,1)"]
comp_l = comp > 80.0 ? 0 : comp > 50.0 ? 1 : comp > 20.0 ? 2 : 3
cont_l = cont < 4.0 ? 0 : cont < 10.0 ? 1 : cont < 16.0 ? 2 : 3
- 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 plot_quality
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def plot_quality(comp, cont, qual)
css_class = ["success","info","warning","danger"]
comp_l = comp > 80.0 ? 0 : comp > 50.0 ? 1 : comp > 20.0 ? 2 : 3
cont_l = cont < 4.0 ? 0 : cont < 10.0 ? 1 : cont < 16.0 ? 2 : 3
qual_l = qual > 80.0 ? 0 : qual > 50.0 ? 1 : qual > 20.0 ? 2 : 3
Method plot_assembly
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def plot_assembly(n50, len)
# Trace1: RefSeq genomes
trace1 = {
x: [298471,2240716,3402093,4653910,13033779],
type: "box",
Method display_data
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def display_data(obj, html_safe = false)
case obj
when Float
obj.round(2).to_s
when Array
- 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"