Showing 943 of 943 total issues
Method has too many lines. [6/5] (https://github.com/bbatsov/ruby-style-guide#short-methods) Open
def initialize(params)
@params = params.permit(
:q,
:what_id,
:who_id,
- 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. [6/5] (https://github.com/bbatsov/ruby-style-guide#short-methods) Open
def run
unless editor.siteadmin?
merge_in_non_published_fields
send_email_to_superadmin_about_org_edit
listener.set_notice('Edit is pending admin approval.')
- 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. [6/5] (https://github.com/bbatsov/ruby-style-guide#short-methods) Open
def candidates
[
name.method(:short_name),
name.method(:longer_name),
name.method(:append_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. [6/5] (https://github.com/bbatsov/ruby-style-guide#short-methods) Open
def self.seed(csv_file)
csv_text = File.open(csv_file, 'r:ISO-8859-1')
CSV.parse(csv_text, :headers => true).each do |row|
Category.create! :name => row[@@column_mappings[:name]].strip,
:charity_commission_id => row[@@column_mappings[:cc_id]],
- 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. [6/5] (https://github.com/bbatsov/ruby-style-guide#short-methods) Open
def create
@page = Page.new(params[:page])
if @page.save
redirect_to @page, notice: 'Page was successfully created.'
- 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. [6/5] (https://github.com/bbatsov/ruby-style-guide#short-methods) Open
def smart_truncate(sentence, char_limit = 128)
sentence = sentence.to_s
size =0
sentence.split().reject do |word|
size+=word.size()
- 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. [6/5] (https://github.com/bbatsov/ruby-style-guide#short-methods) Open
def update
update_params = PageParams.build params
if @page.update_attributes(update_params)
redirect_to @page, notice: 'Page was successfully updated.'
else
- 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. [6/5] (https://github.com/bbatsov/ruby-style-guide#short-methods) Open
def allow_cookie_policy
response.set_cookie 'cookie_policy_accepted', {
value: 'true',
path: '/',
expires: 1.year.from_now.utc
- 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 persist_doit_vol_ops is too high. [16.64/15] (http://c2.com/cgi/wiki?AbcMetric) Open
def persist_doit_vol_ops(opportunities)
opportunities.each do |op|
model_klass.find_or_create_by(doit_op_id: op['id']) do |model|
model.source = 'doit'
model.latitude = op['lat']
- 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. [6/5] (https://github.com/bbatsov/ruby-style-guide#short-methods) Open
def self.build params
params.require(:page).permit(
:content,
:name,
:permalink,
- 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 after_inactive_sign_up_path_for is too high. [16.16/15] (http://c2.com/cgi/wiki?AbcMetric) 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 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 destroy is too high. [16.4/15] (http://c2.com/cgi/wiki?AbcMetric) Open
def destroy
unless current_user.try(:superadmin?)
flash[:notice] = PERMISSION_DENIED
redirect_to organisation_path(params[:id]) and return false
end
- 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. [6/5] (https://github.com/bbatsov/ruby-style-guide#short-methods) 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]
- 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. [6/5] (https://github.com/bbatsov/ruby-style-guide#short-methods) Open
def set_tags
set_meta_tags title: meta_tag_title,
site: 'Harrow volunteering',
reverse: true,
description: meta_tag_description,
- 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. [6/5] (https://github.com/bbatsov/ruby-style-guide#short-methods) Open
def update
user = User.find_by_id(params[:id])
if params[:pending_org_action] == "decline"
UserOrganisationDecliner.new(self, user, current_user).call
elsif params[:pending_org_action] == "approve"
- 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. [6/5] (https://github.com/bbatsov/ruby-style-guide#short-methods) Open
def self.included(base)
base.rescue_from Exception, with: ->(exception) { render_error 500, exception }
base.rescue_from ActionController::RoutingError,
ActionController::UnknownController,
- 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 type is too high. [15.3/15] (http://c2.com/cgi/wiki?AbcMetric) Open
def type
return CategoryType.what_they_do if self.charity_commission_id < 200
return CategoryType.who_they_help if (self.charity_commission_id < 300) & (self.charity_commission_id > 199)
return CategoryType.how_they_help if (self.charity_commission_id < 400) & (self.charity_commission_id > 299)
end
- 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
Assignment Branch Condition size for build_single_marker is too high. [15.3/15] (http://c2.com/cgi/wiki?AbcMetric) Open
def build_single_marker(volop, marker)
location = volop.first
vol_ops = volop.last
source = VolunteerOp.get_source(vol_ops)
marker.lat location.latitude
- 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
Function invite_users
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.invite_users = function () {
$(this).click(function () {
var values = {},
checks = $('input:checked');
checks.each(function () {
Function initMap
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initMap() {
map = new google.maps.Map(document.getElementById(Settings.id), {
center: {lat: Settings.lat, lng: Settings.lng},
zoom: Settings.zoom