TracksApp/tracks

View on GitHub

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

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

          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])
          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

          Class AbstractRecurrencePattern has 33 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class AbstractRecurrencePattern
              attr_accessor :attributes
          
              def initialize(user)
                @user = user
          Severity: Minor
          Found in app/models/recurring_todos/abstract_recurrence_pattern.rb - About 4 hrs to fix

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

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

              Severity
              Category
              Status
              Source
              Language