ece517-p3/expertiza

View on GitHub
spec/features/quiz_spec.rb

Summary

Maintainability
A
2 hrs
Test Coverage

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

describe 'Student can create quizzes and edit them', js: true do
  before(:each) do
    create_default_test_data 1
  end

Severity: Minor
Found in spec/features/quiz_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 quiz_spec.rb has 273 lines of code (exceeds 250 allowed). Consider refactoring.
Open

include InstructorInterfaceHelperSpec

def create_assignment_due_date
  set_deadline_type
  set_deadline_right
Severity: Minor
Found in spec/features/quiz_spec.rb - About 2 hrs to fix

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

    describe 'appropriate quiz taking times', js: true do
      before(:each) do
        @instructor = create(:instructor)
        @assignment = create :assignment, require_quiz: true, instructor: @instructor, course: nil, num_quiz_questions: 1, review_topic_threshold: 1
        create_assignment_due_date
    Severity: Minor
    Found in spec/features/quiz_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.

    Prefer Date or Time over DateTime.
    Open

      create :assignment_due_date, due_at: (DateTime.now.in_time_zone + 1.day)
    Severity: Minor
    Found in spec/features/quiz_spec.rb by rubocop

    This cop checks for uses of DateTime that should be replaced by Date or Time.

    Example:

    # bad - uses `DateTime` for current time
    DateTime.now
    
    # good - uses `Time` for current time
    Time.now
    
    # bad - uses `DateTime` for modern date
    DateTime.iso8601('2016-06-29')
    
    # good - uses `Date` for modern date
    Date.iso8601('2016-06-29')
    
    # good - uses `DateTime` with start argument for historical date
    DateTime.iso8601('1751-04-23', Date::ENGLAND)

    include is used at the top level. Use inside class or module.
    Open

    include InstructorInterfaceHelperSpec
    Severity: Minor
    Found in spec/features/quiz_spec.rb by rubocop

    This cop checks that include, extend and prepend exists at the top level. Using these at the top level affects the behavior of Object. There will not be using include, extend and prepend at the top level. Let's use it inside class or module.

    Example:

    # bad
    include M
    
    class C
    end
    
    # bad
    extend M
    
    class C
    end
    
    # bad
    prepend M
    
    class C
    end
    
    # good
    class C
      include M
    end
    
    # good
    class C
      extend M
    end
    
    # good
    class C
      prepend M
    end

    Prefer Date or Time over DateTime.
    Open

      create :assignment_due_date, due_at: (DateTime.now.in_time_zone + 1.day), deadline_type: @review_deadline_type
    Severity: Minor
    Found in spec/features/quiz_spec.rb by rubocop

    This cop checks for uses of DateTime that should be replaced by Date or Time.

    Example:

    # bad - uses `DateTime` for current time
    DateTime.now
    
    # good - uses `Time` for current time
    Time.now
    
    # bad - uses `DateTime` for modern date
    DateTime.iso8601('2016-06-29')
    
    # good - uses `Date` for modern date
    Date.iso8601('2016-06-29')
    
    # good - uses `DateTime` with start argument for historical date
    DateTime.iso8601('1751-04-23', Date::ENGLAND)

    There are no issues that match your filters.

    Category
    Status