Showing 2,926 of 2,932 total issues
Complex method TodosController#toggle_check (128.0) Open
def toggle_check
@todo = current_user.todos.find(params['id'])
@source_view = params['_source_view'] || 'todo'
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Complex method StatsController#show_selected_actions_from_chart (121.2) Open
def show_selected_actions_from_chart
@page_title = t('stats.action_selection_title')
@count = 99
@source_view = 'stats'
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Class has too many lines. [302/300] Open
class Todo < ApplicationRecord
MAX_DESCRIPTION_LENGTH = 300
MAX_NOTES_LENGTH = 60_000
after_save :save_predecessors
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Class has too many lines. [302/300] Open
class ProjectsController < ApplicationController
helper :application, :todos, :notes
before_action :set_source_view
before_action :set_project_from_params, :only => [:update, :destroy, :show, :edit, :set_reviewed]
before_action :default_context_filter, :only => [:create, :update]
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
File todos_helper.rb
has 559 lines of code (exceeds 300 allowed). Consider refactoring. Open
require 'staleness'
module TodosHelper
# === helpers for rendering container
def empty_message_holder(container_name, show, title_param = nil)
Complex method UsersController#create (108.6) Open
def create
if params['exception']
render_failure "Expected post format is valid xml like so: <user><login>username</login><password>abc123</password></user>."
return
end
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Complex method ProjectsController#show (107.8) Open
def show
@max_completed = current_user.prefs.show_number_completed
init_data_for_sidebar unless mobile?
@page_title = t('projects.page_title', :project => @project.name)
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Complex method TodosHelper#show_empty_message_in_source_container (96.5) Open
def show_empty_message_in_source_container
container_id = ""
source_view do |page|
page.deferred { container_id = todo_container_empty_id(@original_item) if @remaining_in_context == 0 }
page.calendar { container_id = "#{@original_item_due_id}_container-empty-d" if @old_due_empty }
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Complex method Todo::import (95.0) Open
def self.import(filename, params, user)
default_context = user.contexts.order('id').first
return false if default_context.nil?
count = 0
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Complex method TodosController#update (94.5) Open
def update
@source_view = params['_source_view'] || 'todo'
@todo = current_user.todos.find(params['id'])
@original_item = current_user.todos.build(@todo.attributes) # create a (unsaved) copy of the original todo
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Complex method ProjectsController#update (88.3) Open
def update
template = ""
params['project'] ||= {}
if params['project']['state']
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Complex method TodosController#determine_down_count (84.8) Open
def determine_down_count
source_view do |from|
from.todo do
@down_count = current_user.todos.active.not_hidden.count
end
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Complex method TodoFromRichMessage#construct (84.6) Open
def construct
extractor = RichMessageExtractor.new(description)
description = extractor.description
context = extractor.context
project = extractor.project
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Class Actions
has 41 methods (exceeds 20 allowed). Consider refactoring. Open
class Actions
SECONDS_PER_DAY = 86_400
attr_reader :user
Complex method ContextsController#show (75.2) Open
def show
set_context_from_params
unless @context.nil?
@max_completed = current_user.prefs.show_number_completed
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Class Todo
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class Todo < ApplicationRecord
MAX_DESCRIPTION_LENGTH = 300
MAX_NOTES_LENGTH = 60_000
after_save :save_predecessors
Complex method TodosController#destroy (72.4) Open
def destroy
@source_view = params['_source_view'] || 'todo'
@todo = current_user.todos.find(params['id'])
# Create a (unsaved) copy of the original todo
@original_item = current_user.todos.build(@todo.attributes)
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Complex method Todos::UndoneTodosQuery#query (70.7) Open
def query(params)
if params[:done]
not_done_todos = current_user.todos.completed.completed_after(Time.zone.now - params[:done].to_i.days)
else
not_done_todos = current_user.todos.active.not_hidden
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool
Class ApplicationController
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
Complex method TodosController#tag (67.4) Open
def tag
get_params_for_tag_view
@page_title = t('todos.tagged_page_title', :tag_name => @tag_title)
@source_view = params['_source_view'] || 'tag'
- Read upRead up
- Exclude checks
Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.
You can read more about ABC metrics or the flog tool