AgileVentures/LocalSupport

View on GitHub
app/controllers/application_controller.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Class has too many lines. [136/100]
Open

class ApplicationController < ActionController::Base
  protect_from_forgery
  before_action :store_location,
                :assign_footer_page_links,
                :set_tags,

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 ApplicationController has 25 methods (exceeds 20 allowed). Consider refactoring.
Open

class ApplicationController < ActionController::Base
  protect_from_forgery
  before_action :store_location,
                :assign_footer_page_links,
                :set_tags,
Severity: Minor
Found in app/controllers/application_controller.rb - About 2 hrs to fix

    Assignment Branch Condition size for after_sign_in_path_for is too high. [19.42/15] (http://c2.com/cgi/wiki?AbcMetric)
    Open

      def after_sign_in_path_for(resource)
        set_flash_warning_reminder_to_update_details resource
        return edit_user_path id: current_user.id if session[:pending_organisation_id]
        return organisation_path(current_user.organisation) if current_user.organisation
        return session[:previous_url] if session[:previous_url]

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Use attr_reader to define trivial reader methods. (https://github.com/bbatsov/ruby-style-guide#attr_family)
    Open

      def iframe

    This cop looks for trivial reader/writer methods, that could have been created with the attr_* family of functions automatically.

    Example:

    # bad
    def foo
      @foo
    end
    
    def bar=(val)
      @bar = val
    end
    
    def self.baz
      @baz
    end
    
    # good
    attr_reader :foo
    attr_writer :bar
    
    class << self
      attr_reader :baz
    end

    Line is too long. [95/90] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

        @map_zoom_level = @iframe.blank? ? Setting.map_zoom_level : Setting.embedded_map_zoom_level

    Do not prefix writer method names with set_. (https://github.com/bbatsov/ruby-style-guide#accessor_mutator_method_names)
    Open

      def set_flash_warning_reminder_to_update_details usr

    This cop makes sure that accessor methods are named properly.

    Example:

    # bad
    def set_attribute(value)
    end
    
    # good
    def attribute=(value)
    end
    
    # bad
    def get_attribute
    end
    
    # good
    def attribute
    end

    There are no issues that match your filters.

    Category
    Status