Method ical
has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring. Open
def ical(mode = :personal)
if params[:id].nil? || params[:id].empty?
render :nothing => true
return
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 rss
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def rss
return if params[:id].blank?
headers['Content-Type'] = 'application/rss+xml'
- 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 ical
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
def ical(mode = :personal)
if params[:id].nil? || params[:id].empty?
render :nothing => true
return
end
Method get_action
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def get_action(log)
if log.task && log.task_id > 0
action = 'Completed' if log.event_log.event_type == EventLog::TASK_COMPLETED
action = 'Reverted' if log.event_log.event_type == EventLog::TASK_REVERTED
action = 'Created' if log.event_log.event_type == EventLog::TASK_CREATED
- 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 rss
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
def rss
return if params[:id].blank?
headers['Content-Type'] = 'application/rss+xml'
File feeds_controller.rb
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'rss/maker'
require 'icalendar'
require 'google_chart'
class FeedsController < ApplicationController