tansaku/LocalSupport

View on GitHub

Showing 943 of 943 total issues

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

  def create
    # model filters for logged in users, but we check here if that user is an superadmin
    # TODO refactor that to model responsibility?
    org_params = OrganisationParams.build params

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/5] (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/5] (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.

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

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

    Method has too many lines. [10/5] (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.

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

      def create_response_object(usr)
        return Response.new(Response::SUCCESS, nil) if usr.errors.empty?
        status =  case usr.errors.full_messages.first
          when "Email can't be blank"
            Response::NO_EMAIL

    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. [10/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

        def self.search_by_keyword_and_category(parsed_params)
          organisations = order_by_most_recent.search_by_keyword(
            parsed_params.query_term
          )
    
    

    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. [10/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

      def proposed_edit_params
        params.require(:proposed_organisation_edit).permit(
          :name,
          :description,
          :donation_info,

    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. [10/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

        def after_inactive_sign_up_path_for(resource)
          if session[:pending_organisation_id]
            UserOrganisationClaimer.new(self, resource, resource).call(session[:pending_organisation_id])
            return organisation_path resource.pending_organisation 
          elsif session[:proposed_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. [10/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

      def create(validate)
        return nil if @csv_organisation.is_organisation_removed? 
        return nil if organisation_already_exists?
        create_method = validate ? :create_and_validate : :create_and_substitute_with_empty
        @organisation_repository.send(create_method,

    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. [10/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

      def serialize_invitations
    
        User.invited_not_accepted.select do |user|
          user.organisation.present? # because invitation data may be 'dirty'
        end.map do |user|

    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. [9/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

      def update
        # UpdateProposedOrganisationEdit.with(observer: self, params: create_params)
        proposed_edit = ProposedOrganisationEdit.find(update_params.fetch(:id))
        if proposed_edit_params.any?
          proposed_edit.accept(proposed_edit_params)

    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. [9/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

      def gmaps4rails_marker_attrs
        if recently_updated_and_has_owner
          ['marker.png',
            'data-id' => id,
           class: 'marker']
    Severity: Minor
    Found in app/models/base_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.

    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. [9/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

      def self.build
        new({
          name: 'Title',
          address: 'Contact Address',
          description: 'Activities',
    Severity: Minor
    Found in app/models/csv_header.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. [9/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

      def run
        #for the future this from the devis wiki might be relevant
        #When skip_invitation is used, you must also then set the invitation_sent_at field when the user is sent
        # their token. Failure to do so will yield “Invalid invitation token” errors when the user attempts to
        # accept the invite. You can set it like so:

    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. [9/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

      def self.from(value)
        [
          '1',
          1,
          'y',
    Severity: Minor
    Found in lib/boolean.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. [8/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

      def set_flash_warning_reminder_to_update_details usr
        if usr.organisation and not usr.organisation.has_been_updated_recently?
          msg = render_to_string(partial: "shared/call_to_action", locals: {org: usr.organisation}).html_safe
          if flash[:warning]
            flash[:warning] << ' ' << msg

    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. [8/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

      def bootstrap_class_for flash_type
        case flash_type
        when 'warning'
          'alert-warning'
        when 'notice'
    Severity: Minor
    Found in app/helpers/application_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. [8/5] (https://github.com/bbatsov/ruby-style-guide#short-methods)
    Open

      def create
        make_user_into_org_admin_of_new_proposed_org
        if @proposed_organisation.save
          session[:proposed_organisation_id] = @proposed_organisation.id
          send_email_to_superadmin_about_org_signup @proposed_organisation

    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