lib/flagging_test_unit_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage

Assignment Branch Condition size for test_find_flagged_returns_as_expected is too high. [32.57/15]
Open

  def test_find_flagged_returns_as_expected
    @basket = Basket.find(:first)

    not_flagged = @base_class.constantize.create!(@new_model.merge(title: 'not flagged'))

Severity: Minor
Found in lib/flagging_test_unit_helper.rb by rubocop

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

Assignment Branch Condition size for test_fully_moderated_add_flags_version_as_pending_and_creates_blank_current_version is too high. [24.02/15]
Open

  def test_fully_moderated_add_flags_version_as_pending_and_creates_blank_current_version
    # make the basket require moderation
    Basket.find(:first).set_setting :fully_moderated, true

    model = Module.class_eval(@base_class).new @new_model
Severity: Minor
Found in lib/flagging_test_unit_helper.rb by rubocop

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. [16/10]
Open

  def test_find_flagged_returns_as_expected
    @basket = Basket.find(:first)

    not_flagged = @base_class.constantize.create!(@new_model.merge(title: 'not flagged'))

Severity: Minor
Found in lib/flagging_test_unit_helper.rb by rubocop

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.

TODO found
Open

# TODO: add coverage of basic flagging functionality
Severity: Minor
Found in lib/flagging_test_unit_helper.rb by fixme

Use underscores(_) as decimal mark and separate every 3 digits with them.
Open

      @new_model = @new_model.merge(url: "http://google.com/#{(rand * 10000).to_i}") if @base_class == 'WebLink'
Severity: Minor
Found in lib/flagging_test_unit_helper.rb by rubocop

This cop checks for big numeric literals without _ between groups of digits in them.

Example:

# bad

1000000
1_00_000
1_0000

# good

1_000_000
1000

# good unless Strict is set

10_000_00 # typical representation of $10,000 in cents

Useless assignment to variable - not_flagged.
Open

    not_flagged = @base_class.constantize.create!(@new_model.merge(title: 'not flagged'))
Severity: Minor
Found in lib/flagging_test_unit_helper.rb by rubocop

This cop checks for every useless assignment to local variable in every scope. The basic idea for this cop was from the warning of ruby -cw:

assigned but unused variable - foo

Currently this cop has advanced logic that detects unreferenced reassignments and properly handles varied cases such as branch, loop, rescue, ensure, etc.

Example:

# bad

def some_method
  some_var = 1
  do_something
end

Example:

# good

def some_method
  some_var = 1
  do_something(some_var)
end

%w-literals should be delimited by [ and ].
Open

    %w{flagged1 flagged2 flagged3}.each do |title|
Severity: Minor
Found in lib/flagging_test_unit_helper.rb by rubocop

This cop enforces the consistent usage of %-literal delimiters.

Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

Example:

# Style/PercentLiteralDelimiters:
#   PreferredDelimiters:
#     default: '[]'
#     '%i':    '()'

# good
%w[alpha beta] + %i(gamma delta)

# bad
%W(alpha #{beta})

# bad
%I(alpha beta)

There are no issues that match your filters.

Category
Status