Method report_schedule
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def report_schedule(schedules)
data = {:title => _('Schedules'), :mode => "miq_report_schedules bordered-list simple_table", :rows => []}
if schedules.blank?
data[:message] = _("Report is not Scheduled.")
else
- Read upRead up
- Create a ticketCreate a ticket
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 report_information
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def report_information(sb_data, report)
if sb_data[:miq_report_id] && report
data = {:title => _('Basic Information'), :mode => 'miq_report_basic_information'}
rows = []
rows.push(row_data(_('ID'), report.id))
- Read upRead up
- Create a ticketCreate a ticket
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 report_schedule
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def report_schedule(schedules)
data = {:title => _('Schedules'), :mode => "miq_report_schedules bordered-list simple_table", :rows => []}
if schedules.blank?
data[:message] = _("Report is not Scheduled.")
else
- Create a ticketCreate a ticket
Method report_widget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def report_widget(widget_nodes)
data = {:title => _('Widgets'), :mode => "miq_report_widgets bordered-list simple_table", :rows => []}
if widget_nodes.blank?
data[:message] = _("Report doesn't belong to Widgets.")
else
- Read upRead up
- Create a ticketCreate a ticket
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"