expertiza/expertiza

View on GitHub
spec/models/assignment_team_spec.rb

Summary

Maintainability
B
4 hrs
Test Coverage

Block has too many lines. [341/25]
Open

describe 'AssignmentTeam' do
  let(:team_without_submitted_hyperlinks) { build(:assignment_team, submitted_hyperlinks: '') }
  let(:team) { build(:assignment_team, id: 1, parent_id: 1) }
  let(:assignment) { build(:assignment, id: 1) }
  let(:participant1) { build(:participant, id: 1) }
Severity: Minor
Found in spec/models/assignment_team_spec.rb by rubocop

This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.

File assignment_team_spec.rb has 343 lines of code (exceeds 250 allowed). Consider refactoring.
Open

describe 'AssignmentTeam' do
  let(:team_without_submitted_hyperlinks) { build(:assignment_team, submitted_hyperlinks: '') }
  let(:team) { build(:assignment_team, id: 1, parent_id: 1) }
  let(:assignment) { build(:assignment, id: 1) }
  let(:participant1) { build(:participant, id: 1) }
Severity: Minor
Found in spec/models/assignment_team_spec.rb - About 4 hrs to fix

    Useless assignment to variable - new_team.
    Open

          new_team = AssignmentTeam.create_team_with_users(@assignment.id, [@student.id])
    Severity: Minor
    Found in spec/models/assignment_team_spec.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

    There are no issues that match your filters.

    Category
    Status