From 4e9c21d525d395c9aa0eeb25f764095a7447b42a Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Mon, 22 Jun 2020 13:28:43 +0100 Subject: [PATCH] Add new regenerated rubocop_todo --- .rubocop_todo.yml | 436 ++++++++++++---------------------------------- 1 file changed, 109 insertions(+), 327 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 1c482dbc82..1be528994c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,114 +1,42 @@ # This configuration was generated by # `rubocop --auto-gen-config --exclude-limit 1400` -# on 2020-02-22 11:23:29 +0000 using RuboCop version 0.80.0. +# on 2020-06-22 13:28:10 +0100 using RuboCop version 0.81.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 6 -# Cop supports --auto-correct. -Layout/EmptyLineAfterGuardClause: - Exclude: - - 'lib/open_food_network/bulk_coop_report.rb' - - 'lib/open_food_network/orders_and_fulfillments_report.rb' - - 'lib/open_food_network/packing_report.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -Layout/EmptyLines: - Exclude: - - 'app/models/spree/adjustment_decorator.rb' - - 'spec/features/admin/order_cycles_spec.rb' - # Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: empty_lines, no_empty_lines -Layout/EmptyLinesAroundBlockBody: +# Configuration parameters: EnforcedStyleAlignWith. +# SupportedStylesAlignWith: either, start_of_block, start_of_line +Layout/BlockAlignment: Exclude: - - 'spec/controllers/api/orders_controller_spec.rb' + - 'lib/discourse/single_sign_on.rb' # Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity. -# SupportedStylesAlignWith: keyword, variable, start_of_line -Layout/EndAlignment: - Exclude: - - 'lib/open_food_network/permalink_generator.rb' - -# Offense count: 2 -# Cop supports --auto-correct. # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. # SupportedHashRocketStyles: key, separator, table # SupportedColonStyles: key, separator, table # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit Layout/HashAlignment: Exclude: - - 'spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb' + - 'app/services/line_item_syncer.rb' -# Offense count: 8 -# Cop supports --auto-correct. -# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment. -Layout/LeadingCommentSpace: - Exclude: - - 'Gemfile' - - 'app/helpers/application_helper.rb' - - 'app/models/enterprise.rb' - -# Offense count: 3 +# Offense count: 139 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Layout/LineLength: - Max: 115 - -# Offense count: 1 -# Cop supports --auto-correct. -Layout/SpaceAfterColon: - Exclude: - - 'lib/open_food_network/order_cycle_form_applicator.rb' + Max: 268 # Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator. -# SupportedStylesForExponentOperator: space, no_space -Layout/SpaceAroundOperators: - Exclude: - - 'app/services/cart_service.rb' - - 'spec/support/cancan_helper.rb' - -# Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. -# SupportedStyles: space, no_space, compact -# SupportedStylesForEmptyBraces: space, no_space -Layout/SpaceInsideHashLiteralBraces: - Exclude: - - 'spec/controllers/checkout_controller_spec.rb' - -# Offense count: 2 -Lint/AmbiguousOperator: - Exclude: - - 'spec/controllers/api/enterprise_fees_controller_spec.rb' - - 'spec/controllers/spree/admin/payments_controller_spec.rb' - -# Offense count: 2 -Lint/Debugger: - Exclude: - - 'app/services/order_factory.rb' - -# Offense count: 1 -Lint/DuplicateHashKey: - Exclude: - - 'spec/models/calculator/weight_spec.rb' - -# Offense count: 4 Lint/DuplicateMethods: Exclude: - 'lib/discourse/single_sign_on.rb' -# Offense count: 10 +# Offense count: 9 Lint/IneffectiveAccessModifier: Exclude: - 'app/models/column_preference.rb' @@ -118,17 +46,12 @@ Lint/IneffectiveAccessModifier: - 'spec/lib/open_food_network/reports/report_spec.rb' # Offense count: 1 -Lint/InterpolationCheck: - Exclude: - - 'spec/features/consumer/shopping/embedded_groups_spec.rb' - -# Offense count: 3 # Cop supports --auto-correct. -Lint/NonDeterministicRequireOrder: +# Configuration parameters: AllowedMethods. +# AllowedMethods: present?, blank?, presence, try, try! +Lint/SafeNavigationConsistency: Exclude: - - 'engines/order_management/spec/spec_helper.rb' - - 'engines/web/spec/spec_helper.rb' - - 'spec/spec_helper.rb' + - 'app/models/product_import/product_importer.rb' # Offense count: 3 Lint/ShadowingOuterLocalVariable: @@ -152,21 +75,16 @@ Lint/UselessAccessModifier: - 'lib/open_food_network/reports/bulk_coop_report.rb' - 'spec/lib/open_food_network/reports/report_spec.rb' -# Offense count: 1 -Lint/UselessAssignment: - Exclude: - - 'spec/**/*' - - 'app/models/enterprise.rb' - # Offense count: 1 # Configuration parameters: CheckForMethodsWithNoSideEffects. Lint/Void: Exclude: - 'app/serializers/api/enterprise_serializer.rb' -# Offense count: 1 +# Offense count: 6 +# Configuration parameters: IgnoredMethods. Metrics/AbcSize: - Max: 16 + Max: 37 # Offense count: 1 # Configuration parameters: CountComments, ExcludedMethods. @@ -174,6 +92,21 @@ Metrics/AbcSize: Metrics/BlockLength: Max: 27 +# Offense count: 1 +# Configuration parameters: CountComments. +Metrics/ClassLength: + Max: 101 + +# Offense count: 1 +# Configuration parameters: IgnoredMethods. +Metrics/CyclomaticComplexity: + Max: 7 + +# Offense count: 6 +# Configuration parameters: CountComments, ExcludedMethods. +Metrics/MethodLength: + Max: 20 + # Offense count: 1 # Configuration parameters: CountComments. Metrics/ModuleLength: @@ -195,26 +128,26 @@ Naming/HeredocDelimiterNaming: Exclude: - 'app/models/content_configuration.rb' -# Offense count: 3 +# Offense count: 4 # Configuration parameters: EnforcedStyleForLeadingUnderscores. # SupportedStylesForLeadingUnderscores: disallowed, required, optional Naming/MemoizedInstanceVariableName: Exclude: + - 'app/mailers/producer_mailer.rb' - 'lib/open_food_network/address_finder.rb' -# Offense count: 7 +# Offense count: 6 # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. # AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp Naming/MethodParameterName: Exclude: - 'app/helpers/spree/base_helper_decorator.rb' - - 'engines/order_management/app/services/order_management/subscriptions/validator.rb' - 'lib/open_food_network/reports/bulk_coop_report.rb' - 'lib/open_food_network/xero_invoices_report.rb' - 'spec/lib/open_food_network/reports/report_spec.rb' - 'spec/mailers/producer_mailer_spec.rb' -# Offense count: 22 +# Offense count: 19 # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. # NamePrefix: is_, has_, have_ # ForbiddenPrefixes: is_, has_, have_ @@ -232,7 +165,6 @@ Naming/PredicateName: - 'app/models/spree/order_decorator.rb' - 'app/models/spree/payment_method_decorator.rb' - 'app/models/spree/preferences/file_configuration.rb' - - 'app/models/spree/product_decorator.rb' - 'app/models/spree/shipping_method_decorator.rb' - 'lib/open_food_network/customers_report.rb' - 'lib/open_food_network/order_cycle_management_report.rb' @@ -240,142 +172,12 @@ Naming/PredicateName: - 'lib/open_food_network/packing_report.rb' - 'lib/tasks/data.rake' -# Offense count: 154 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, Include. -# SupportedStyles: action, filter -# Include: app/controllers/**/*.rb -Rails/ActionFilter: +# Offense count: 6 +# Configuration parameters: EnforcedStyle. +# SupportedStyles: snake_case, normalcase, non_integer +Naming/VariableNumber: Exclude: - - 'app/controllers/admin/column_preferences_controller.rb' - - 'app/controllers/admin/customers_controller.rb' - - 'app/controllers/admin/enterprise_fees_controller.rb' - - 'app/controllers/admin/enterprise_groups_controller.rb' - - 'app/controllers/admin/enterprises_controller.rb' - - 'app/controllers/admin/order_cycles_controller.rb' - - 'app/controllers/admin/producer_properties_controller.rb' - - 'app/controllers/admin/product_import_controller.rb' - - 'app/controllers/admin/schedules_controller.rb' - - 'app/controllers/admin/stripe_connect_settings_controller.rb' - - 'app/controllers/admin/subscription_line_items_controller.rb' - - 'app/controllers/admin/subscriptions_controller.rb' - - 'app/controllers/admin/variant_overrides_controller.rb' - - 'app/controllers/api/base_controller.rb' - - 'app/controllers/api/enterprise_attachment_controller.rb' - - 'app/controllers/api/enterprises_controller.rb' - - 'app/controllers/api/shipments_controller.rb' - - 'app/controllers/api/variants_controller.rb' - - 'app/controllers/application_controller.rb' - - 'app/controllers/base_controller.rb' - - 'app/controllers/cart_controller.rb' - - 'app/controllers/checkout_controller.rb' - - 'app/controllers/discourse_sso_controller.rb' - - 'app/controllers/enterprises_controller.rb' - - 'app/controllers/home_controller.rb' - - 'app/controllers/line_items_controller.rb' - - 'app/controllers/producers_controller.rb' - - 'app/controllers/registration_controller.rb' - - 'app/controllers/shop_controller.rb' - - 'app/controllers/shops_controller.rb' - - 'app/controllers/spree/admin/adjustments_controller.rb' - - 'app/controllers/spree/admin/base_controller.rb' - - 'app/controllers/spree/admin/images_controller.rb' - - 'app/controllers/spree/admin/mail_methods_controller.rb' - - 'app/controllers/spree/admin/orders/customer_details_controller.rb' - - 'app/controllers/spree/admin/orders_controller.rb' - - 'app/controllers/spree/admin/payment_methods_controller.rb' - - 'app/controllers/spree/admin/payments_controller.rb' - - 'app/controllers/spree/admin/product_properties_controller.rb' - - 'app/controllers/spree/admin/products_controller.rb' - - 'app/controllers/spree/admin/reports/enterprise_fee_summaries_controller.rb' - - 'app/controllers/spree/admin/reports_controller.rb' - - 'app/controllers/spree/admin/resource_controller.rb' - - 'app/controllers/spree/admin/search_controller.rb' - - 'app/controllers/spree/admin/shipping_methods_controller.rb' - - 'app/controllers/spree/admin/states_controller.rb' - - 'app/controllers/spree/admin/tax_rates_controller.rb' - - 'app/controllers/spree/admin/users_controller.rb' - - 'app/controllers/spree/admin/zones_controller.rb' - - 'app/controllers/spree/orders_controller.rb' - - 'app/controllers/spree/store_controller.rb' - - 'app/controllers/spree/user_registrations_controller.rb' - - 'app/controllers/spree/user_sessions_controller.rb' - - 'app/controllers/spree/users_controller.rb' - - 'app/controllers/stripe/webhooks_controller.rb' - - 'app/controllers/user_passwords_controller.rb' - - 'app/controllers/user_registrations_controller.rb' - -# Offense count: 192 -# Cop supports --auto-correct. -Rails/ActiveRecordAliases: - Exclude: - - 'app/controllers/admin/bulk_line_items_controller.rb' - - 'app/controllers/admin/enterprises_controller.rb' - - 'app/controllers/admin/subscriptions_controller.rb' - - 'app/controllers/api/customers_controller.rb' - - 'app/controllers/api/enterprise_attachment_controller.rb' - - 'app/controllers/api/enterprises_controller.rb' - - 'app/controllers/api/product_images_controller.rb' - - 'app/controllers/api/products_controller.rb' - - 'app/controllers/api/shipments_controller.rb' - - 'app/controllers/api/taxons_controller.rb' - - 'app/controllers/api/variants_controller.rb' - - 'app/controllers/checkout_controller.rb' - - 'app/controllers/spree/admin/orders/customer_details_controller.rb' - - 'app/controllers/spree/admin/orders_controller.rb' - - 'app/controllers/spree/admin/payment_methods_controller.rb' - - 'app/controllers/spree/admin/resource_controller.rb' - - 'app/controllers/spree/admin/taxons_controller.rb' - - 'app/controllers/spree/admin/users_controller.rb' - - 'app/controllers/spree/credit_cards_controller.rb' - - 'app/controllers/spree/orders_controller.rb' - - 'app/controllers/spree/users_controller.rb' - - 'app/helpers/i18n_helper.rb' - - 'app/jobs/subscription_placement_job.rb' - - 'app/models/spree/adjustment_decorator.rb' - - 'app/models/spree/line_item_decorator.rb' - - 'app/models/spree/product_set.rb' - - 'app/services/line_item_syncer.rb' - - 'app/services/order_factory.rb' - - 'app/services/order_syncer.rb' - - 'app/services/user_default_address_setter.rb' - - 'lib/open_food_network/order_cycle_form_applicator.rb' - - 'lib/open_food_network/subscription_payment_updater.rb' - - 'lib/stripe/profile_storer.rb' - - 'spec/controllers/admin/proxy_orders_controller_spec.rb' - - 'spec/controllers/admin/subscriptions_controller_spec.rb' - - 'spec/controllers/api/orders_controller_spec.rb' - - 'spec/controllers/line_items_controller_spec.rb' - - 'spec/controllers/spree/admin/payment_methods_controller_spec.rb' - - 'spec/controllers/spree/orders_controller_spec.rb' - - 'spec/features/admin/order_cycles_spec.rb' - - 'spec/features/admin/subscriptions_spec.rb' - - 'spec/features/admin/variant_overrides_spec.rb' - - 'spec/features/admin/variants_spec.rb' - - 'spec/features/consumer/account_spec.rb' - - 'spec/features/consumer/registration_spec.rb' - - 'spec/features/consumer/shopping/cart_spec.rb' - - 'spec/features/consumer/shopping/orders_spec.rb' - - 'spec/features/consumer/shopping/shopping_spec.rb' - - 'spec/jobs/subscription_confirm_job_spec.rb' - - 'spec/jobs/subscription_placement_job_spec.rb' - - 'spec/lib/open_food_network/proxy_order_syncer_spec.rb' - - 'spec/models/customer_spec.rb' - - 'spec/models/enterprise_caching_spec.rb' - - 'spec/models/exchange_spec.rb' - - 'spec/models/order_cycle_spec.rb' - - 'spec/models/producer_property_spec.rb' - - 'spec/models/proxy_order_spec.rb' - - 'spec/models/spree/adjustment_spec.rb' - - 'spec/models/spree/credit_card_spec.rb' - - 'spec/models/spree/line_item_spec.rb' - - 'spec/models/spree/order_spec.rb' - - 'spec/models/spree/product_spec.rb' - - 'spec/models/spree/user_spec.rb' - - 'spec/models/spree/variant_spec.rb' - - 'spec/requests/checkout/stripe_connect_spec.rb' - - 'spec/services/order_syncer_spec.rb' - - 'spec/services/subscription_estimator_spec.rb' + - 'spec/features/admin/orders_spec.rb' # Offense count: 1 # Configuration parameters: EnforcedStyle. @@ -384,17 +186,13 @@ Rails/Date: Exclude: - 'app/models/order_cycle.rb' -# Offense count: 5 +# Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: Whitelist. # Whitelist: find_by_sql Rails/DynamicFindBy: Exclude: - 'app/controllers/spree/admin/orders/customer_details_controller.rb' - - 'app/controllers/spree/admin/orders_controller.rb' - - 'app/controllers/spree/admin/payments_controller.rb' - - 'app/controllers/spree/admin/products_controller.rb' - - 'spec/support/request/web_helper.rb' # Offense count: 16 # Configuration parameters: EnforcedStyle. @@ -426,19 +224,25 @@ Rails/FindBy: - 'app/models/product_import/spreadsheet_data.rb' - 'app/models/spree/user.rb' -# Offense count: 7 +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: Include. +# Include: app/models/**/*.rb +Rails/FindEach: + Exclude: + - 'app/models/spree/order_decorator.rb' + +# Offense count: 5 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/HasAndBelongsToMany: Exclude: - 'app/models/enterprise.rb' - 'app/models/enterprise_group.rb' - - 'app/models/order_cycle.rb' - - 'app/models/schedule.rb' - 'app/models/spree/concerns/payment_method_distributors.rb' - 'app/models/spree/line_item_decorator.rb' -# Offense count: 24 +# Offense count: 25 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/HasManyOrHasOneDependent: @@ -449,13 +253,13 @@ Rails/HasManyOrHasOneDependent: - 'app/models/spree/adjustment_decorator.rb' - 'app/models/spree/order_decorator.rb' - 'app/models/spree/payment_method_decorator.rb' - - 'app/models/spree/property_decorator.rb' + - 'app/models/spree/property.rb' - 'app/models/spree/shipping_method_decorator.rb' - 'app/models/spree/user.rb' - 'app/models/spree/variant_decorator.rb' - 'app/models/subscription.rb' -# Offense count: 83 +# Offense count: 84 # Configuration parameters: Include. # Include: app/helpers/**/*.rb Rails/HelperInstanceVariable: @@ -471,12 +275,30 @@ Rails/HelperInstanceVariable: - 'app/helpers/spree/admin/orders_helper.rb' - 'app/helpers/spree/orders_helper.rb' -# Offense count: 1 +# Offense count: 35 # Configuration parameters: Include. -# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb -Rails/Output: +# Include: app/controllers/**/*.rb +Rails/LexicallyScopedActionFilter: Exclude: - - 'app/services/order_factory.rb' + - 'app/controllers/admin/enterprise_groups_controller.rb' + - 'app/controllers/admin/enterprises_controller.rb' + - 'app/controllers/admin/order_cycles_controller.rb' + - 'app/controllers/admin/producer_properties_controller.rb' + - 'app/controllers/admin/product_import_controller.rb' + - 'app/controllers/admin/schedules_controller.rb' + - 'app/controllers/admin/subscriptions_controller.rb' + - 'app/controllers/registration_controller.rb' + - 'app/controllers/spree/admin/adjustments_controller.rb' + - 'app/controllers/spree/admin/payment_methods_controller.rb' + - 'app/controllers/spree/admin/payments_controller.rb' + - 'app/controllers/spree/admin/product_properties_controller.rb' + - 'app/controllers/spree/admin/products_controller.rb' + - 'app/controllers/spree/admin/search_controller.rb' + - 'app/controllers/spree/admin/shipping_methods_controller.rb' + - 'app/controllers/spree/admin/users_controller.rb' + - 'app/controllers/spree/admin/zones_controller.rb' + - 'app/controllers/spree/users_controller.rb' + - 'app/controllers/user_passwords_controller.rb' # Offense count: 12 Rails/OutputSafety: @@ -490,13 +312,14 @@ Rails/OutputSafety: - 'app/helpers/spree/reports_helper.rb' - 'app/serializers/api/product_serializer.rb' - 'lib/spree/money_decorator.rb' - - 'spec/features/admin/orders_spec.rb' + - 'spec/features/admin/order_print_ticket_spec.rb' # Offense count: 2 # Configuration parameters: Include. # Include: **/Rakefile, **/*.rake Rails/RakeEnvironment: Exclude: + - 'lib/capistrano/tasks/**/*.rake' - 'lib/tasks/specs.rake' # Offense count: 9 @@ -507,7 +330,7 @@ Rails/ReflectionClassName: - 'app/models/enterprise_role.rb' - 'app/models/subscription.rb' -# Offense count: 213 +# Offense count: 227 # Configuration parameters: Blacklist, Whitelist. # Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters Rails/SkipsModelValidations: @@ -527,10 +350,13 @@ Rails/SkipsModelValidations: - 'app/models/spree/credit_card_decorator.rb' - 'app/models/spree/order_decorator.rb' - 'app/models/spree/payment_decorator.rb' + - 'app/models/spree/shipping_method_decorator.rb' - 'app/models/subscription.rb' - 'app/models/variant_override.rb' - 'app/services/order_factory.rb' + - 'engines/order_management/spec/performance/order_management/subscriptions/proxy_order_syncer_spec.rb' - 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb' + - 'engines/order_management/spec/services/order_management/subscriptions/stripe_payment_setup_spec.rb' - 'lib/tasks/data/anonymize_data.rake' - 'lib/tasks/sample_data/product_factory.rb' - 'lib/tasks/users.rake' @@ -552,9 +378,12 @@ Rails/SkipsModelValidations: - 'spec/features/admin/bulk_order_management_spec.rb' - 'spec/features/admin/bulk_product_update_spec.rb' - 'spec/features/admin/configuration/tax_rates_spec.rb' - - 'spec/features/admin/order_cycles_spec.rb' - - 'spec/features/admin/orders_spec.rb' + - 'spec/features/admin/order_cycles/complex_editing_spec.rb' + - 'spec/features/admin/order_cycles/simple_spec.rb' + - 'spec/features/admin/order_spec.rb' + - 'spec/features/admin/payments_spec.rb' - 'spec/features/admin/reports_spec.rb' + - 'spec/features/consumer/caching/shops_caching_spec.rb' - 'spec/features/consumer/shopping/checkout_spec.rb' - 'spec/features/consumer/shopping/products_spec.rb' - 'spec/features/consumer/shopping/shopping_spec.rb' @@ -566,7 +395,7 @@ Rails/SkipsModelValidations: - 'spec/lib/open_food_network/permissions_spec.rb' - 'spec/lib/open_food_network/products_and_inventory_report_spec.rb' - 'spec/lib/open_food_network/scope_variant_to_hub_spec.rb' - - 'spec/lib/open_food_network/subscription_payment_updater_spec.rb' + - 'spec/lib/stripe/credit_card_cloner_spec.rb' - 'spec/models/calculator/weight_spec.rb' - 'spec/models/concerns/variant_stock_spec.rb' - 'spec/models/enterprise_relationship_spec.rb' @@ -574,18 +403,27 @@ Rails/SkipsModelValidations: - 'spec/models/spree/adjustment_spec.rb' - 'spec/models/spree/line_item_spec.rb' - 'spec/models/spree/order_spec.rb' - - 'spec/models/spree/product_spec.rb' - 'spec/models/spree/variant_spec.rb' - 'spec/models/tag_rule/discount_order_spec.rb' - - 'spec/performance/proxy_order_syncer_spec.rb' - 'spec/serializers/api/admin/subscription_line_item_serializer_spec.rb' + - 'spec/services/cache_service_spec.rb' + - 'spec/services/order_cart_reset_spec.rb' + - 'spec/services/order_checkout_restart_spec.rb' - 'spec/services/order_cycle_distributed_products_spec.rb' - 'spec/services/order_factory_spec.rb' - 'spec/services/order_syncer_spec.rb' - 'spec/services/product_tag_rules_filterer_spec.rb' - 'spec/services/products_renderer_spec.rb' - - 'spec/services/restart_checkout_spec.rb' - 'spec/support/request/shop_workflow.rb' + - 'spec/views/spree/shared/_order_details.html.haml_spec.rb' + +# Offense count: 2 +# Configuration parameters: Include. +# Include: app/models/**/*.rb +Rails/UniqueValidationWithoutIndex: + Exclude: + - 'app/models/customer.rb' + - 'app/models/exchange.rb' # Offense count: 1 # Configuration parameters: Environments. @@ -600,13 +438,12 @@ Style/CaseEquality: - 'app/helpers/angular_form_helper.rb' - 'spec/models/spree/payment_spec.rb' -# Offense count: 76 +# Offense count: 75 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, EnforcedStyle. # SupportedStyles: nested, compact Style/ClassAndModuleChildren: Exclude: - - 'app/helpers/angular_form_helper.rb' - 'app/models/calculator/flat_percent_per_item.rb' - 'app/models/spree/concerns/payment_method_distributors.rb' - 'app/models/spree/gateway/migs.rb' @@ -698,16 +535,15 @@ Style/ConditionalAssignment: Exclude: - 'app/controllers/api/taxons_controller.rb' -# Offense count: 6 +# Offense count: 4 # Configuration parameters: EnforcedStyle. # SupportedStyles: annotated, template, unannotated Style/FormatStringToken: Exclude: - - 'app/helpers/order_cycles_helper.rb' - 'lib/open_food_network/sales_tax_report.rb' - 'spec/features/admin/bulk_order_management_spec.rb' -# Offense count: 920 +# Offense count: 874 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: always, always_true, never @@ -742,7 +578,6 @@ Style/FrozenStringLiteralComment: - 'app/controllers/admin/variant_overrides_controller.rb' - 'app/controllers/api/base_controller.rb' - 'app/controllers/api/customers_controller.rb' - - 'app/controllers/api/enterprise_attachment_controller.rb' - 'app/controllers/api/enterprise_fees_controller.rb' - 'app/controllers/api/enterprises_controller.rb' - 'app/controllers/api/logos_controller.rb' @@ -786,7 +621,6 @@ Style/FrozenStringLiteralComment: - 'app/controllers/spree/admin/product_properties_controller.rb' - 'app/controllers/spree/admin/products_controller.rb' - 'app/controllers/spree/admin/properties_controller.rb' - - 'app/controllers/spree/admin/reports/enterprise_fee_summaries_controller.rb' - 'app/controllers/spree/admin/reports_controller.rb' - 'app/controllers/spree/admin/resource_controller.rb' - 'app/controllers/spree/admin/return_authorizations_controller.rb' @@ -847,7 +681,6 @@ Style/FrozenStringLiteralComment: - 'app/helpers/spree/api/api_helpers.rb' - 'app/helpers/spree/base_helper_decorator.rb' - 'app/helpers/spree/orders_helper.rb' - - 'app/helpers/spree/products_helper_decorator.rb' - 'app/helpers/spree/reports_helper.rb' - 'app/helpers/spree_currency_helper.rb' - 'app/jobs/confirm_order_job.rb' @@ -935,7 +768,6 @@ Style/FrozenStringLiteralComment: - 'app/models/spree/gateway_decorator.rb' - 'app/models/spree/image_decorator.rb' - 'app/models/spree/line_item_decorator.rb' - - 'app/models/spree/money_decorator.rb' - 'app/models/spree/option_type_decorator.rb' - 'app/models/spree/order_decorator.rb' - 'app/models/spree/payment_decorator.rb' @@ -947,9 +779,7 @@ Style/FrozenStringLiteralComment: - 'app/models/spree/product_property_decorator.rb' - 'app/models/spree/product_set.rb' - 'app/models/spree/property.rb' - - 'app/models/spree/property_decorator.rb' - 'app/models/spree/shipment_decorator.rb' - - 'app/models/spree/shipping_category_decorator.rb' - 'app/models/spree/shipping_method_decorator.rb' - 'app/models/spree/stock/availability_validator_decorator.rb' - 'app/models/spree/stock_location_decorator.rb' @@ -1072,8 +902,6 @@ Style/FrozenStringLiteralComment: - 'app/services/permissions/order.rb' - 'app/services/product_tag_rules_filterer.rb' - 'app/services/products_renderer.rb' - - 'app/services/reset_order_service.rb' - - 'app/services/restart_checkout.rb' - 'app/services/search_orders.rb' - 'app/services/tax_rate_finder.rb' - 'app/services/upload_sanitizer.rb' @@ -1112,7 +940,6 @@ Style/FrozenStringLiteralComment: - 'engines/order_management/lib/order_management/engine.rb' - 'engines/order_management/lib/order_management/version.rb' - 'engines/order_management/order_management.gemspec' - - 'engines/order_management/spec/performance/order_management/subscriptions/proxy_order_syncer_spec.rb' - 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/authorizer_spec.rb' - 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/parameters_spec.rb' - 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/permissions_spec.rb' @@ -1120,7 +947,6 @@ Style/FrozenStringLiteralComment: - 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/renderers/html_renderer_spec.rb' - 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_data/enterprise_fee_type_total_spec.rb' - 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb' - - 'engines/order_management/spec/spec_helper.rb' - 'engines/web/app/controllers/web/angular_templates_controller.rb' - 'engines/web/app/controllers/web/api/cookies_consent_controller.rb' - 'engines/web/app/controllers/web/application_controller.rb' @@ -1131,7 +957,6 @@ Style/FrozenStringLiteralComment: - 'engines/web/lib/web/engine.rb' - 'engines/web/lib/web/version.rb' - 'engines/web/spec/helpers/cookies_policy_helper_spec.rb' - - 'engines/web/spec/spec_helper.rb' - 'engines/web/web.gemspec' - 'lib/discourse/single_sign_on.rb' - 'lib/open_food_network/address_finder.rb' @@ -1184,7 +1009,6 @@ Style/FrozenStringLiteralComment: - 'lib/open_food_network/scope_variant_to_hub.rb' - 'lib/open_food_network/scope_variants_for_search.rb' - 'lib/open_food_network/spree_api_key_loader.rb' - - 'lib/open_food_network/subscription_payment_updater.rb' - 'lib/open_food_network/tag_rule_applicator.rb' - 'lib/open_food_network/user_balance_calculator.rb' - 'lib/open_food_network/users_and_enterprises_report.rb' @@ -1204,7 +1028,6 @@ Style/FrozenStringLiteralComment: - 'lib/stripe/webhook_handler.rb' - 'lib/tasks/data.rake' - 'lib/tasks/data/anonymize_data.rake' - - 'lib/tasks/data/truncate_data.rake' - 'lib/tasks/enterprises.rake' - 'lib/tasks/karma.rake' - 'lib/tasks/missing_payments.rake' @@ -1245,7 +1068,6 @@ Style/FrozenStringLiteralComment: - 'spec/controllers/api/customers_controller_spec.rb' - 'spec/controllers/api/enterprise_fees_controller_spec.rb' - 'spec/controllers/api/enterprises_controller_spec.rb' - - 'spec/controllers/api/exchange_products_controller_spec.rb' - 'spec/controllers/api/logos_controller_spec.rb' - 'spec/controllers/api/order_cycles_controller_spec.rb' - 'spec/controllers/api/orders_controller_spec.rb' @@ -1278,7 +1100,6 @@ Style/FrozenStringLiteralComment: - 'spec/controllers/spree/admin/payment_methods_controller_spec.rb' - 'spec/controllers/spree/admin/payments_controller_spec.rb' - 'spec/controllers/spree/admin/products_controller_spec.rb' - - 'spec/controllers/spree/admin/reports/enterprise_fee_summaries_controller_spec.rb' - 'spec/controllers/spree/admin/reports_controller_spec.rb' - 'spec/controllers/spree/admin/search_controller_spec.rb' - 'spec/controllers/spree/admin/shipping_methods_controller_spec.rb' @@ -1333,14 +1154,11 @@ Style/FrozenStringLiteralComment: - 'spec/features/admin/external_services_spec.rb' - 'spec/features/admin/image_settings_spec.rb' - 'spec/features/admin/multilingual_spec.rb' - - 'spec/features/admin/order_cycles_spec.rb' - - 'spec/features/admin/orders_spec.rb' - 'spec/features/admin/overview_spec.rb' - 'spec/features/admin/payment_method_spec.rb' - 'spec/features/admin/payments_spec.rb' - 'spec/features/admin/product_import_spec.rb' - 'spec/features/admin/products_spec.rb' - - 'spec/features/admin/reports/enterprise_fee_summaries_spec.rb' - 'spec/features/admin/reports/packing_report_spec.rb' - 'spec/features/admin/reports_spec.rb' - 'spec/features/admin/schedules_spec.rb' @@ -1356,7 +1174,6 @@ Style/FrozenStringLiteralComment: - 'spec/features/consumer/account_spec.rb' - 'spec/features/consumer/authentication_spec.rb' - 'spec/features/consumer/confirm_invitation_spec.rb' - - 'spec/features/consumer/cookies_spec.rb' - 'spec/features/consumer/footer_links_spec.rb' - 'spec/features/consumer/groups_spec.rb' - 'spec/features/consumer/multilingual_spec.rb' @@ -1384,7 +1201,6 @@ Style/FrozenStringLiteralComment: - 'spec/helpers/injection_helper_spec.rb' - 'spec/helpers/navigation_helper_spec.rb' - 'spec/helpers/order_cycles_helper_spec.rb' - - 'spec/helpers/products_helper_spec.rb' - 'spec/helpers/serializer_helper_spec.rb' - 'spec/helpers/shared_helper_spec.rb' - 'spec/helpers/shop_helper_spec.rb' @@ -1431,7 +1247,6 @@ Style/FrozenStringLiteralComment: - 'spec/lib/open_food_network/sales_tax_report_spec.rb' - 'spec/lib/open_food_network/scope_variant_to_hub_spec.rb' - 'spec/lib/open_food_network/scope_variants_to_search_spec.rb' - - 'spec/lib/open_food_network/subscription_payment_updater_spec.rb' - 'spec/lib/open_food_network/tag_rule_applicator_spec.rb' - 'spec/lib/open_food_network/user_balance_calculator_spec.rb' - 'spec/lib/open_food_network/users_and_enterprises_report_spec.rb' @@ -1465,7 +1280,6 @@ Style/FrozenStringLiteralComment: - 'spec/models/model_set_spec.rb' - 'spec/models/order_cycle_spec.rb' - 'spec/models/order_updater_spec.rb' - - 'spec/models/producer_property_spec.rb' - 'spec/models/product_import/entry_processor_spec.rb' - 'spec/models/product_import/inventory_reset_strategy_spec.rb' - 'spec/models/product_import/reset_absent_spec.rb' @@ -1494,7 +1308,6 @@ Style/FrozenStringLiteralComment: - 'spec/models/spree/price_spec.rb' - 'spec/models/spree/product_set_spec.rb' - 'spec/models/spree/product_spec.rb' - - 'spec/models/spree/property_spec.rb' - 'spec/models/spree/shipment_spec.rb' - 'spec/models/spree/shipping_method_spec.rb' - 'spec/models/spree/stock/availability_validator_spec.rb' @@ -1563,8 +1376,6 @@ Style/FrozenStringLiteralComment: - 'spec/services/permissions/order_spec.rb' - 'spec/services/product_tag_rules_filterer_spec.rb' - 'spec/services/products_renderer_spec.rb' - - 'spec/services/reset_order_service_spec.rb' - - 'spec/services/restart_checkout_spec.rb' - 'spec/services/search_orders_spec.rb' - 'spec/services/tax_rate_finder_spec.rb' - 'spec/services/upload_sanitizer_spec.rb' @@ -1573,7 +1384,6 @@ Style/FrozenStringLiteralComment: - 'spec/support/ability_helper.rb' - 'spec/support/api_helper.rb' - 'spec/support/cancan_helper.rb' - - 'spec/support/controller_hacks.rb' - 'spec/support/controller_helper.rb' - 'spec/support/delayed_job_helper.rb' - 'spec/support/downloads_helper.rb' @@ -1614,18 +1424,19 @@ Style/FrozenStringLiteralComment: - 'spec/views/spree/admin/orders/edit.html.haml_spec.rb' - 'spec/views/spree/admin/orders/index.html.haml_spec.rb' -# Offense count: 50 +# Offense count: 51 # Configuration parameters: MinBodyLength. Style/GuardClause: Exclude: - 'app/controllers/admin/enterprises_controller.rb' - 'app/controllers/admin/order_cycles_controller.rb' - 'app/controllers/admin/product_import_controller.rb' + - 'app/controllers/api/shipments_controller.rb' - 'app/controllers/application_controller.rb' - - 'app/controllers/base_controller.rb' - 'app/controllers/checkout_controller.rb' - 'app/controllers/home_controller.rb' - 'app/controllers/spree/orders_controller.rb' + - 'app/controllers/spree/paypal_controller_decorator.rb' - 'app/models/enterprise.rb' - 'app/models/enterprise_group.rb' - 'app/models/producer_property.rb' @@ -1653,23 +1464,15 @@ Style/IfInsideElse: - 'app/controllers/admin/variant_overrides_controller.rb' - 'app/controllers/api/taxons_controller.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: InverseMethods, InverseBlocks. -Style/InverseMethods: - Exclude: - - 'lib/open_food_network/reports/line_items.rb' - # Offense count: 1 Style/MissingRespondToMissing: Exclude: - 'app/helpers/application_helper.rb' -# Offense count: 5 +# Offense count: 4 Style/MixinUsage: Exclude: - 'lib/open_food_network/orders_and_fulfillments_report.rb' - - 'spec/features/admin/orders_spec.rb' - 'spec/lib/open_food_network/bulk_coop_report_spec.rb' - 'spec/lib/open_food_network/order_cycle_management_report_spec.rb' - 'spec/lib/open_food_network/packing_report_spec.rb' @@ -1679,14 +1482,6 @@ Style/MultipleComparison: Exclude: - 'spec/models/product_importer_spec.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: both, prefix, postfix -Style/NegatedUnless: - Exclude: - - 'app/services/cart_service.rb' - # Offense count: 41 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods. @@ -1719,25 +1514,13 @@ Style/NumericPredicate: - 'lib/spree/money_decorator.rb' - 'lib/tasks/sample_data.rake' -# Offense count: 16 +# Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods. -# AllowedMethods: present?, blank?, presence, try, try! -Style/SafeNavigation: +Style/RedundantParentheses: Exclude: - - 'app/controllers/spree/admin/payments_controller.rb' - - 'app/controllers/spree/credit_cards_controller.rb' - - 'app/controllers/spree/orders_controller.rb' - - 'app/helpers/i18n_helper.rb' - - 'app/helpers/shop_helper.rb' - - 'app/models/producer_property.rb' - 'app/models/product_import/entry_validator.rb' - - 'app/models/product_import/product_importer.rb' - - 'app/models/proxy_order.rb' - - 'lib/discourse/single_sign_on.rb' - - 'spec/factories.rb' -# Offense count: 232 +# Offense count: 231 Style/Send: Exclude: - 'app/models/spree/shipping_method_decorator.rb' @@ -1757,7 +1540,6 @@ Style/Send: - 'spec/lib/open_food_network/permissions_spec.rb' - 'spec/lib/open_food_network/products_and_inventory_report_spec.rb' - 'spec/lib/open_food_network/sales_tax_report_spec.rb' - - 'spec/lib/open_food_network/subscription_payment_updater_spec.rb' - 'spec/lib/open_food_network/tag_rule_applicator_spec.rb' - 'spec/lib/open_food_network/xero_invoices_report_spec.rb' - 'spec/lib/stripe/webhook_handler_spec.rb'