expertiza/expertiza

View on GitHub
spec/controllers/conference_controller_spec.rb

Summary

Maintainability
A
2 hrs
Test Coverage

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

describe ConferenceController do
  let(:admin) { build(:admin, id: 3) }
  let(:super_admin) { build(:superadmin) }
  let(:instructor) { build(:instructor, id: 2) }
  let(:instructor1) { build(:instructor, id: 2, timezonepref: 'Eastern Time (US & Canada)') }

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.

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

  context '#create' do
    before(:each) do
      allow(User).to receive(:find).with(3).and_return(admin)
    end

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.

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

  context 'Author/Co-Author login with captcha' do
    it 'should redirect to root with correct recaptcha' do
      user_session = { user: student1 }
      request_params = {
        user: { name: 'lily',

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.

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

    it 'should redirect to root with correct recaptcha' do
      user_session = { user: student1 }
      request_params = {
        user: { name: 'lily',
                crypted_password: 'password',

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.

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

    it 'should redirect to join conference page with incorrect recaptcha' do
      user_session = { user: student2 }
      request_params = {
        user: { name: 'lily2',
                crypted_password: 'password',

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.

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

      request_params = {
        user: { name: 'lily',
                crypted_password: 'password',
                role_id: 1,
                password_salt: 1,
Severity: Major
Found in spec/controllers/conference_controller_spec.rb and 4 other locations - About 55 mins to fix
spec/controllers/conference_controller_spec.rb on lines 138..159
spec/controllers/users_controller_spec.rb on lines 202..223
spec/controllers/users_controller_spec.rb on lines 232..253
spec/controllers/users_controller_spec.rb on lines 263..284

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 5 locations. Consider refactoring.
Open

      request_params = {
        user: { name: 'lily2',
                crypted_password: 'password',
                role_id: 1,
                password_salt: 1,
Severity: Major
Found in spec/controllers/conference_controller_spec.rb and 4 other locations - About 55 mins to fix
spec/controllers/conference_controller_spec.rb on lines 108..129
spec/controllers/users_controller_spec.rb on lines 202..223
spec/controllers/users_controller_spec.rb on lines 232..253
spec/controllers/users_controller_spec.rb on lines 263..284

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 4 locations. Consider refactoring.
Open

  let(:assignment) do
    build(:assignment, id: 1, name: 'test_assignment', instructor_id: 2,
                       participants: [build(:participant, id: 1, user_id: 1, assignment: assignment)], course_id: 1)
Severity: Minor
Found in spec/controllers/conference_controller_spec.rb and 3 other locations - About 15 mins to fix
spec/controllers/account_request_controller_spec.rb on lines 18..20
spec/controllers/assessment360_controller_spec.rb on lines 21..27
spec/controllers/users_controller_spec.rb on lines 19..21

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 25.

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