wearefine/fae

View on GitHub

Showing 1,556 of 1,556 total issues

Assignment Branch Condition size for generate_view_files is too high. [35.69/15]
Open

def generate_view_files
@toggle_attrs = set_toggle_attrs
@form_attrs = set_form_attrs
@association_names = @@association_names
@attachments = @@attachments

Method has too many lines. [29/10]
Open

def filter(params)
# build conditions if specific params are present
conditions = {}
conditions[:user_id] = params['user'] if params['user'].present?
conditions[:changeable_type] = params['model'] if params['model'].present?
Severity: Minor
Found in app/models/fae/change.rb by rubocop

Assignment Branch Condition size for fae_pulldown is too high. [34.21/15]
Open

def fae_pulldown(f, attribute, options={})
raise "Fae::MissingRequiredOption: fae_pulldown requires a 'collection' when using it on an ActiveRecord attribute." if !options.has_key?(:collection) && f.object.attribute_names.include?(attribute.to_s)
raise "Fae::ImproperOptionValue: The value #{options[:size]} is not a valid option for 'size'. Please use 'short' or 'long'." if options[:size].present? && ['short','long'].include?(options[:size]) == false
raise "Fae::ImproperOptionValue: The value #{options[:search]} is not a valid option for 'search'. Please use a Boolean." if options[:search].present? && !!options[:search] != options[:search]
 
 
Severity: Minor
Found in app/helpers/fae/form_helper.rb by rubocop

Assignment Branch Condition size for generate_view_files is too high. [34.53/15]
Open

def generate_view_files
@toggle_attrs = set_toggle_attrs
@form_attrs = set_form_attrs
@association_names = @@association_names
@attachments = @@attachments

Assignment Branch Condition size for set_globals is too high. [33.79/15]
Open

def set_globals
if attributes.present?
attributes.each do |arg|
# prevent these from being in attributes_flat or attribute_names as they are not real model generator field options
if is_attachment(arg)

Assignment Branch Condition size for generate_view_files is too high. [33.06/15]
Open

def generate_view_files
@form_attrs = set_form_attrs
@attachments = @@attachments
template "views/table_nested.html.#{options.template}", "app/views/#{options.namespace}/#{plural_file_name}/table.html.#{options.template}"
template "views/_form_nested.html.#{options.template}", "app/views/#{options.namespace}/#{plural_file_name}/_form.html.#{options.template}"

Assignment Branch Condition size for label_and_hint is too high. [31.7/15]
Open

def label_and_hint(attribute, options)
hint = options[:hint]
 
options[:helper_text] = attempt_common_helper_text(attribute) if options[:helper_text].blank?
 
 
Severity: Minor
Found in app/helpers/fae/form_helper.rb by rubocop

Assignment Branch Condition size for update is too high. [30.43/15]
Open

def update
authorize_role
 
params[:user].delete(:password) if params[:user][:password].blank?
params[:user].delete(:password_confirmation) if params[:user][:password].blank? and params[:user][:password_confirmation].blank?

Method has too many lines. [24/10]
Open

def post(endpoint, params = nil)
begin
uri = URI.parse(endpoint)
request = Net::HTTP::Post.new(uri)
set_headers(request)
Severity: Minor
Found in app/services/fae/netlify_api.rb by rubocop

Assignment Branch Condition size for change is too high. [29/15]
Open

def change
create_table(:fae_users) do |t|
## Database authenticatable
t.string :email, :null => false, :default => ""
t.string :encrypted_password, :null => false, :default => ""

Method has too many lines. [24/10]
Open

def set_globals
if attributes.present?
attributes.each do |arg|
# prevent these from being in attributes_flat or attribute_names as they are not real model generator field options
if is_attachment(arg)

Method filter has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

def filter(params)
# build conditions if specific params are present
conditions = {}
conditions[:user_id] = params['user'] if params['user'].present?
conditions[:changeable_type] = params['model'] if params['model'].present?
Severity: Minor
Found in app/models/fae/change.rb - About 3 hrs to fix

Assignment Branch Condition size for post is too high. [27.75/15]
Open

def post(endpoint, params = nil)
begin
uri = URI.parse(endpoint)
request = Net::HTTP::Post.new(uri)
set_headers(request)
Severity: Minor
Found in app/services/fae/netlify_api.rb by rubocop

Method has too many lines. [22/10]
Open

def inject_model_attachments
return if @@attachments.blank?
@@attachments.each do |attachment|
if attachment.type == :image
inject_into_file "app/models/#{file_name}.rb", after: "include Fae::BaseModelConcern\n" do

Cyclomatic complexity for filter is too high. [17/6]
Open

def filter(params)
# build conditions if specific params are present
conditions = {}
conditions[:user_id] = params['user'] if params['user'].present?
conditions[:changeable_type] = params['model'] if params['model'].present?
Severity: Minor
Found in app/models/fae/change.rb by rubocop

Method has too many lines. [21/10]
Open

def fae_filter_form(options = {}, &block)
options = prepare_options_for_filter_form options
return if options[:collection].blank?
 
form_tag(options[:action], prepare_form_filter_hash(options)) do
Severity: Minor
Found in app/helpers/fae/view_helper.rb by rubocop

Method has too many lines. [21/10]
Open

def get(endpoint)
begin
uri = URI.parse(endpoint)
request = Net::HTTP::Get.new(uri)
set_headers(request)
Severity: Minor
Found in app/services/fae/netlify_api.rb by rubocop

Assignment Branch Condition size for fae_grouped_select is too high. [25.02/15]
Open

def fae_grouped_select(f, attribute, options={})
raise "Fae::MissingRequiredOption: fae_grouped_select requires a `collection` option or `groups` and `labels` options." if !options.has_key?(:collection) && !options.has_key?(:groups) && !options.has_key?(:labels)
raise "Fae::MissingRequiredOption: fae_grouped_select required a `labels` option with a value containing an array when using the `groups` option." if options[:groups].present? && options[:labels].blank?
raise "Fae::MissingRequiredOption: fae_grouped_select required a `groups` option with a value containing an array when using the `labels` option." if options[:labels].present? && options[:groups].blank?
 
 
Severity: Minor
Found in app/helpers/fae/form_helper.rb by rubocop

Assignment Branch Condition size for fae_filter_select is too high. [25.67/15]
Open

def fae_filter_select(attribute, opts = {})
options = prepare_options_for_filter_select(attribute, opts)
# grouped_by takes priority over grouped_options
if options[:grouped_by].present?
select_options = filter_generate_select_group(options[:collection], options[:grouped_by], options[:label_method])
Severity: Minor
Found in app/helpers/fae/view_helper.rb by rubocop

Assignment Branch Condition size for validate_each is too high. [25.96/15]
Open

def validate_each(record, attribute, value)
raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected") unless value.kind_of? CarrierWave::Uploader::Base
 
value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) if value.kind_of?(String)
 
 
Severity: Minor
Found in lib/file_size_validator.rb by rubocop
Severity
Category
Status
Source
Language