Showing 1,608 of 1,614 total issues
Complex method UsersController#create (118.8) 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
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 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 (92.8) 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
Complex method TodosController#defer (66.1) Open
def defer
@source_view = params['_source_view'] || 'todo'
numdays = params['days'].to_i
@todo = current_user.todos.find(params[:id])
- 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 AbstractRecurrencePattern
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class AbstractRecurrencePattern
attr_accessor :attributes
def initialize(user)
@user = user
Class User
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ApplicationRecord
# Virtual attribute for the unencrypted password
attr_accessor :password
cattr_accessor :per_page
Complex method DataController#csv_map (60.8) Open
def csv_map
if params[:file].blank?
flash[:notice] = t "data.import.errors.file_blank"
redirect_back fallback_location: root_path
else
- 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