public-market/spree_batch_api

View on GitHub
app/workers/spree/import_inventory_item_worker.rb

Summary

Maintainability
A
0 mins
Test Coverage

Assignment Branch Condition size for perform is too high. [16.52/15]
Open

    def perform(upload_item_id)
      item = UploadItem.find(upload_item_id)
      upload = item.upload

      options = item.options

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

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

    def perform(upload_item_id)
      item = UploadItem.find(upload_item_id)
      upload = item.upload

      options = item.options

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Complex method Spree::ImportInventoryItemWorker#perform (20.7)
Open

    def perform(upload_item_id)
      item = UploadItem.find(upload_item_id)
      upload = item.upload

      options = item.options

Flog calculates the ABC score for methods. The ABC score is based on assignments, branches (method calls), and conditions.

You can read more about ABC metrics or the flog tool

Line is too long. [161/150]
Open

      raise Spree::ImportError, I18n.t('workers.spree.import_inventory_item_worker.unsupported_variant_provider', product_type: product_type, provider: provider)

This cop checks the length of lines in the source code. The maximum length is configurable. The tab size is configured in the IndentationWidth of the Layout/Tab cop.

Align the parameters of a method call if they span more than one line.
Open

                                       index: item.index,
                                       messages: error_message))

Here we check if the parameters on a multi-line method call or definition are aligned.

Example: EnforcedStyle: withfirstparameter (default)

# good

foo :bar,
    :baz

# bad

foo :bar,
  :baz

Example: EnforcedStyle: withfixedindentation

# good

foo :bar,
  :baz

# bad

foo :bar,
    :baz

There are no issues that match your filters.

Category
Status