TracksApp/tracks

View on GitHub

Showing 1,608 of 1,614 total issues

Complex method TodosHelper#date_span (35.4)
Open

  def date_span(todo = @todo)
    if todo.completed?
      content_tag(:span, { :class => :grey }) { format_date(todo.completed_at) }
    elsif todo.pending?
      title = t('todos.depends_on') + ": " + todo.uncompleted_predecessors.to_a.map(&:description).join(', ')
Severity: Minor
Found in app/helpers/todos_helper.rb by flog

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 User::has_many#actionize (34.4)
Open

              def actionize(scope_conditions = {})
                todos_in_project = where(scope_conditions).includes(:todos)
                todos_in_project = todos_in_project.sort_by { |x| [-x.todos.active.count, -x.id] }
                todos_in_project.reject { |p| p.todos.active.count > 0 }
                sorted_project_ids = todos_in_project.map(&:id)
Severity: Minor
Found in app/models/user.rb by flog

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#change_context (34.1)
Open

  def change_context
    # change context if you drag a todo to another context
    @todo = current_user.todos.find(params[:id])
    @original_item = current_user.todos.build(@todo.attributes)  # create a (unsaved) copy of the original todo
    @context = current_user.contexts.find(params[:todo][:context_id])
Severity: Minor
Found in app/controllers/todos_controller.rb by flog

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 Stats::Actions#done_last30days_data (34.1)
Open

    def done_last30days_data
      # get actions created and completed in the past 30 days.
      @actions_done_last30days = @user.todos.completed_after(@cut_off_30days).select("completed_at")
      @actions_created_last30days = @user.todos.created_after(@cut_off_30days).select("created_at")

Severity: Minor
Found in app/models/stats/actions.rb by flog

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#empty_container_msg_div_id (34.1)
Open

  def empty_container_msg_div_id(todo = @todo || @successor)
    raise Exception.new, "no @todo or @successor set" if !todo

    source_view do |page|
      page.project do
Severity: Minor
Found in app/helpers/todos_helper.rb by flog

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#done (34.0)
Open

  def done
    @source_view = params['_source_view'] || 'project_list'
    @page_title = t('projects.list_completed_projects')

    items_per_page = 20
Severity: Minor
Found in app/controllers/projects_controller.rb by flog

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#auto_complete_for_predecessor (34.0)
Open

  def auto_complete_for_predecessor
    unless params['id'].nil?
      get_todo_from_params
      # Begin matching todos in current project, excluding @todo itself
      @items = get_not_completed_for_predecessor(@todo.project, @todo.id) unless @todo.project.nil?
Severity: Minor
Found in app/controllers/todos_controller.rb by flog

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 UsersController#index (33.3)
Open

  def index
    respond_to do |format|
      order_by = 'login'
      if params[:order] && User.column_names.include?(params[:order])
        order_by = params[:order]
Severity: Minor
Found in app/controllers/users_controller.rb by flog

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 RecurringTodosController#create (32.8)
Open

  def create
    builder = RecurringTodos::RecurringTodosBuilder.new(current_user, all_recurring_todo_params)
    @saved = builder.save

    if @saved

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#tags (32.5)
Open

  def tags
    tags_beginning = current_user.tags.where(Tag.arel_table[:name].matches("#{params[:term]}%"))
    tags_all = current_user.tags.where(Tag.arel_table[:name].matches("%#{params[:term]}%"))
    tags_all -= tags_beginning

Severity: Minor
Found in app/controllers/todos_controller.rb by flog

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 User::has_many#update_positions (32.4)
Open

              def update_positions(project_ids)
                project_ids.each_with_index do |id, position|
                  project = find_by(id: id.to_i)
                  raise I18n.t('models.user.error_project_not_associated', :project => id, :user => @user.id) if project.nil?
                  project.update_attribute(:position, position + 1)
Severity: Minor
Found in app/models/user.rb by flog

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 StatsHelper#month_and_year_label (31.9)
Open

  def month_and_year_label(i)
    t('date.month_names')[(Time.zone.now.mon - i - 1) % 12 + 1] + " " + (Time.zone.now - i.months).year.to_s
Severity: Minor
Found in app/helpers/stats_helper.rb by flog

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#todos_container_header (31.7)
Open

  def todos_container_header(settings = {})
    settings.reverse_merge!({
        :title => t("todos.actions.#{settings[:parent_container_type]}_#{settings[:container_name]}", :param => settings[:title_param])
      })
    header = settings[:link_in_header].nil? ? "" : content_tag(:div, :class => "link_in_container_header") { settings[:link_in_header] }
Severity: Minor
Found in app/helpers/todos_helper.rb by flog

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 Search::SearchResults#number_of_finds (31.6)
Open

    def number_of_finds
      results[:todos].size + results[:projects].size + results[:notes].size + results[:contexts].size + results[:tags].size
Severity: Minor
Found in app/models/search/search_results.rb by flog

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 Project::import (31.5)
Open

  def self.import(filename, params, user)
    count = 0
    CSV.foreach(filename, headers: true) do |row|
      unless find_by_name_and_user_id row[params[:name].to_i], user.id
        project = new
Severity: Minor
Found in app/models/project.rb by flog

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 LoginController#login (31.4)
Open

  def login
    @page_title = "TRACKS::Login"
    cookies[:preferred_auth] = prefered_auth? unless cookies[:preferred_auth]
    case request.method
    when 'POST'
Severity: Minor
Found in app/controllers/login_controller.rb by flog

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#edit (31.3)
Open

  def edit
    @todo = current_user.todos.find(params['id'])
    @source_view = params['_source_view'] || 'todo'
    @tag_name = params['_tag_name']
    respond_to do |format|
Severity: Minor
Found in app/controllers/todos_controller.rb by flog

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 RecurringTodosController#done (30.9)
Open

  def done
    @source_view = params['_source_view'] || 'recurring_todo'
    @page_title = t('todos.completed_recurring_actions_title')

    items_per_page = 20

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 ApplicationController#set_locale (30.2)
Open

  def set_locale
    locale = params[:locale] # specifying a locale in the request takes precedence
    locale ||= prefs.locale unless current_user.nil? # otherwise, the locale of the currently logged in user takes over
    locale ||= request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first if request.env['HTTP_ACCEPT_LANGUAGE']

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 FeedlistController#index (30.0)
Open

  def index
    @page_title = 'TRACKS::Feeds'

    unless mobile?
      init_data_for_sidebar
Severity: Minor
Found in app/controllers/feedlist_controller.rb by flog

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

Severity
Category
Status
Source
Language