Neal Chambers
|
70e765bff6
|
Safely autocorrect Style/GuardClause
Inspecting 1488 files
......................C....C.C..........................C.........C.........................C............................................C..............................................................................................................C.C........................................CC..............................C...........C...........................................................................................................................................................................................................C........................................................................................................C.......................................................C.............C...........................................................................................C..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................C...C....................................................................................................................C.............
Offenses:
app/controllers/admin/enterprises_controller.rb:50:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless params[:stimulus]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:50:7: C: [Corrected] Style/GuardClause: Use a guard clause (return unless params[:stimulus]) instead of wrapping the code inside a conditional expression.
if params[:stimulus]
^^
app/controllers/admin/enterprises_controller.rb:51:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
@enterprise.is_primary_producer = params[:is_primary_producer]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:52:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
@enterprise.sells = params[:enterprise_sells]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:53:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
render cable_ready: cable_car.morph("#side_menu", partial("admin/shared/side_menu")) ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:55:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/admin/enterprises_controller.rb:56:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/admin/enterprises_controller.rb:266:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless user_id.positive? && @enterprise.user_ids.include?(user_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:266:7: C: [Corrected] Style/GuardClause: Use a guard clause (return unless user_id.positive? && @enterprise.user_ids.include?(user_id)) instead of wrapping the code inside a conditional expression.
if user_id.positive? && @enterprise.user_ids.include?(user_id)
^^
app/controllers/admin/enterprises_controller.rb:267:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
@enterprise.update_contact(user_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:268:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/admin/enterprises_controller.rb:270:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/admin/enterprises_controller.rb:272:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless attrs[:calculator_type].present? && attrs[:calculator_attributes].present?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:272:7: C: [Corrected] Style/GuardClause: Use a guard clause (return unless attrs[:calculator_type].present? && attrs[:calculator_attributes].present?) instead of wrapping the code inside a conditional expression.
if attrs[:calculator_type].present? && attrs[:calculator_attributes].present?
^^
app/controllers/admin/enterprises_controller.rb:273:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
rule.update(calculator_type: attrs[:calculator_type])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:274:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
attrs[:calculator_attributes].merge!( id: rule.calculator.id )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:275:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/admin/enterprises_controller.rb:278:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/admin/enterprises_controller.rb:279:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if spree_current_user.admin?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:279:7: C: [Corrected] Style/GuardClause: Use a guard clause (return if spree_current_user.admin?) instead of wrapping the code inside a conditional expression.
unless spree_current_user.admin?
^^^^^^
app/controllers/admin/enterprises_controller.rb:280:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
params[:sets_enterprise_set][:collection_attributes].each do |_i, enterprise_params| ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:285:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/admin/enterprises_controller.rb:289:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/admin/enterprises_controller.rb:289:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if spree_current_user.admin? || spree_current_user == @enterprise.owner
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:289:7: C: [Corrected] Style/GuardClause: Use a guard clause (return if spree_current_user.admin? || spree_current_user == @enterprise.owner) instead of wrapping the code inside a conditional expression.
unless spree_current_user.admin? || spree_current_user == @enterprise.owner
^^^^^^
app/controllers/admin/enterprises_controller.rb:290:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
enterprise_params.delete :sells
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:291:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/admin/enterprises_controller.rb:296:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/admin/enterprises_controller.rb:299:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if spree_current_user.admin?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:299:7: C: [Corrected] Style/GuardClause: Use a guard clause (return if spree_current_user.admin?) instead of wrapping the code inside a conditional expression.
unless spree_current_user.admin?
^^^^^^
app/controllers/admin/enterprises_controller.rb:300:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
has_hub = spree_current_user.owned_enterprises.is_hub.any?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:301:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
new_enterprise_is_producer = Enterprise.new(enterprise_params).is_primary_producer
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:302:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
enterprise_params[:sells] = has_hub && !new_enterprise_is_producer ? 'any' : 'none'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:303:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/admin/enterprises_controller.rb:307:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if ( spree_current_user == @enterprise.owner ) || spree_current_user.admin?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:307:7: C: [Corrected] Style/GuardClause: Use a guard clause (return if ( spree_current_user == @enterprise.owner ) || spree_current_user.admin?) instead of wrapping the code inside a conditional expression.
unless ( spree_current_user == @enterprise.owner ) || spree_current_user.admin?
^^^^^^
app/controllers/admin/enterprises_controller.rb:308:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
enterprise_params.delete :owner_id
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:309:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/admin/enterprises_controller.rb:309:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/admin/enterprises_controller.rb:313:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if spree_current_user.admin?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:313:7: C: [Corrected] Style/GuardClause: Use a guard clause (return if spree_current_user.admin?) instead of wrapping the code inside a conditional expression.
unless spree_current_user.admin?
^^^^^^
app/controllers/admin/enterprises_controller.rb:314:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
bulk_params[:collection_attributes].each do |_i, enterprise_params| ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:316:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/admin/enterprises_controller.rb:317:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/admin/enterprises_controller.rb:321:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if ( spree_current_user == @enterprise.owner ) || spree_current_user.admin?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:321:7: C: [Corrected] Style/GuardClause: Use a guard clause (return if ( spree_current_user == @enterprise.owner ) || spree_current_user.admin?) instead of wrapping the code inside a conditional expression.
unless ( spree_current_user == @enterprise.owner ) || spree_current_user.admin?
^^^^^^
app/controllers/admin/enterprises_controller.rb:322:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
enterprise_params.delete :user_ids
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/enterprises_controller.rb:323:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/admin/enterprises_controller.rb:325:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/admin/enterprises_controller.rb:332:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/admin/order_cycles_controller.rb:185:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless json_request?
^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/order_cycles_controller.rb:185:7: C: [Corrected] Style/GuardClause: Use a guard clause (return unless json_request?) instead of wrapping the code inside a conditional expression.
if json_request?
^^
app/controllers/admin/order_cycles_controller.rb:188:9: C: [Corrected] Layout/CommentIndentation: Incorrect indentation detected (column 8 instead of 6).
# to limit returned ocs to recent or undated
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/order_cycles_controller.rb:188:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
orders_close_at_gt = raw_params[:q]&.delete(:orders_close_at_gt) || 31.days.ago
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/order_cycles_controller.rb:189:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
raw_params[:q] = { ...
^^^^^^^^^^^^^^^^^^
app/controllers/admin/order_cycles_controller.rb:194:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
@collection = collection
^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/order_cycles_controller.rb:195:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/admin/order_cycles_controller.rb:196:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/admin/order_cycles_controller.rb:248:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if Enterprise.managed_by(spree_current_user).include?(@order_cycle.coordinator)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/order_cycles_controller.rb:248:7: C: [Corrected] Style/GuardClause: Use a guard clause (return if Enterprise.managed_by(spree_current_user).include?(@order_cycle.coordinator)) instead of wrapping the code inside a conditional expression.
unless Enterprise.managed_by(spree_current_user).include?(@order_cycle.coordinator)
^^^^^^
app/controllers/admin/order_cycles_controller.rb:249:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
order_cycle_params.delete_if do |k, _v| ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/order_cycles_controller.rb:252:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/admin/order_cycles_controller.rb:254:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/admin/product_import_controller.rb:59:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if params[:file] || (params[:filepath] && File.exist?(params[:filepath]))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/product_import_controller.rb:59:7: C: [Corrected] Style/GuardClause: Use a guard clause (return if params[:file] || (params[:filepath] && File.exist?(params[:filepath]))) instead of wrapping the code inside a conditional expression.
unless params[:file] || (params[:filepath] && File.exist?(params[:filepath]))
^^^^^^
app/controllers/admin/product_import_controller.rb:60:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
redirect_to '/admin/product_import', notice: I18n.t(:product_import_file_not_found_notice)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/product_import_controller.rb:61:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/admin/product_import_controller.rb:62:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/admin/product_import_controller.rb:93:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if importer.item_count
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/product_import_controller.rb:93:7: C: [Corrected] Style/GuardClause: Use a guard clause (return if importer.item_count) instead of wrapping the code inside a conditional expression.
unless importer.item_count
^^^^^^
app/controllers/admin/product_import_controller.rb:94:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
redirect_to '/admin/product_import', ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/admin/product_import_controller.rb:96:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
true
^^^^
app/controllers/admin/product_import_controller.rb:97:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/admin/product_import_controller.rb:99:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/api/v0/shipments_controller.rb:48:11: C: Style/GuardClause: Use a guard clause (unless @shipment.can_ready?; render(json: { error: I18n.t(:cannot_ready, scope: "spree.api.shipment") },
status: :unprocessable_entity) && return; end) instead of wrapping the code inside a conditional expression.
if @shipment.can_ready?
^^
app/controllers/application_controller.rb:118:5: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if (@distributor = current_distributor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/application_controller.rb:118:5: C: [Corrected] Style/GuardClause: Use a guard clause (return if (@distributor = current_distributor)) instead of wrapping the code inside a conditional expression.
unless (@distributor = current_distributor)
^^^^^^
app/controllers/application_controller.rb:119:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
redirect_to main_app.root_path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/application_controller.rb:120:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
false
^^^^^
app/controllers/application_controller.rb:121:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/application_controller.rb:122:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/application_controller.rb:125:5: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if current_order_cycle
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/application_controller.rb:125:5: C: [Corrected] Style/GuardClause: Use a guard clause (return if current_order_cycle) instead of wrapping the code inside a conditional expression.
unless current_order_cycle
^^^^^^
app/controllers/application_controller.rb:126:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
redirect_to main_app.shop_path
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/application_controller.rb:127:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/application_controller.rb:129:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/application_controller.rb:131:5: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless current_distributor_closed?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/application_controller.rb:131:5: C: [Corrected] Style/GuardClause: Use a guard clause (return unless current_distributor_closed?) instead of wrapping the code inside a conditional expression.
if current_distributor_closed?
^^
app/controllers/application_controller.rb:132:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
current_order.empty!
^^^^^^^^^^^^^^^^^^^^
app/controllers/application_controller.rb:133:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
current_order.set_distribution! nil, nil
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/application_controller.rb:134:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
flash[:info] = I18n.t('order_cycles_closed_for_hub')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/application_controller.rb:135:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
redirect_to main_app.root_url
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/application_controller.rb:136:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/application_controller.rb:139:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/home_controller.rb:7:5: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless ContentConfig.home_show_stats
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/home_controller.rb:7:5: C: [Corrected] Style/GuardClause: Use a guard clause (return unless ContentConfig.home_show_stats) instead of wrapping the code inside a conditional expression.
if ContentConfig.home_show_stats
^^
app/controllers/home_controller.rb:8:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
@num_distributors = cached_count('distributors', Enterprise.is_distributor.activated.visible)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/home_controller.rb:9:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
@num_producers = cached_count('producers', Enterprise.is_primary_producer.activated.visible)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/home_controller.rb:10:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
@num_orders = cached_count('orders', Spree::Order.complete)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/home_controller.rb:11:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
@num_users = cached_count( ...
^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/home_controller.rb:14:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/home_controller.rb:15:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/spree/orders_controller.rb:136:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless params[:order] && params[:order][:line_items_attributes]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/spree/orders_controller.rb:136:7: C: [Corrected] Style/GuardClause: Use a guard clause (return unless params[:order] && params[:order][:line_items_attributes]) instead of wrapping the code inside a conditional expression.
if params[:order] && params[:order][:line_items_attributes]
^^
app/controllers/spree/orders_controller.rb:137:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
params[:order][:line_items_attributes] = ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/spree/orders_controller.rb:139:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/spree/orders_controller.rb:140:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/controllers/spree/orders_controller.rb:183:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless items.empty?
^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/spree/orders_controller.rb:183:7: C: [Corrected] Style/GuardClause: Use a guard clause (return unless items.empty?) instead of wrapping the code inside a conditional expression.
if items.empty?
^^
app/controllers/spree/orders_controller.rb:184:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
flash[:error] = I18n.t(:orders_cannot_remove_the_final_item)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/spree/orders_controller.rb:185:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
redirect_to main_app.order_path(order_to_update)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/controllers/spree/orders_controller.rb:186:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/controllers/spree/orders_controller.rb:188:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/models/enterprise.rb:518:5: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if owner.can_own_more_enterprises?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:518:5: C: [Corrected] Style/GuardClause: Use a guard clause (return if owner.can_own_more_enterprises?) instead of wrapping the code inside a conditional expression.
unless owner.can_own_more_enterprises?
^^^^^^
app/models/enterprise.rb:519:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
errors.add(:owner, I18n.t(:enterprise_owner_error, email: owner.email, ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:521:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/models/enterprise.rb:522:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/models/enterprise.rb:546:5: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless is_hub
^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:546:5: C: [Corrected] Style/GuardClause: Use a guard clause (return unless is_hub) instead of wrapping the code inside a conditional expression.
if is_hub
^^
app/models/enterprise.rb:547:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
enterprises.is_primary_producer.each do |enterprise| ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:553:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/models/enterprise.rb:555:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/models/enterprise.rb:557:5: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if preferred_shopfront_taxon_order =~ /\A((\d+,)*\d+)?\z/
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:557:5: C: [Corrected] Style/GuardClause: Use a guard clause (return if preferred_shopfront_taxon_order =~ /\A((\d+,)*\d+)?\z/) instead of wrapping the code inside a conditional expression.
unless preferred_shopfront_taxon_order =~ /\A((\d+,)*\d+)?\z/
^^^^^^
app/models/enterprise.rb:558:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
errors.add(:shopfront_category_ordering, "must contain a list of taxons.")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:559:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/models/enterprise.rb:562:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/models/enterprise.rb:563:5: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return if preferred_shopfront_producer_order =~ /\A((\d+,)*\d+)?\z/
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:563:5: C: [Corrected] Style/GuardClause: Use a guard clause (return if preferred_shopfront_producer_order =~ /\A((\d+,)*\d+)?\z/) instead of wrapping the code inside a conditional expression.
unless preferred_shopfront_producer_order =~ /\A((\d+,)*\d+)?\z/
^^^^^^
app/models/enterprise.rb:564:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
errors.add(:shopfront_category_ordering, "must contain a list of producers.")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise.rb:565:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/models/enterprise.rb:569:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/models/enterprise_group.rb:80:5: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless permalink.blank? || permalink_changed?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise_group.rb:80:5: C: [Corrected] Style/GuardClause: Use a guard clause (return unless permalink.blank? || permalink_changed?) instead of wrapping the code inside a conditional expression.
if permalink.blank? || permalink_changed?
^^
app/models/enterprise_group.rb:81:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
requested = permalink.presence || permalink_was.presence || name.presence || 'group'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise_group.rb:82:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
self.permalink = create_unique_permalink(requested.parameterize)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/enterprise_group.rb:83:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/models/enterprise_group.rb:84:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/models/producer_property.rb:16:5: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless name.present?
^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/producer_property.rb:16:5: C: [Corrected] Style/GuardClause: Use a guard clause (return unless name.present?) instead of wrapping the code inside a conditional expression.
if name.present?
^^
app/models/producer_property.rb:16:12: C: [Correctable] Rails/Blank: Use if name.blank? instead of unless name.present?.
return unless name.present?
^^^^^^^^^^^^^^^^^^^^
app/models/producer_property.rb:17:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
self.property = Spree::Property.find_by(name: name) || ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/producer_property.rb:19:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/models/producer_property.rb:20:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/models/product_import/entry_processor.rb:42:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless total_saved_count.zero?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/product_import/entry_processor.rb:42:7: C: [Corrected] Style/GuardClause: Use a guard clause (return unless total_saved_count.zero?) instead of wrapping the code inside a conditional expression.
if total_saved_count.zero?
^^
app/models/product_import/entry_processor.rb:43:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
@importer.errors.add(:importer, ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/product_import/entry_processor.rb:45:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/models/product_import/entry_processor.rb:46:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/models/spree/order.rb:506:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless !completed? && shipments.any?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/order.rb:506:7: C: [Corrected] Style/GuardClause: Use a guard clause (return unless !completed? && shipments.any?) instead of wrapping the code inside a conditional expression.
if !completed? && shipments.any?
^^
app/models/spree/order.rb:507:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
shipments.destroy_all
^^^^^^^^^^^^^^^^^^^^^
app/models/spree/order.rb:508:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
restart_checkout_flow
^^^^^^^^^^^^^^^^^^^^^
app/models/spree/order.rb:509:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/models/spree/order.rb:510:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/models/spree/preferences/preferable_class_methods.rb:67:9: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless method_defined? preference_description_getter_method(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/preferences/preferable_class_methods.rb:67:9: C: [Corrected] Style/GuardClause: Use a guard clause (return unless method_defined? preference_description_getter_method(name)) instead of wrapping the code inside a conditional expression.
if method_defined? preference_description_getter_method(name)
^^
app/models/spree/preferences/preferable_class_methods.rb:68:11: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
remove_method preference_description_getter_method(name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/models/spree/preferences/preferable_class_methods.rb:69:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/models/spree/preferences/preferable_class_methods.rb:70:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
app/services/order_syncer.rb:90:5: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless !pickup_to_delivery || order.shipment.blank?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/services/order_syncer.rb:90:5: C: [Corrected] Style/GuardClause: Use a guard clause (return unless !pickup_to_delivery || order.shipment.blank?) instead of wrapping the code inside a conditional expression.
if !pickup_to_delivery || order.shipment.blank?
^^
app/services/order_syncer.rb:91:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
order.updater.shipping_address_from_distributor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
app/services/order_syncer.rb:92:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
app/services/order_syncer.rb:93:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
engines/order_management/app/services/order_management/order/updater.rb:166:9: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless payment.completed? || order.completed?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
engines/order_management/app/services/order_management/order/updater.rb:166:9: C: [Corrected] Style/GuardClause: Use a guard clause (return unless payment.completed? || order.completed?) instead of wrapping the code inside a conditional expression.
if payment.completed? || order.completed?
^^
engines/order_management/app/services/order_management/order/updater.rb:167:11: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
persist_totals
^^^^^^^^^^^^^^
engines/order_management/app/services/order_management/order/updater.rb:168:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
engines/order_management/app/services/order_management/order/updater.rb:169:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
lib/discourse/single_sign_on.rb:33:9: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
raise "Bad signature for payload #{diags}" unless parsed["sso"] =~ %r{[^a-zA-Z0-9=\r\n/+]}m
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/discourse/single_sign_on.rb:33:9: C: [Corrected] Style/GuardClause: Use a guard clause (raise "Bad signature for payload #{diags}" unless parsed["sso"] =~ %r{[^a-zA-Z0-9=\r\n/+]}m) instead of wrapping the code inside a conditional expression.
if parsed["sso"] =~ %r{[^a-zA-Z0-9=\r\n/+]}m
^^
lib/discourse/single_sign_on.rb:34:11: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
raise "The SSO field should be Base64 encoded, using only A-Z, a-z, 0-9, +, /, " \ ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/discourse/single_sign_on.rb:37:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
lib/discourse/single_sign_on.rb:38:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
lib/discourse/single_sign_on.rb:39:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
lib/discourse/single_sign_on.rb:39:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
lib/discourse/single_sign_on.rb:40:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
lib/open_food_network/order_cycle_form_applicator.rb:76:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless manages_coordinator?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/open_food_network/order_cycle_form_applicator.rb:76:7: C: [Corrected] Style/GuardClause: Use a guard clause (return unless manages_coordinator?) instead of wrapping the code inside a conditional expression.
if manages_coordinator?
^^
lib/open_food_network/order_cycle_form_applicator.rb:77:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
exchange.save!
^^^^^^^^^^^^^^
lib/open_food_network/order_cycle_form_applicator.rb:78:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
ExchangeVariantBulkUpdater.new(exchange).update!(variant_ids) unless variant_ids.nil?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/open_food_network/order_cycle_form_applicator.rb:80:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
@touched_exchanges << exchange
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/open_food_network/order_cycle_form_applicator.rb:81:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
lib/open_food_network/order_cycle_form_applicator.rb:82:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
lib/open_food_network/order_cycle_form_applicator.rb:107:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless manages_coordinator?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/open_food_network/order_cycle_form_applicator.rb:107:7: C: [Corrected] Style/GuardClause: Use a guard clause (return unless manages_coordinator?) instead of wrapping the code inside a conditional expression.
if manages_coordinator?
^^
lib/open_food_network/order_cycle_form_applicator.rb:108:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
untouched_exchanges.each(&:destroy)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/open_food_network/order_cycle_form_applicator.rb:109:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
lib/open_food_network/order_cycle_form_applicator.rb:111:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
lib/spree/core/controller_helpers/respond_with.rb:42:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
raise ActionController::UnknownFormat unless format
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/spree/core/controller_helpers/respond_with.rb:42:7: C: [Corrected] Style/GuardClause: Use a guard clause (raise ActionController::UnknownFormat unless format) instead of wrapping the code inside a conditional expression.
if format
^^
lib/spree/core/controller_helpers/respond_with.rb:43:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
_process_format(format)
^^^^^^^^^^^^^^^^^^^^^^^
lib/spree/core/controller_helpers/respond_with.rb:44:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
collector
^^^^^^^^^
lib/spree/core/controller_helpers/respond_with.rb:45:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
lib/spree/core/controller_helpers/respond_with.rb:46:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
lib/spree/core/controller_helpers/respond_with.rb:46:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
lib/spree/core/controller_helpers/respond_with.rb:47:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
lib/spree/core/controller_helpers/respond_with.rb:47:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
lib/spree/core/controller_helpers/respond_with.rb:48:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
lib/spree/core/controller_helpers/respond_with.rb:48:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
spec/support/request/distribution_helper.rb:10:7: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless order_cycle && page.has_select?('order_order_cycle_id')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/support/request/distribution_helper.rb:10:7: C: [Corrected] Style/GuardClause: Use a guard clause (return unless order_cycle && page.has_select?('order_order_cycle_id')) instead of wrapping the code inside a conditional expression.
if order_cycle && page.has_select?('order_order_cycle_id')
^^
spec/support/request/distribution_helper.rb:11:9: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
select_by_value order_cycle.id, from: 'order_order_cycle_id'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/support/request/distribution_helper.rb:12:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/support/request/distribution_helper.rb:13:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
spec/support/request/shop_workflow.rb:127:5: C: [Corrected] Layout/EmptyLineAfterGuardClause: Add empty line after guard clause.
return unless oc.exchanges.from_enterprise(supplier).incoming.empty?
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/support/request/shop_workflow.rb:127:5: C: [Corrected] Style/GuardClause: Use a guard clause (return unless oc.exchanges.from_enterprise(supplier).incoming.empty?) instead of wrapping the code inside a conditional expression.
if oc.exchanges.from_enterprise(supplier).incoming.empty?
^^
spec/support/request/shop_workflow.rb:128:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
create(:exchange, order_cycle: oc, incoming: true, ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/support/request/shop_workflow.rb:130:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/support/request/shop_workflow.rb:131:1: C: [Corrected] Layout/EmptyLinesAroundMethodBody: Extra empty line detected at method body end.
spec/system/support/precompile_assets.rb:18:5: C: [Corrected] Style/GuardClause: Use a guard clause (next if Webpacker.dev_server.running?) instead of wrapping the code inside a conditional expression.
if Webpacker.dev_server.running?
^^
spec/system/support/precompile_assets.rb:19:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/support/precompile_assets.rb:20:1: C: [Corrected] Layout/EmptyLines: Extra blank line detected.
spec/system/support/precompile_assets.rb:20:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
spec/system/support/precompile_assets.rb:21:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
$stdout.puts "\n Precompiling assets.\n"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/system/support/precompile_assets.rb:23:7: C: [Corrected] Layout/IndentationConsistency: Inconsistent indentation detected.
Webpacker.compile
^^^^^^^^^^^^^^^^^
spec/system/support/precompile_assets.rb:24:1: C: [Corrected] Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body end.
spec/system/support/precompile_assets.rb:24:1: C: [Corrected] Layout/TrailingWhitespace: Trailing whitespace detected.
1488 files inspected, 220 offenses detected, 218 offenses corrected, 1 more offense can be corrected with `rubocop -A`
|
2023-09-01 08:55:56 +09:00 |
|
Matt-Yorkley
|
1ee3d0f7a1
|
Drop embedded shops code
|
2022-01-26 19:58:39 +00:00 |
|
Matt-Yorkley
|
dfbd384c95
|
Refactor embedding to a Concern
|
2022-01-18 12:22:06 +00:00 |
|
Luis Ramos
|
e52937c113
|
Use rubocop auto correct to add frozen string literal to all files
This is an unsafe auto corection, we will need to trust our build here
|
2021-06-17 23:07:26 +01:00 |
|
Luis Ramos
|
8fac1bc9ca
|
Move unauthorized view to HomeController only, all other calls to unauthorized will go through Auth which will redirect to the home controller IF the user is logged in or to login if user is not logged in
|
2020-07-15 14:54:52 +01:00 |
|
Luis Ramos
|
8a61257547
|
Rename all before_filter to before_action, it's the same function with a new name
|
2020-06-22 13:11:57 +01:00 |
|
Matt-Yorkley
|
37821beb1b
|
Extract home stats caching to method in service
|
2020-05-07 13:20:30 +02:00 |
|
Matt-Yorkley
|
545ca85644
|
Extract caching of homepage stats to service
|
2020-05-07 13:11:28 +02:00 |
|
Matt-Yorkley
|
adb61e48c5
|
Cache counts used in homepage for 24 hours
|
2020-04-02 19:09:03 +02:00 |
|
luisramos0
|
86b0d71c7e
|
Result of rubocop auto-correct and rebuilding rubocop_manual_todo
|
2019-05-28 12:57:29 +01:00 |
|
Rob Harrington
|
4fa09639cb
|
Rewrite user stat query for improved performance of homepage
|
2018-06-06 16:27:23 +10:00 |
|
Matt-Yorkley
|
113f6565be
|
Enable iframes for embedded shopfronts
|
2017-07-26 13:56:36 +10:00 |
|
Rohan Mitchell
|
0830a5bd85
|
Add basic sell page
Conflicts:
config/routes.rb
|
2016-08-05 12:33:09 +10:00 |
|
Rohan Mitchell
|
5de9a5eb54
|
Add config setting to enable/disable stats on home page
|
2015-07-17 16:06:49 +10:00 |
|
Rohan Mitchell
|
d67b34c2bd
|
Remove deprecated about_us page and add redirect
|
2015-07-10 09:42:09 +10:00 |
|
Rohan Mitchell
|
5175fe9a03
|
Make stats more accurate by excluding invisible, inactivated enterprises and incomplete orders
|
2015-06-11 12:53:23 +10:00 |
|
Rohan Mitchell
|
610a4c03fe
|
Merge branch 'master' into redesign
Conflicts:
app/controllers/home_controller.rb
app/views/producers/index.html.haml
app/views/shared/menu/_mobile_menu.html.haml
app/views/shop/products/_form.html.haml
config/routes.rb
spec/controllers/shops_controller_spec.rb
|
2015-06-10 18:27:50 +10:00 |
|
Rohan Mitchell
|
704955a185
|
Load active distributors where they're needed rather than in most controllers
|
2015-05-27 15:44:01 +10:00 |
|
Rohan Mitchell
|
1ffba674b3
|
Show real stats on home page
|
2015-05-06 14:54:16 +10:00 |
|
Will Marshall
|
b9561ecf20
|
Minor refactoring from code review with Rohan
|
2014-06-19 11:41:24 +10:00 |
|
Will Marshall
|
224a70c11f
|
Refactoring JSON injection a bit further
|
2014-06-18 16:43:57 +10:00 |
|
Will Marshall
|
deb6c8a05a
|
Refactoring the RABL injection and the Hubs/Producers/Enterprises services
|
2014-06-18 15:40:02 +10:00 |
|
Will Marshall
|
0df2eabf95
|
Moving useless assets
|
2014-05-09 10:32:39 +10:00 |
|
Will Marshall
|
f9b7b602da
|
Moving from darkswarm to home
|
2014-04-24 16:53:00 +10:00 |
|
Rohan Mitchell
|
fc8c82d5d2
|
Display enterprise groups on home page by position
|
2013-10-30 14:48:04 +11:00 |
|
Rohan Mitchell
|
57a450b0aa
|
Load landing page distributors from enterprise groups instead of yaml file
|
2013-10-30 13:55:47 +11:00 |
|
Rohan Mitchell
|
803594b4d7
|
Confirm change hub when it would empty cart
|
2013-09-23 10:07:25 +10:00 |
|
alexs
|
acfb1bd600
|
Making sure that only distributor enterprises are displayed on the landing page.
|
2013-08-21 12:03:44 +10:00 |
|
alexs
|
f160e051e5
|
Added new temporary landing page.
|
2013-08-19 17:37:22 +10:00 |
|
alexs
|
215d6030d7
|
Added link to 'About OFN' page (as well as the base for that page).
|
2013-08-13 11:36:24 +10:00 |
|
alexs
|
38b0a581e0
|
New landing page - initial layout and functionality
|
2013-08-05 17:04:56 +10:00 |
|