core/db/migrate/20210914000000_spree_four_three.rb

Summary

Maintainability
F
1 wk
Test Coverage

Method up has 1116 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def up
    # This migration is just a compressed version of all the previous
    # migrations for spree_core. Do not run it if one of the core tables
    # already exists. Assume the best.
    return if data_source_exists?(:spree_addresses)
Severity: Major
Found in core/db/migrate/20210914000000_spree_four_three.rb - About 5 days to fix

    File 20210914000000_spree_four_three.rb has 1120 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    class SpreeFourThree < ActiveRecord::Migration[5.2]
      def up
        # This migration is just a compressed version of all the previous
        # migrations for spree_core. Do not run it if one of the core tables
        # already exists. Assume the best.
    Severity: Major
    Found in core/db/migrate/20210914000000_spree_four_three.rb - About 2 days to fix

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          create_table "spree_products_stores", force: :cascade do |t|
            t.bigint "product_id"
            t.bigint "store_id"
            t.datetime "created_at", null: false
            t.datetime "updated_at", null: false
      Severity: Major
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 1 other location - About 1 hr to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 635..643

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 50.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          create_table "spree_promotions_stores", force: :cascade do |t|
            t.bigint "promotion_id"
            t.bigint "store_id"
            t.datetime "created_at", null: false
            t.datetime "updated_at", null: false
      Severity: Major
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 1 other location - About 1 hr to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 529..537

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 50.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          create_table "spree_refund_reasons", force: :cascade do |t|
            t.string "name"
            t.boolean "active", default: true
            t.boolean "mutable", default: true
            t.datetime "created_at", precision: 6, null: false
      Severity: Major
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 1 other location - About 1 hr to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 740..747

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 48.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          create_table "spree_return_authorization_reasons", force: :cascade do |t|
            t.string "name"
            t.boolean "active", default: true
            t.boolean "mutable", default: true
            t.datetime "created_at", precision: 6, null: false
      Severity: Major
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 1 other location - About 1 hr to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 683..690

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 48.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          create_table "spree_option_type_prototypes", force: :cascade do |t|
            t.bigint "prototype_id"
            t.bigint "option_type_id"
            t.datetime "created_at"
            t.datetime "updated_at"
      Severity: Major
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 2 other locations - About 55 mins to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 313..321
      core/db/migrate/20210914000000_spree_four_three.rb on lines 657..665

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 44.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          create_table "spree_option_value_variants", force: :cascade do |t|
            t.bigint "variant_id"
            t.bigint "option_value_id"
            t.datetime "created_at"
            t.datetime "updated_at"
      Severity: Major
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 2 other locations - About 55 mins to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 291..299
      core/db/migrate/20210914000000_spree_four_three.rb on lines 657..665

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 44.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          create_table "spree_property_prototypes", force: :cascade do |t|
            t.bigint "prototype_id"
            t.bigint "property_id"
            t.datetime "created_at"
            t.datetime "updated_at"
      Severity: Major
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 2 other locations - About 55 mins to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 291..299
      core/db/migrate/20210914000000_spree_four_three.rb on lines 313..321

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 44.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          create_table "spree_product_promotion_rules", force: :cascade do |t|
            t.bigint "product_id"
            t.bigint "promotion_rule_id"
            t.datetime "created_at"
            t.datetime "updated_at"
      Severity: Minor
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 1 other location - About 35 mins to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 589..596

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 35.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          create_table "spree_promotion_rule_users", force: :cascade do |t|
            t.bigint "user_id"
            t.bigint "promotion_rule_id"
            t.datetime "created_at"
            t.datetime "updated_at"
      Severity: Minor
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 1 other location - About 35 mins to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 480..487

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 35.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          create_table "spree_promotion_rule_taxons", force: :cascade do |t|
            t.bigint "taxon_id"
            t.bigint "promotion_rule_id"
            t.datetime "created_at"
            t.datetime "updated_at"
      Severity: Minor
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 2 other locations - About 35 mins to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 790..797
      core/db/migrate/20210914000000_spree_four_three.rb on lines 847..854

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 34.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          create_table "spree_shipping_method_zones", force: :cascade do |t|
            t.bigint "shipping_method_id"
            t.bigint "zone_id"
            t.datetime "created_at"
            t.datetime "updated_at"
      Severity: Minor
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 2 other locations - About 35 mins to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 580..587
      core/db/migrate/20210914000000_spree_four_three.rb on lines 790..797

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 34.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 3 locations. Consider refactoring.
      Open

          create_table "spree_role_users", force: :cascade do |t|
            t.bigint "role_id"
            t.bigint "user_id"
            t.datetime "created_at"
            t.datetime "updated_at"
      Severity: Minor
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 2 other locations - About 35 mins to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 580..587
      core/db/migrate/20210914000000_spree_four_three.rb on lines 847..854

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 34.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          create_table "spree_prototypes", force: :cascade do |t|
            t.string "name"
            t.datetime "created_at", precision: 6, null: false
            t.datetime "updated_at", precision: 6, null: false
          end
      Severity: Minor
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 1 other location - About 20 mins to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 970..974

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 27.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          create_table "spree_store_credit_categories", force: :cascade do |t|
            t.string "name"
            t.datetime "created_at", precision: 6, null: false
            t.datetime "updated_at", precision: 6, null: false
          end
      Severity: Minor
      Found in core/db/migrate/20210914000000_spree_four_three.rb and 1 other location - About 20 mins to fix
      core/db/migrate/20210914000000_spree_four_three.rb on lines 677..681

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 27.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      There are no issues that match your filters.

      Category
      Status