Method make_form_boolean
has a Cognitive Complexity of 126 (exceeds 5 allowed). Consider refactoring. Open
def make_form_boolean(string, system_configuration)
['true', 'false'].each do |state|
string << "<input type=radio
name=system_configurations[#{ system_configuration.id }]
value=#{state} "
- 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 make_form_selector
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def make_form_selector(string, system_configuration)
string << "<select name=system_configurations[#{ system_configuration.id }]>"
case system_configuration.keyname
when 'header.disp_date'
3.times 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 make_form_boolean
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
def make_form_boolean(string, system_configuration)
['true', 'false'].each do |state|
string << "<input type=radio
name=system_configurations[#{ system_configuration.id }]
value=#{state} "
Method make_form
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def make_form(system_configuration, errors = nil)
#TODO:
error = nil
if errors
errors.each do |e|
- 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 make_form_selector
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def make_form_selector(string, system_configuration)
string << "<select name=system_configurations[#{ system_configuration.id }]>"
case system_configuration.keyname
when 'header.disp_date'
3.times do |i|
Method make_form
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def make_form(system_configuration, errors = nil)
#TODO:
error = nil
if errors
errors.each do |e|