diff --git a/.codeclimate.yml b/.codeclimate.yml index 14569f6b0f..e892e73274 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -4,7 +4,7 @@ plugins: enabled: true channel: "rubocop-0-55" scss-lint: - enabled: false + enabled: true duplication: enabled: true exclude_patterns: @@ -16,9 +16,9 @@ checks: complex-logic: enabled: true file-lines: - enabled: false + enabled: true method-complexity: - enabled: false + enabled: true method-count: enabled: false method-lines: @@ -35,3 +35,4 @@ exclude_patterns: - "spec/**/*" - "vendor/**/*" - "app/assets/javascripts/shared/*" +- "app/assets/javascripts/jquery-migrate-1.0.0.js" diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 445f0dbc35..b9bd3d0908 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --exclude-limit 1400` -# on 2018-05-08 14:46:01 +1000 using RuboCop version 0.55.0. +# on 2018-07-20 18:57:26 +0200 using RuboCop version 0.55.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 @@ -14,7 +14,7 @@ Bundler/OrderedGems: Exclude: - 'Gemfile' -# Offense count: 124 +# Offense count: 116 # Cop supports --auto-correct. Layout/AlignArray: Exclude: @@ -119,7 +119,7 @@ Layout/ElseAlignment: - 'app/serializers/api/admin/order_cycle_serializer.rb' - 'lib/open_food_network/sales_tax_report.rb' -# Offense count: 209 +# Offense count: 205 # Cop supports --auto-correct. Layout/EmptyLines: Exclude: @@ -173,7 +173,6 @@ Layout/EmptyLines: - 'app/models/spree/shipping_method_decorator.rb' - 'app/models/spree/tax_rate_decorator.rb' - 'app/models/spree/taxon_decorator.rb' - - 'app/models/spree/variant_decorator.rb' - 'app/serializers/api/enterprise_serializer.rb' - 'lib/open_food_network/cached_products_renderer.rb' - 'lib/open_food_network/enterprise_fee_applicator.rb' @@ -193,6 +192,7 @@ Layout/EmptyLines: - 'lib/open_food_network/sales_tax_report.rb' - 'lib/open_food_network/scope_product_to_hub.rb' - 'lib/open_food_network/scope_variant_to_hub.rb' + - 'lib/open_food_network/xero_invoices_report.rb' - 'lib/spree/core/controller_helpers/order_decorator.rb' - 'lib/tasks/cache.rake' - 'lib/tasks/dev.rake' @@ -217,7 +217,6 @@ Layout/EmptyLines: - 'spec/features/admin/order_cycles_spec.rb' - 'spec/features/admin/orders_spec.rb' - 'spec/features/admin/payment_method_spec.rb' - - 'spec/features/admin/product_import_spec.rb' - 'spec/features/admin/products_spec.rb' - 'spec/features/admin/reports_spec.rb' - 'spec/features/admin/shipping_methods_spec.rb' @@ -282,6 +281,7 @@ Layout/EmptyLinesAroundBlockBody: - 'lib/spree/money_decorator.rb' - 'lib/tasks/dev.rake' - 'lib/tasks/users.rake' + - 'spec/controllers/admin/order_cycles_controller_spec.rb' - 'spec/controllers/admin/tag_rules_controller_spec.rb' - 'spec/controllers/cart_controller_spec.rb' - 'spec/controllers/spree/admin/orders_controller_spec.rb' @@ -294,6 +294,7 @@ Layout/EmptyLinesAroundBlockBody: - 'spec/features/admin/orders_spec.rb' - 'spec/features/admin/reports_spec.rb' - 'spec/features/admin/variant_overrides_spec.rb' + - 'spec/features/consumer/shopping/embedded_groups_spec.rb' - 'spec/features/consumer/shopping/embedded_shopfronts_spec.rb' - 'spec/features/consumer/shopping/shopping_spec.rb' - 'spec/features/consumer/shopping/variant_overrides_spec.rb' @@ -321,7 +322,7 @@ Layout/EmptyLinesAroundBlockBody: - 'spec/support/matchers/select2_matchers.rb' - 'spec/support/matchers/table_matchers.rb' -# Offense count: 27 +# Offense count: 26 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only @@ -332,7 +333,6 @@ Layout/EmptyLinesAroundClassBody: - 'app/controllers/admin/enterprise_fees_controller.rb' - 'app/controllers/admin/inventory_items_controller.rb' - 'app/controllers/admin/invoice_settings_controller.rb' - - 'app/controllers/admin/product_import_controller.rb' - 'app/controllers/admin/tag_rules_controller.rb' - 'app/controllers/api/enterprises_controller.rb' - 'app/controllers/application_controller.rb' @@ -364,7 +364,7 @@ Layout/EndAlignment: - 'app/serializers/api/admin/for_order_cycle/supplied_product_serializer.rb' - 'app/serializers/api/admin/order_cycle_serializer.rb' -# Offense count: 53 +# Offense count: 49 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment. Layout/ExtraSpacing: @@ -405,37 +405,29 @@ Layout/ExtraSpacing: - 'spec/spec_helper.rb' - 'spec/support/request/web_helper.rb' -# Offense count: 2 +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: consistent, special_for_inner_method_call, special_for_inner_method_call_in_parentheses +Layout/FirstParameterIndentation: + Exclude: + - 'spec/controllers/spree/admin/orders/customer_details_controller_spec.rb' + +# Offense count: 6 # Cop supports --auto-correct. # Configuration parameters: IndentationWidth. # SupportedStyles: special_inside_parentheses, consistent, align_brackets Layout/IndentArray: EnforcedStyle: consistent -# Offense count: 52 +# Offense count: 51 # Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, IndentationWidth. +# Configuration parameters: IndentationWidth. # SupportedStyles: special_inside_parentheses, consistent, align_braces Layout/IndentHash: - Exclude: - - 'app/controllers/admin/accounts_and_billing_settings_controller.rb' - - 'app/controllers/admin/business_model_configuration_controller.rb' - - 'app/controllers/checkout_controller.rb' - - 'app/controllers/spree/admin/search_controller_decorator.rb' - - 'app/jobs/finalize_account_invoices.rb' - - 'app/jobs/update_account_invoices.rb' - - 'app/jobs/update_billable_periods.rb' - - 'app/models/spree/order_decorator.rb' - - 'spec/controllers/admin/accounts_and_billing_settings_controller_spec.rb' - - 'spec/controllers/admin/business_model_configuration_controller_spec.rb' - - 'spec/controllers/admin/order_cycles_controller_spec.rb' - - 'spec/features/admin/accounts_and_billing_settings_spec.rb' - - 'spec/features/admin/business_model_configuration_spec.rb' - - 'spec/features/admin/tax_settings_spec.rb' - - 'spec/lib/open_food_network/order_cycle_form_applicator_spec.rb' - - 'spec/support/request/authentication_workflow.rb' + EnforcedStyle: consistent -# Offense count: 20 +# Offense count: 19 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: normal, rails @@ -471,15 +463,13 @@ Layout/IndentationWidth: - 'spec/models/enterprise_spec.rb' - 'spec/models/spree/calculator/flexi_rate_spec.rb' -# Offense count: 51 +# Offense count: 46 # Cop supports --auto-correct. Layout/LeadingCommentSpace: Exclude: - 'Gemfile' - 'app/models/billable_period.rb' - 'app/models/content_configuration.rb' - - 'app/models/product_importer.rb' - - 'app/models/spreadsheet_entry.rb' - 'app/models/spree/inventory_unit_decorator.rb' - 'app/models/spree/taxon_decorator.rb' - 'app/overrides/add_capture_order_shortcut.rb' @@ -523,7 +513,7 @@ Layout/MultilineBlockLayout: - 'spec/models/spree/variant_spec.rb' - 'spec/serializers/enterprise_serializer_spec.rb' -# Offense count: 6 +# Offense count: 4 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: symmetrical, new_line, same_line @@ -532,7 +522,6 @@ Layout/MultilineHashBraceLayout: - 'app/controllers/spree/admin/products_controller_decorator.rb' - 'app/models/billable_period.rb' - 'lib/spree/product_filters.rb' - - 'spec/controllers/admin/order_cycles_controller_spec.rb' - 'spec/support/request/authentication_workflow.rb' # Offense count: 7 @@ -557,7 +546,7 @@ Layout/MultilineMethodCallIndentation: - 'spec/lib/open_food_network/cached_products_renderer_spec.rb' - 'spec/serializers/variant_serializer_spec.rb' -# Offense count: 32 +# Offense count: 30 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, IndentationWidth. # SupportedStyles: aligned, indented @@ -568,7 +557,6 @@ Layout/MultilineOperationIndentation: - 'app/controllers/spree/admin/shipping_methods_controller_decorator.rb' - 'app/helpers/enterprises_helper.rb' - 'app/models/producer_property.rb' - - 'app/models/product_importer.rb' - 'app/models/spree/ability_decorator.rb' - 'app/models/spree/product_set.rb' - 'app/models/variant_override_set.rb' @@ -588,7 +576,7 @@ Layout/SpaceAfterColon: - 'spec/models/variant_override_spec.rb' - 'spec/spec_helper.rb' -# Offense count: 85 +# Offense count: 83 # Cop supports --auto-correct. Layout/SpaceAfterComma: Exclude: @@ -596,7 +584,6 @@ Layout/SpaceAfterComma: - 'app/controllers/spree/admin/products_controller_decorator.rb' - 'app/controllers/spree/orders_controller_decorator.rb' - 'app/models/column_preference.rb' - - 'app/models/product_importer.rb' - 'lib/discourse/single_sign_on.rb' - 'lib/open_food_network/accounts_and_billing_settings_validator.rb' - 'lib/open_food_network/business_model_configuration_validator.rb' @@ -628,7 +615,7 @@ Layout/SpaceAfterSemicolon: Exclude: - 'spec/controllers/spree/admin/base_controller_spec.rb' -# Offense count: 65 +# Offense count: 62 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: space, no_space @@ -647,7 +634,6 @@ Layout/SpaceAroundEqualsInParameterDefault: - 'app/models/exchange.rb' - 'app/models/model_set.rb' - 'app/models/order_cycle_set.rb' - - 'app/models/product_importer.rb' - 'app/models/spree/calculator/per_item_decorator.rb' - 'app/models/spree/payment_decorator.rb' - 'app/models/spree/payment_method_decorator.rb' @@ -665,6 +651,7 @@ Layout/SpaceAroundEqualsInParameterDefault: - 'lib/open_food_network/permissions.rb' - 'lib/open_food_network/scope_variant_to_hub.rb' - 'lib/open_food_network/tag_rule_applicator.rb' + - 'lib/open_food_network/xero_invoices_report.rb' - 'lib/spree/money_decorator.rb' - 'spec/features/admin/enterprise_relationships_spec.rb' - 'spec/features/admin/reports_spec.rb' @@ -673,21 +660,20 @@ Layout/SpaceAroundEqualsInParameterDefault: - 'spec/support/request/distribution_helper.rb' - 'spec/support/request/web_helper.rb' -# Offense count: 59 +# Offense count: 57 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment. Layout/SpaceAroundOperators: Exclude: - - 'app/controllers/admin/product_import_controller.rb' - 'app/controllers/checkout_controller.rb' - 'app/helpers/admin/business_model_configuration_helper.rb' - 'app/jobs/update_billable_periods.rb' - - 'app/models/product_importer.rb' - 'app/models/spree/address_decorator.rb' - 'app/overrides/remove_search_bar.rb' - 'app/overrides/remove_side_bar.rb' - 'app/overrides/replace_shipping_address_form_with_distributor_details.rb' - 'app/serializers/api/enterprise_serializer.rb' + - 'lib/open_food_network/xero_invoices_report.rb' - 'lib/spree/product_filters.rb' - 'spec/controllers/admin/enterprises_controller_spec.rb' - 'spec/controllers/cart_controller_spec.rb' @@ -732,7 +718,7 @@ Layout/SpaceInLambdaLiteral: - 'app/models/spree/product_decorator.rb' - 'app/models/spree/variant_decorator.rb' -# Offense count: 129 +# Offense count: 130 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets. # SupportedStyles: space, no_space, compact @@ -752,8 +738,9 @@ Layout/SpaceInsideArrayLiteralBrackets: - 'spec/jobs/update_billable_periods_spec.rb' - 'spec/lib/open_food_network/order_grouper_spec.rb' - 'spec/lib/open_food_network/users_and_enterprises_report_spec.rb' + - 'spec/models/spree/order_spec.rb' -# Offense count: 192 +# Offense count: 194 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. # SupportedStyles: space, no_space @@ -807,7 +794,7 @@ Layout/SpaceInsideBlockBraces: - 'spec/spec_helper.rb' - 'spec/support/cancan_helper.rb' -# Offense count: 786 +# Offense count: 798 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. # SupportedStyles: space, no_space, compact @@ -839,7 +826,6 @@ Layout/SpaceInsideHashLiteralBraces: - 'app/models/enterprise_group.rb' - 'app/models/enterprise_relationship.rb' - 'app/models/producer_property.rb' - - 'app/models/product_importer.rb' - 'app/models/spree/gateway/stripe_connect.rb' - 'app/models/spree/order_populator_decorator.rb' - 'app/models/spree/product_decorator.rb' @@ -855,6 +841,7 @@ Layout/SpaceInsideHashLiteralBraces: - 'lib/open_food_network/reports/rule.rb' - 'lib/open_food_network/sales_tax_report.rb' - 'lib/open_food_network/variant_and_line_item_naming.rb' + - 'lib/open_food_network/xero_invoices_report.rb' - 'lib/tasks/users.rake' - 'spec/controllers/admin/accounts_and_billing_settings_controller_spec.rb' - 'spec/controllers/admin/business_model_configuration_controller_spec.rb' @@ -900,6 +887,7 @@ Layout/SpaceInsideHashLiteralBraces: - 'spec/models/exchange_spec.rb' - 'spec/models/model_set_spec.rb' - 'spec/models/product_distribution_spec.rb' + - 'spec/models/product_importer_spec.rb' - 'spec/models/spree/ability_spec.rb' - 'spec/models/spree/gateway/stripe_connect_spec.rb' - 'spec/models/spree/image_spec.rb' @@ -953,7 +941,7 @@ Layout/Tab: - 'spec/lib/spree/product_filters_spec.rb' - 'spec/models/spree/line_item_spec.rb' -# Offense count: 62 +# Offense count: 60 # Cop supports --auto-correct. # Configuration parameters: AllowInHeredoc. Layout/TrailingWhitespace: @@ -969,7 +957,6 @@ Layout/TrailingWhitespace: - 'app/views/json/_producer.rabl' - 'app/views/json/partials/_producer.rabl' - 'spec/controllers/admin/column_preferences_controller_spec.rb' - - 'spec/controllers/shop_controller_spec.rb' - 'spec/features/admin/enterprise_user_spec.rb' - 'spec/features/admin/variant_overrides_spec.rb' - 'spec/helpers/enterprises_helper_spec.rb' @@ -985,10 +972,14 @@ Layout/TrailingWhitespace: - 'spec/views/json/producers.json.rabl_spec.rb' # Offense count: 1 -# Cop supports --auto-correct. -Lint/DeprecatedClassMethods: +Lint/AmbiguousOperator: Exclude: - - 'app/controllers/admin/product_import_controller.rb' + - 'spec/controllers/spree/admin/payments_controller_spec.rb' + +# Offense count: 2 +Lint/BooleanSymbol: + Exclude: + - 'spec/features/consumer/shopping/embedded_groups_spec.rb' # Offense count: 4 Lint/DuplicateMethods: @@ -1016,16 +1007,16 @@ Lint/InheritException: - 'lib/open_food_network/cached_products_renderer.rb' - 'lib/open_food_network/products_renderer.rb' +# Offense count: 1 +Lint/InterpolationCheck: + Exclude: + - 'spec/features/consumer/shopping/embedded_groups_spec.rb' + # Offense count: 1 Lint/LiteralAsCondition: Exclude: - 'lib/open_food_network/rack_request_blocker.rb' -# Offense count: 1 -Lint/NonLocalExitFromIterator: - Exclude: - - 'app/models/product_importer.rb' - # Offense count: 1 # Cop supports --auto-correct. Lint/ScriptPermission: @@ -1039,7 +1030,7 @@ Lint/ShadowingOuterLocalVariable: - 'app/models/spree/product_set.rb' - 'spec/models/model_set_spec.rb' -# Offense count: 6 +# Offense count: 7 # Cop supports --auto-correct. Lint/StringConversionInInterpolation: Exclude: @@ -1049,13 +1040,14 @@ Lint/StringConversionInInterpolation: - 'app/helpers/injection_helper.rb' - 'app/helpers/spree/products_helper_decorator.rb' - 'app/serializers/api/admin/tag_rule_serializer.rb' + - 'spec/features/admin/product_import_spec.rb' # Offense count: 2 Lint/UnderscorePrefixedVariableName: Exclude: - 'spec/support/cancan_helper.rb' -# Offense count: 125 +# Offense count: 123 # Cop supports --auto-correct. # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. Lint/UnusedBlockArgument: @@ -1066,7 +1058,6 @@ Lint/UnusedBlockArgument: - 'app/controllers/spree/orders_controller_decorator.rb' - 'app/models/column_preference.rb' - 'app/models/model_set.rb' - - 'app/models/product_importer.rb' - 'app/models/spree/order_decorator.rb' - 'app/models/spree/order_populator_decorator.rb' - 'lib/open_food_network/bulk_coop_report.rb' @@ -1080,6 +1071,7 @@ Lint/UnusedBlockArgument: - 'lib/open_food_network/reports/bulk_coop_allocation_report.rb' - 'lib/open_food_network/reports/bulk_coop_supplier_report.rb' - 'lib/open_food_network/sales_tax_report.rb' + - 'lib/open_food_network/xero_invoices_report.rb' - 'spec/lib/open_food_network/order_grouper_spec.rb' - 'spec/support/cancan_helper.rb' - 'spec/support/delayed_job_helper.rb' @@ -1118,7 +1110,7 @@ Lint/UselessAccessModifier: - 'lib/open_food_network/reports/bulk_coop_report.rb' - 'spec/lib/open_food_network/reports/report_spec.rb' -# Offense count: 315 +# Offense count: 288 # Configuration parameters: CheckForMethodsWithNoSideEffects. Lint/Void: Exclude: @@ -1143,9 +1135,7 @@ Lint/Void: - 'spec/features/admin/enterprises_spec.rb' - 'spec/features/admin/order_cycles_spec.rb' - 'spec/features/admin/payment_method_spec.rb' - - 'spec/features/admin/product_import_spec.rb' - 'spec/features/admin/products_spec.rb' - - 'spec/features/admin/reports_spec.rb' - 'spec/features/admin/shipping_methods_spec.rb' - 'spec/features/admin/variant_overrides_spec.rb' - 'spec/features/admin/variants_spec.rb' @@ -1181,15 +1171,14 @@ Lint/Void: - 'spec/serializers/enterprise_serializer_spec.rb' - 'spec/support/request/web_helper.rb' -# Offense count: 945 +# Offense count: 998 # Configuration parameters: CountComments, ExcludedMethods. Metrics/BlockLength: - Max: 773 + Max: 776 -# Offense count: 8 +# Offense count: 7 Naming/AccessorMethodName: Exclude: - - 'app/models/product_importer.rb' - 'app/models/spree/adjustment_decorator.rb' - 'app/models/spree/order_decorator.rb' - 'spec/support/request/shop_workflow.rb' @@ -1221,7 +1210,7 @@ Naming/MemoizedInstanceVariableName: - 'app/controllers/spree/admin/payments_controller_decorator.rb' - 'lib/open_food_network/address_finder.rb' -# Offense count: 25 +# Offense count: 22 # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros. # NamePrefix: is_, has_, have_ # NamePrefixBlacklist: is_, has_, have_ @@ -1234,8 +1223,6 @@ Naming/PredicateName: - 'app/models/enterprise.rb' - 'app/models/enterprise_relationship.rb' - 'app/models/order_cycle.rb' - - 'app/models/product_importer.rb' - - 'app/models/spreadsheet_entry.rb' - 'app/models/spree/ability_decorator.rb' - 'app/models/spree/adjustment_decorator.rb' - 'app/models/spree/line_item_decorator.rb' @@ -1263,10 +1250,11 @@ Naming/UncommunicativeMethodParamName: - 'app/services/subscription_validator.rb' - 'lib/open_food_network/property_merge.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: 4 +# Offense count: 3 # Configuration parameters: EnforcedStyle. # SupportedStyles: snake_case, camelCase Naming/VariableName: @@ -1331,24 +1319,26 @@ Performance/StringReplacement: - 'app/helpers/spree/admin/navigation_helper_decorator.rb' - 'app/models/spree/preferences/file_configuration.rb' -# Offense count: 4 +# Offense count: 5 # Cop supports --auto-correct. Performance/UnneededSort: Exclude: + - 'app/models/spree/product_decorator.rb' - 'spec/features/admin/order_cycles_spec.rb' -# Offense count: 203 +# Offense count: 206 # Cop supports --auto-correct. Rails/ActiveRecordAliases: Exclude: - 'app/controllers/admin/bulk_line_items_controller.rb' - 'app/controllers/admin/enterprises_controller.rb' - - 'app/controllers/admin/order_cycles_controller.rb' - 'app/controllers/admin/subscriptions_controller.rb' + - 'app/controllers/api/customers_controller.rb' - 'app/controllers/api/enterprises_controller.rb' - 'app/controllers/api/product_images_controller.rb' - 'app/controllers/checkout_controller.rb' - 'app/controllers/spree/admin/line_items_controller_decorator.rb' + - 'app/controllers/spree/credit_cards_controller.rb' - 'app/controllers/spree/orders_controller_decorator.rb' - 'app/helpers/i18n_helper.rb' - 'app/jobs/subscription_placement_job.rb' @@ -1366,7 +1356,6 @@ Rails/ActiveRecordAliases: - '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/customers_controller_spec.rb' - 'spec/controllers/admin/proxy_orders_controller_spec.rb' - 'spec/controllers/admin/subscriptions_controller_spec.rb' - 'spec/controllers/line_items_controller_spec.rb' @@ -1388,6 +1377,7 @@ Rails/ActiveRecordAliases: - 'spec/jobs/update_billable_periods_spec.rb' - 'spec/lib/open_food_network/products_cache_refreshment_spec.rb' - 'spec/lib/open_food_network/products_cache_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' @@ -1395,6 +1385,7 @@ Rails/ActiveRecordAliases: - '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' @@ -1490,7 +1481,7 @@ Rails/HasManyOrHasOneDependent: - 'app/models/spree/variant_decorator.rb' - 'app/models/subscription.rb' -# Offense count: 43 +# Offense count: 45 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: numeric, symbolic @@ -1505,6 +1496,7 @@ Rails/HttpStatus: - 'app/controllers/admin/manager_invitations_controller.rb' - 'app/controllers/admin/tag_rules_controller.rb' - 'app/controllers/admin/variant_overrides_controller.rb' + - 'app/controllers/api/customers_controller.rb' - 'app/controllers/api/enterprises_controller.rb' - 'app/controllers/application_controller.rb' - 'app/controllers/checkout_controller.rb' @@ -1519,7 +1511,7 @@ Rails/HttpStatus: - 'app/controllers/stripe/callbacks_controller.rb' - 'app/controllers/stripe/webhooks_controller.rb' -# Offense count: 11 +# Offense count: 6 Rails/OutputSafety: Exclude: - 'app/controllers/spree/admin/reports_controller_decorator.rb' @@ -1544,7 +1536,7 @@ Rails/Presence: Exclude: - 'app/serializers/api/admin/customer_serializer.rb' -# Offense count: 5 +# Offense count: 4 # Cop supports --auto-correct. # Configuration parameters: NotNilAndNotEmpty, NotBlank, UnlessBlank. Rails/Present: @@ -1561,7 +1553,7 @@ Rails/ReadWriteAttribute: Exclude: - 'app/models/enterprise.rb' -# Offense count: 45 +# Offense count: 47 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/ScopeArgs: @@ -1580,12 +1572,11 @@ Rails/ScopeArgs: - 'app/models/spree/shipping_method_decorator.rb' - 'app/models/spree/variant_decorator.rb' -# Offense count: 18 +# Offense count: 17 # Configuration parameters: EnforcedStyle. # SupportedStyles: strict, flexible Rails/TimeZone: Exclude: - - 'app/controllers/admin/product_import_controller.rb' - 'app/controllers/api/statuses_controller.rb' - 'app/jobs/heartbeat_job.rb' - 'app/models/enterprise_relationship.rb' @@ -1622,7 +1613,7 @@ Rails/Validation: - 'app/models/spree/variant_decorator.rb' - 'app/models/variant_override.rb' -# Offense count: 35 +# Offense count: 20 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: always, conditionals @@ -1635,8 +1626,6 @@ Style/AndOr: - 'app/controllers/spree/orders_controller_decorator.rb' - 'app/helpers/discourse_helper.rb' - 'app/helpers/spree/admin/navigation_helper_decorator.rb' - - 'app/models/product_importer.rb' - - 'app/models/spreadsheet_entry.rb' - 'app/models/spree/adjustment_decorator.rb' - 'app/models/spree/order_decorator.rb' - 'app/models/spree/product_set.rb' @@ -1682,6 +1671,7 @@ Style/BracesAroundHashParameters: - 'lib/open_food_network/order_cycle_form_applicator.rb' - 'lib/open_food_network/reports/rule.rb' - 'lib/open_food_network/variant_and_line_item_naming.rb' + - 'lib/open_food_network/xero_invoices_report.rb' - 'spec/controllers/admin/accounts_and_billing_settings_controller_spec.rb' - 'spec/controllers/admin/business_model_configuration_controller_spec.rb' - 'spec/controllers/admin/enterprises_controller_spec.rb' @@ -1732,7 +1722,7 @@ Style/CaseEquality: - 'app/helpers/angular_form_helper.rb' - 'spec/models/spree/payment_spec.rb' -# Offense count: 87 +# Offense count: 86 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, EnforcedStyle. # SupportedStyles: nested, compact @@ -1743,7 +1733,6 @@ Style/ClassAndModuleChildren: - 'app/controllers/admin/business_model_configuration_controller.rb' - 'app/controllers/admin/cache_settings_controller.rb' - 'app/controllers/admin/invoice_settings_controller.rb' - - 'app/controllers/admin/product_import_controller.rb' - 'app/controllers/spree/store_controller_decorator.rb' - 'app/helpers/angular_form_helper.rb' - 'app/models/calculator/flat_percent_per_item.rb' @@ -1833,16 +1822,20 @@ Style/ClassVars: Exclude: - 'lib/open_food_network/rack_request_blocker.rb' -# Offense count: 4 +# Offense count: 3 # Cop supports --auto-correct. Style/ColonMethodCall: Exclude: - 'app/controllers/admin/enterprises_controller.rb' - 'app/controllers/application_controller.rb' - - 'app/controllers/spree/admin/products_controller_decorator.rb' - 'lib/discourse/single_sign_on.rb' -# Offense count: 12 +# Offense count: 1 +Style/CommentedKeyword: + Exclude: + - 'app/controllers/application_controller.rb' + +# Offense count: 10 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. # SupportedStyles: assign_to_condition, assign_inside_condition @@ -1872,14 +1865,6 @@ Style/EachWithObject: - 'lib/open_food_network/enterprise_fee_calculator.rb' - 'lib/open_food_network/products_renderer.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle. -# SupportedStyles: empty, nil, both -Style/EmptyElse: - Exclude: - - 'app/models/spreadsheet_entry.rb' - # Offense count: 2 # Cop supports --auto-correct. Style/EmptyLiteral: @@ -1916,7 +1901,7 @@ Style/FormatStringToken: - 'lib/open_food_network/sales_tax_report.rb' - 'spec/models/enterprise_spec.rb' -# Offense count: 88 +# Offense count: 83 # Configuration parameters: MinBodyLength. Style/GuardClause: Exclude: @@ -1945,7 +1930,6 @@ Style/GuardClause: - 'app/models/enterprise.rb' - 'app/models/enterprise_group.rb' - 'app/models/producer_property.rb' - - 'app/models/product_importer.rb' - 'app/models/spree/classification_decorator.rb' - 'app/models/spree/order_decorator.rb' - 'app/models/spree/order_populator_decorator.rb' @@ -1967,7 +1951,7 @@ Style/GuardClause: - 'spec/support/request/distribution_helper.rb' - 'spec/support/request/shop_workflow.rb' -# Offense count: 1040 +# Offense count: 970 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys @@ -2014,7 +1998,6 @@ Style/HashSyntax: - 'app/models/open_food_network/calculator/weight.rb' - 'app/models/order_cycle.rb' - 'app/models/product_distribution.rb' - - 'app/models/product_importer.rb' - 'app/models/spree/address_decorator.rb' - 'app/models/spree/adjustment_decorator.rb' - 'app/models/spree/classification_decorator.rb' @@ -2097,6 +2080,7 @@ Style/HashSyntax: - 'spec/features/admin/subscriptions_spec.rb' - 'spec/features/admin/variant_overrides_spec.rb' - 'spec/features/consumer/account/cards_spec.rb' + - 'spec/features/consumer/shopping/embedded_groups_spec.rb' - 'spec/features/consumer/shopping/products_spec.rb' - 'spec/features/consumer/shopping/shopping_spec.rb' - 'spec/jobs/subscription_placement_job_spec.rb' @@ -2127,7 +2111,7 @@ Style/HashSyntax: - 'spec/support/request/web_helper.rb' - 'spec/support/seeds.rb' -# Offense count: 4 +# Offense count: 3 Style/IfInsideElse: Exclude: - 'app/controllers/admin/column_preferences_controller.rb' @@ -2155,20 +2139,19 @@ Style/LineEndConcatenation: - 'lib/spree/core/controller_helpers/respond_with_decorator.rb' - 'spec/controllers/spree/admin/base_controller_spec.rb' -# Offense count: 11 +# Offense count: 9 # Cop supports --auto-correct. # Configuration parameters: IgnoredMethods. Style/MethodCallWithoutArgsParentheses: Exclude: - 'app/controllers/spree/admin/payment_methods_controller_decorator.rb' - - 'app/models/product_importer.rb' - 'app/views/json/_groups.rabl' - 'spec/controllers/spree/orders_controller_spec.rb' - 'spec/features/consumer/registration_spec.rb' - 'spec/models/spree/payment_method_spec.rb' - 'spec/support/request/ui_component_helper.rb' -# Offense count: 14 +# Offense count: 13 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline @@ -2181,7 +2164,6 @@ Style/MethodDefParentheses: - 'lib/open_food_network/distribution_change_validator.rb' - 'lib/open_food_network/feature_toggle.rb' - 'lib/open_food_network/group_buy_report.rb' - - 'lib/open_food_network/order_and_distributor_report.rb' - 'spec/support/request/authentication_workflow.rb' - 'spec/support/request/ui_component_helper.rb' - 'spec/support/request/web_helper.rb' @@ -2235,23 +2217,21 @@ Style/NestedTernaryOperator: - 'app/views/spree/api/products/bulk_show.v1.rabl' - 'app/views/spree/api/variants/bulk_show.v1.rabl' -# Offense count: 3 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, MinBodyLength. # SupportedStyles: skip_modifier_ifs, always Style/Next: Exclude: - - 'app/models/product_importer.rb' - 'lib/tasks/data.rake' -# Offense count: 9 +# Offense count: 7 # Cop supports --auto-correct. Style/NilComparison: Exclude: - 'lib/discourse/single_sign_on.rb' - 'lib/open_food_network/order_grouper.rb' - 'spec/features/admin/enterprise_fees_spec.rb' - - 'spec/features/admin/product_import_spec.rb' - 'spec/features/consumer/shopping/shopping_spec.rb' - 'spec/models/order_cycle_spec.rb' - 'spec/models/spree/order_spec.rb' @@ -2270,7 +2250,7 @@ Style/NumericLiteralPrefix: Exclude: - 'spec/features/admin/order_cycles_spec.rb' -# Offense count: 12 +# Offense count: 13 # Cop supports --auto-correct. # Configuration parameters: Strict. Style/NumericLiterals: @@ -2291,6 +2271,7 @@ Style/NumericPredicate: - 'app/models/spree/order_decorator.rb' - 'lib/open_food_network/integrity_checker.rb' - 'lib/open_food_network/rack_request_blocker.rb' + - 'lib/open_food_network/xero_invoices_report.rb' - 'lib/spree/money_decorator.rb' # Offense count: 2 @@ -2306,14 +2287,13 @@ Style/ParenthesesAroundCondition: Exclude: - 'app/controllers/checkout_controller.rb' -# Offense count: 4 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle. # SupportedStyles: short, verbose Style/PreferredHashMethods: Exclude: - 'app/controllers/spree/orders_controller_decorator.rb' - - 'app/models/product_importer.rb' - 'spec/controllers/spree/admin/orders_controller_spec.rb' # Offense count: 18 @@ -2359,14 +2339,13 @@ Style/RedundantParentheses: - 'spec/controllers/admin/enterprises_controller_spec.rb' - 'spec/features/admin/bulk_product_update_spec.rb' -# Offense count: 13 +# Offense count: 10 # Cop supports --auto-correct. # Configuration parameters: AllowMultipleReturnValues. Style/RedundantReturn: Exclude: - 'app/controllers/admin/enterprise_fees_controller.rb' - 'app/controllers/admin/enterprises_controller.rb' - - 'app/controllers/admin/product_import_controller.rb' - 'app/controllers/spree/credit_cards_controller.rb' - 'app/models/enterprise_fee.rb' - 'app/models/spree/adjustment_decorator.rb' @@ -2374,7 +2353,7 @@ Style/RedundantReturn: - 'app/models/spree/order_populator_decorator.rb' - 'app/serializers/api/admin/enterprise_serializer.rb' -# Offense count: 114 +# Offense count: 98 # Cop supports --auto-correct. Style/RedundantSelf: Exclude: @@ -2385,8 +2364,6 @@ Style/RedundantSelf: - 'app/models/open_food_network/calculator/weight.rb' - 'app/models/order_cycle.rb' - 'app/models/producer_property.rb' - - 'app/models/product_importer.rb' - - 'app/models/spreadsheet_entry.rb' - 'app/models/spree/address_decorator.rb' - 'app/models/spree/calculator/flat_percent_item_total_decorator.rb' - 'app/models/spree/calculator/flexi_rate_decorator.rb' @@ -2409,7 +2386,7 @@ Style/RedundantSelf: - 'lib/open_food_network/reports/report.rb' - 'lib/open_food_network/variant_and_line_item_naming.rb' -# Offense count: 13 +# Offense count: 12 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, AllowInnerSlashes. # SupportedStyles: slashes, percent_r, mixed @@ -2424,7 +2401,7 @@ Style/RegexpLiteral: - 'lib/discourse/single_sign_on.rb' - 'spec/models/content_configuration_spec.rb' -# Offense count: 6 +# Offense count: 4 # Cop supports --auto-correct. Style/RescueModifier: Exclude: @@ -2508,15 +2485,7 @@ Style/TrailingUnderscoreVariable: Exclude: - 'lib/open_food_network/option_value_namer.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, Whitelist. -# Whitelist: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym -Style/TrivialAccessors: - Exclude: - - 'app/models/product_importer.rb' - -# Offense count: 6 +# Offense count: 3 # Cop supports --auto-correct. Style/UnlessElse: Exclude: @@ -2569,7 +2538,7 @@ Style/UnneededPercentQ: - 'spec/features/consumer/producers_spec.rb' - 'spec/support/request/web_helper.rb' -# Offense count: 6392 +# Offense count: 6631 # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Metrics/LineLength: