AgileVentures/LocalSupport

View on GitHub

Showing 755 of 755 total issues

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

class Organisation < BaseOrganisation

  has_many :volunteer_ops
  has_many :users
  has_many :edits, class_name: 'ProposedOrganisationEdit', dependent: :destroy
Severity: Minor
Found in app/models/organisation.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. [130/100]
Open

class VolunteerOpsController < ApplicationController
  layout 'two_columns_with_map', except: :embedded_map
  before_action :set_organisation, only: [:new, :create]
  before_action :authorize, except: [:search, :show, :index, :embedded_map]
  prepend_before_action :set_volunteer_op, only: [:show, :edit]

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. [110/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 has too many lines. [103/100]
Open

class OrganisationsController < BaseOrganisationsController
  layout 'two_columns_with_map'
  before_action :authenticate_user!, except: [:search, :index, :show]
  prepend_before_action :set_organisation, only: [:show, :update, :edit]
  prepend_before_action :build_cat_name_ids, only: [:search, :index, :show]

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [22/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
Open

  def build_single_marker(volop, marker)
    location = volop.first
    vol_ops = volop.last
    if vol_ops.first.try(:source)
      source = VolunteerOp.get_source(vol_ops)

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class Organisation has 28 methods (exceeds 20 allowed). Consider refactoring.
Open

class Organisation < BaseOrganisation

  has_many :volunteer_ops
  has_many :users
  has_many :edits, class_name: 'ProposedOrganisationEdit', dependent: :destroy
Severity: Minor
Found in app/models/organisation.rb - About 3 hrs to fix

    Method has too many lines. [18/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

      def self.build params
        params.require(:proposed_organisation).permit(
          :superadmin_email_to_add,
          :description,
          :address,

    This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

    Class VolunteerOpsController has 24 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class VolunteerOpsController < ApplicationController
      layout 'two_columns_with_map', except: :embedded_map
      before_action :set_organisation, only: [:new, :create]
      before_action :authorize, except: [:search, :show, :index, :embedded_map]
      prepend_before_action :set_volunteer_op, only: [:show, :edit]
    Severity: Minor
    Found in app/controllers/volunteer_ops_controller.rb - About 2 hrs to fix

      Method has too many lines. [15/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
      Open

        def devise_error_messages!
          return "" if resource.errors.empty?
      
          errors = resource.errors
          reset_token_error = errors.to_hash.fetch(:reset_password_token,'')
      Severity: Minor
      Found in app/helpers/devise_helper.rb by rubocop

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Method has too many lines. [15/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
      Open

        def organisation_params
          params.require(:organisation).permit(
            :superadmin_email_to_add,
            :description,
            :address,

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Method has too many lines. [13/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
      Open

        def populate_vol_op_attributes model, op
          location = Location.new longitude: op['lng'], latitude: op['lat']
          model.source        = 'doit'
          model.latitude      = location.latitude
          model.longitude     = location.longitude

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Method has too many lines. [13/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
      Open

        def build_map_markers(organisations)
          ::MapMarkerJson.build(organisations) do |org, marker|
            marker.lat org.latitude
            marker.lng org.longitude
            marker.infowindow render_to_string(partial: 'organisations/popup', locals: {org: org})

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Method has too many lines. [12/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
      Open

        def populate_vol_op_attributes(op, model, coordinates)
          location = Location.create coordinates
          model.source = 'reachskills'
          model.latitude  = location.latitude
          model.longitude = location.longitude

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

        def devise_error_messages!
          return "" if resource.errors.empty?
      
          errors = resource.errors
          reset_token_error = errors.to_hash.fetch(:reset_password_token,'')
      Severity: Minor
      Found in app/helpers/devise_helper.rb by rubocop

      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

      Method has too many lines. [11/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
      Open

        def self.import(filename, limit, validation, &block)
          csv_text = File.open(filename, 'r:ISO-8859-1')
          count = 0
          CSV.parse(csv_text, :headers => true).each do |row|
            break if count >= limit
      Severity: Minor
      Found in app/models/organisation.rb by rubocop

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Method has too many lines. [11/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
      Open

        def render_error(status, error)
          raise error unless Rails.env.production?
      
          Rails.logger.error error.message
          error.backtrace.each_with_index { |line, index| Rails.logger.error line; break if index >= 5 }
      Severity: Minor
      Found in lib/custom_errors.rb by rubocop

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

        def populate_vol_op_attributes model, op
          location = Location.new longitude: op['lng'], latitude: op['lat']
          model.source        = 'doit'
          model.latitude      = location.latitude
          model.longitude     = location.longitude

      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

      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

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

        def populate_vol_op_attributes(op, model, coordinates)
          location = Location.create coordinates
          model.source = 'reachskills'
          model.latitude  = location.latitude
          model.longitude = location.longitude

      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

      Method has too many lines. [10/7] (https://github.com/bbatsov/ruby-style-guide#short-methods)
      Open

        def parse
          address = value.to_s
          postcode = ''
          match = value.to_s.match(/(.*)(,\s*(\w\w\d\s* \d\w\w))/)
          if match
      Severity: Minor
      Found in app/models/address.rb by rubocop

      This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

      Severity
      Category
      Status
      Source
      Language