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
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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 }
- Read upRead up
- Exclude checks
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]
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
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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
)
- Read upRead up
- Exclude checks
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,
- Read upRead up
- Exclude checks
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]
- Read upRead up
- Exclude checks
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,
- Read upRead up
- Exclude checks
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|
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
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']
- Read upRead up
- Exclude checks
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,'')
- Read upRead up
- Exclude checks
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',
- Read upRead up
- Exclude checks
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:
- Read upRead up
- Exclude checks
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',
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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'
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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.