TracksApp/tracks

View on GitHub

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'

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 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'
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

Class has too many lines. [302/300]
Open

class Todo < ApplicationRecord
  MAX_DESCRIPTION_LENGTH = 300
  MAX_NOTES_LENGTH = 60_000

  after_save :save_predecessors
Severity: Minor
Found in app/models/todo.rb by rubocop

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]

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)
Severity: Major
Found in app/helpers/todos_helper.rb - About 1 day to fix

    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
    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 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)
    
    
    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 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 }
    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 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
    Severity: Minor
    Found in app/models/todo.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#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
    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 ProjectsController#update (88.3)
    Open

      def update
        template = ""
    
        params['project'] ||= {}
        if params['project']['state']
    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#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
    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 TodoFromRichMessage#construct (84.6)
    Open

      def construct
        extractor   = RichMessageExtractor.new(description)
        description = extractor.description
        context     = extractor.context
        project     = extractor.project
    Severity: Minor
    Found in app/services/todo_from_rich_message.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

    Class Actions has 41 methods (exceeds 20 allowed). Consider refactoring.
    Open

      class Actions
        SECONDS_PER_DAY = 86_400
    
        attr_reader :user
    
    
    Severity: Minor
    Found in app/models/stats/actions.rb - About 5 hrs to fix

      Complex method ContextsController#show (75.2)
      Open

        def show
          set_context_from_params
      
          unless @context.nil?
            @max_completed = current_user.prefs.show_number_completed
      Severity: Minor
      Found in app/controllers/contexts_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

      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
      Severity: Minor
      Found in app/models/todo.rb - About 4 hrs to fix

        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)
        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 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
        Severity: Minor
        Found in app/models/todos/undone_todos_query.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

        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
        
        
        Severity: Minor
        Found in app/controllers/application_controller.rb - About 4 hrs to fix

          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'
          
          
          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

          Severity
          Category
          Status
          Source
          Language