File task_lists_controller.rb
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
class TaskListsController < ApplicationController
around_filter :set_time_zone, :only => [:index, :show, :gantt_view]
before_filter :load_task_list, :only => [:edit,:update,:show,:destroy,:watch,:unwatch,:archive,:unarchive]
before_filter :load_task_lists, :only => [:index, :reorder]
before_filter :set_page_title
Method archive
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def archive
authorize! :update, @task_list
calc_onindex
if !@task_list.archived
Method archive
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def archive
authorize! :update, @task_list
calc_onindex
if !@task_list.archived
- 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 load_task_lists
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_task_lists
if @current_project
@task_lists = @current_project.task_lists(:include => [:project])
else
@projects = current_user.projects.unarchived
- 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 load_gantt_events
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_gantt_events
@chart_task_lists = []
if @current_project
@task_lists = (@task_lists || @current_project.task_lists.unarchived)
conditions = ["project_id = :project_id AND status IN (:status) AND due_on IS NOT NULL", {
- 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"