TracksApp/tracks

View on GitHub

Showing 2,926 of 2,932 total issues

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

Complex method LoginSystem#login_from_cookie (29.7)
Open

  def login_from_cookie
    return unless cookies[:auth_token] && !logged_in?
    token = cookies[:auth_token]
    user = User.where(:remember_token => token).first
    if user && user.remember_token?
Severity: Minor
Found in lib/login_system.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#destroy (29.7)
Open

  def destroy
    @number_of_todos = @recurring_todo.todos.count

    # remove all references to this recurring todo
    @recurring_todo.clear_todos_association

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

  def done
    @source_view = 'done'

    init_not_done_counts

Severity: Minor
Found in app/controllers/stats_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#done (29.3)
Open

  def done
    @source_view = 'done'
    @page_title = t('todos.completed_tasks_title')

    @done_today, @done_rest_of_week, @done_rest_of_month = DoneTodos.done_todos_for_container(current_user.todos)
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 DataController#csv_notes (28.5)
Open

  def csv_notes
    content_type = 'text/csv'
    CSV.generate(result = "") do |csv|
      csv << ["id", "User ID", "Project", "Note", "Created at", "Updated at"]
      # had to remove project include because it's association order is leaking
Severity: Minor
Found in app/controllers/data_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 BootstrapFlashHelper#bootstrap_flash (28.3)
Open

  def bootstrap_flash(options = { :close_button => true })
    flash_messages = []
    flash.each do |type, message|
      # Skip empty messages, e.g. for devise messages set to nothing in a locale file.
      next if message.blank?
Severity: Minor
Found in app/helpers/bootstrap_flash_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 ApplicationController#done_todos_for (27.7)
Open

  def done_todos_for(object)
    object_name = object.class.name.downcase # context or project
    @source_view = "done"
    eval("@#{object_name} = object", binding, __FILE__, __LINE__)
    @page_title = t("#{object_name.pluralize}.completed_tasks_title", "#{object_name}_name".to_sym => object.name)

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 PreferencesController#update (27.5)
Open

  def update
    @prefs = current_user.prefs
    @user = current_user
    user_updated = current_user.update(user_params)
    prefs_updated = current_user.preference.update(prefs_params)

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