expertiza/expertiza

View on GitHub
spec/controllers/submitted_content_controller_spec.rb

Summary

Maintainability
F
3 days
Test Coverage

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

describe SubmittedContentController do
  let(:admin) { build(:admin, id: 3) }
  let(:super_admin) { build(:superadmin, id: 1, role_id: 5) }
  let(:instructor1) { build(:instructor, id: 10, role_id: 3, parent_id: 3, name: 'Instructor1') }
  let(:student1) { build(:student, id: 21, role_id: 1) }

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 submitted_content_controller_spec.rb has 327 lines of code (exceeds 250 allowed). Consider refactoring.
Open

describe SubmittedContentController do
  let(:admin) { build(:admin, id: 3) }
  let(:super_admin) { build(:superadmin, id: 1, role_id: 5) }
  let(:instructor1) { build(:instructor, id: 10, role_id: 3, parent_id: 3, name: 'Instructor1') }
  let(:student1) { build(:student, id: 21, role_id: 1) }
Severity: Minor
Found in spec/controllers/submitted_content_controller_spec.rb - About 3 hrs to fix

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

      describe '#download' do
        context 'user downloads file' do
          it 'flashes error for nil folder name' do
            params = {folder_name: nil}
            response = get :download, params: params

    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. [37/25]
    Open

      describe '#action_allowed?' do
        context 'current user is not authorized' do
          it 'does not allow action for no user' do
            expect(controller.send(:action_allowed?)).to be false
          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. [30/25]
    Open

      describe '#submit_file' do
        context 'current user does not match up with the participant' do
          # this test has problems after rails 5.1 migration, getting 'undefined method 'size' for nil:NilClass' error
          # when 'check_content_size' method is called in submitted_content_controller, doesn't seem to be a problem in
          # other submit_file tests that should call the same method though...

    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

        context 'current user has needed privileges' do
          it 'allows edit action for student with needed authorizations' do
            stub_current_user(student1, student1.role.name, student1.role)
            allow(controller).to receive(:are_needed_authorizations_present?).and_return(true)
            controller.params = {action: 'edit'}

    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

        context 'user that is participant uploads a file' do
          before(:each) do
            allow(AssignmentParticipant).to receive(:find).and_return(participant)
            stub_current_user(student1, student1.role.name, student1.role)
          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.

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        context 'user that is participant uploads a file' do
          before(:each) do
            allow(AssignmentParticipant).to receive(:find).and_return(participant)
            stub_current_user(student1, student1.role.name, student1.role)
          end
    Severity: Major
    Found in spec/controllers/submitted_content_controller_spec.rb and 1 other location - About 4 hrs to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 198..221

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

    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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        context 'user that is participant uploads a file' do
          before(:each) do
            allow(AssignmentParticipant).to receive(:find).and_return(participant)
            stub_current_user(student1, student1.role.name, student1.role)
          end
    Severity: Major
    Found in spec/controllers/submitted_content_controller_spec.rb and 1 other location - About 4 hrs to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 116..138

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

    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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        context 'user downloads file' do
          it 'flashes error for nil folder name' do
            params = {folder_name: nil}
            response = get :download, params: params
            expect(flash[:error]).to be_present # not checking message content since it uses exception message
    Severity: Major
    Found in spec/controllers/submitted_content_controller_spec.rb and 1 other location - About 2 hrs to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 169..190

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

    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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

        context 'user downloads file' do
          it 'flashes error for nil folder name' do
            params = {folder_name: nil}
            response = get :download, params: params
            expect(flash[:error]).to be_present # not checking message content since it uses exception message
    Severity: Major
    Found in spec/controllers/submitted_content_controller_spec.rb and 1 other location - About 2 hrs to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 252..273

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

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

      describe 'student#edit' do
        it 'student#edit it' do
          allow(AssignmentParticipant).to receive(:find).and_return(participant)
          allow(Participant).to receive(:find_by).and_return(participant)
          allow(User).to receive(:find).and_return(participant)
    Severity: Major
    Found in spec/controllers/submitted_content_controller_spec.rb and 2 other locations - About 1 hr to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 343..352
    spec/controllers/submitted_content_controller_spec.rb on lines 359..368

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

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

      describe 'instructor#edit' do
        it 'instructor#edit it' do
          allow(AssignmentParticipant).to receive(:find).and_return(participant)
          allow(Participant).to receive(:find_by).and_return(participant)
          allow(User).to receive(:find).and_return(participant)
    Severity: Major
    Found in spec/controllers/submitted_content_controller_spec.rb and 2 other locations - About 1 hr to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 327..336
    spec/controllers/submitted_content_controller_spec.rb on lines 359..368

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

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

      describe 'superadmin#edit' do
        it 'superadmin#edit it' do
          allow(AssignmentParticipant).to receive(:find).and_return(participant)
          allow(Participant).to receive(:find_by).and_return(participant)
          allow(User).to receive(:find).and_return(participant)
    Severity: Major
    Found in spec/controllers/submitted_content_controller_spec.rb and 2 other locations - About 1 hr to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 327..336
    spec/controllers/submitted_content_controller_spec.rb on lines 343..352

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

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

      describe 'instructor#view' do
        it 'instructor#view it' do
          allow(AssignmentParticipant).to receive(:find).and_return(participant)
          stub_current_user(instructor1, instructor1.role.name, instructor1.role)
          allow(participant).to receive(:name).and_return('Name')
    Severity: Major
    Found in spec/controllers/submitted_content_controller_spec.rb and 2 other locations - About 1 hr to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 285..292
    spec/controllers/submitted_content_controller_spec.rb on lines 313..320

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

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

      describe 'student#view' do
        it 'student#view it' do
          allow(AssignmentParticipant).to receive(:find).and_return(participant)
          stub_current_user(student1, student1.role.name, student1.role)
          allow(participant).to receive(:name).and_return('Name')
    Severity: Major
    Found in spec/controllers/submitted_content_controller_spec.rb and 2 other locations - About 1 hr to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 299..306
    spec/controllers/submitted_content_controller_spec.rb on lines 313..320

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

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

      describe 'superadmin#view' do
        it 'superadmin#view it' do
          allow(AssignmentParticipant).to receive(:find).and_return(participant)
          stub_current_user(superadmin1, superadmin1.role.name, superadmin1.role)
          allow(participant).to receive(:name).and_return('Name')
    Severity: Major
    Found in spec/controllers/submitted_content_controller_spec.rb and 2 other locations - About 1 hr to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 285..292
    spec/controllers/submitted_content_controller_spec.rb on lines 299..306

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

    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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      describe '#folder_action' do
        context 'current user does not match up with the participant' do
          #method just returns in this context, how do we test that?
        end
        context 'current user is participant performing folder action' do
    Severity: Minor
    Found in spec/controllers/submitted_content_controller_spec.rb and 1 other location - About 45 mins to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 147..165

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

    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

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      describe '#folder_action' do
        context 'current user does not match up with the participant' do
          #method just returns in this context, how do we test that?
        end
        context 'current user is participant performing folder action' do
    Severity: Minor
    Found in spec/controllers/submitted_content_controller_spec.rb and 1 other location - About 45 mins to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 230..248

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

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

          it 'allows submit hyperlink action for students with team that can submit' do
            stub_current_user(student1, student1.role.name, student1.role)
            allow(controller).to receive(:one_team_can_submit_work?).and_return(true)
            controller.params = {action: 'submit_hyperlink'}
            expect(controller.send(:action_allowed?)).to be true
    Severity: Minor
    Found in spec/controllers/submitted_content_controller_spec.rb and 2 other locations - About 25 mins to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 20..24
    spec/controllers/submitted_content_controller_spec.rb on lines 26..30

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

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

          it 'allows submit file action for students with team that can submit' do
            stub_current_user(student1, student1.role.name, student1.role)
            allow(controller).to receive(:one_team_can_submit_work?).and_return(true)
            controller.params = {action: 'submit_file'}
            expect(controller.send(:action_allowed?)).to be true
    Severity: Minor
    Found in spec/controllers/submitted_content_controller_spec.rb and 2 other locations - About 25 mins to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 20..24
    spec/controllers/submitted_content_controller_spec.rb on lines 32..36

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

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

          it 'allows edit action for student with needed authorizations' do
            stub_current_user(student1, student1.role.name, student1.role)
            allow(controller).to receive(:are_needed_authorizations_present?).and_return(true)
            controller.params = {action: 'edit'}
            expect(controller.send(:action_allowed?)).to be true
    Severity: Minor
    Found in spec/controllers/submitted_content_controller_spec.rb and 2 other locations - About 25 mins to fix
    spec/controllers/submitted_content_controller_spec.rb on lines 26..30
    spec/controllers/submitted_content_controller_spec.rb on lines 32..36

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

    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

    Missing space after #.
    Open

            #stub_current_user(student1, student1.role.name, student1.role)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

          #end

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            expect(flash[:error]).to be_present #not checking message content since it uses exception message

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Space inside } missing.
    Open

            controller.params = {action: 'submit_hyperlink'}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Missing space after #.
    Open

            #params = {id: 1}

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #request_params = { id: 1 }

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #params = {folder_name: 'test_dir', name: 'test.txt'}

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Space inside } missing.
    Open

            params = {submission: "abc123", id: 21}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Missing space after #.
    Open

          it 'renders edit template' #do

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Incorrect indentation detected (column 8 instead of 6).
    Open

            #expect(response).to redirect_to(action: :view, id: 1)

    This cops checks the indentation of comments.

    Example:

    # bad
      # comment here
    def method_name
    end
    
      # comment here
    a = 'hello'
    
    # yet another comment
      if true
        true
      end
    
    # good
    # comment here
    def method_name
    end
    
    # comment here
    a = 'hello'
    
    # yet another comment
    if true
      true
    end

    Missing space after #.
    Open

          #end

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Space inside { missing.
    Open

            controller.params = {action: 'submit_file'}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Missing space after #.
    Open

            #allow(participant).to receive(:team).and_return(team)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #stub_current_user(instructor1, instructor1.role.name, instructor1.role)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Incorrect indentation detected (column 8 instead of 6).
    Open

            #expect(response).to redirect_to(action: :edit, id: 1)

    This cops checks the indentation of comments.

    Example:

    # bad
      # comment here
    def method_name
    end
    
      # comment here
    a = 'hello'
    
    # yet another comment
      if true
        true
      end
    
    # good
    # comment here
    def method_name
    end
    
    # comment here
    a = 'hello'
    
    # yet another comment
    if true
      true
    end

    Missing space after #.
    Open

          it 'redirects to edit if submissions are allowed' #do

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #response = get :download, params

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

          #method just returns in this context, how do we test that?

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #params = {folder_name: 'test_dir', name: 'test.txt'}

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #allow(team).to receive(:hyperlinks).and_return(['google.com'])

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #allow(AssignmentParticipant).to receive(:find).and_return(participant)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #expect(response).to redirect_to(action: :edit, id: 1)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #expect(download).to receive(:send_file)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

          it 'redirects to edit' #do

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #params = {id: 1, faction: nil}

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            expect(flash[:error]).to be_present #not checking message content since it uses exception message

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #File.stub(:exist?).and_return(true)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Space inside { missing.
    Open

            params = {submission: "google.com", id: 21}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Missing space after #.
    Open

          it 'redirects to edit' #do

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #expect(response).to redirect_to(action: :edit, id: 1)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

          #end

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Space inside } missing.
    Open

            controller.params = {action: 'submit_file'}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Missing space after #.
    Open

            #response = get :remove_hyperlink, params

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #params = {id: 1, faction: nil}

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #expect(response).to redirect_to(action: :edit, id: 1)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #response = get :remove_hyperlink, params

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

          it 'redirects to view if submissions are not allowed' #do

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #allow(assignment).to receive(:submission_allowed).and_return(true)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #File.stub(:exist?).and_return(true)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #expect(download).to receive(:send_file)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Space inside } missing.
    Open

            params = {submission: "google.com", id: 21}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Missing space after #.
    Open

            #expect(response).to redirect_to(action: :edit, id: 1)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Space inside { missing.
    Open

            params = {submission: "abc123", id: 21}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Missing space after #.
    Open

            #params = {id: 1}

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #response = get :folder_action, params

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

        #NOTE - this method is not currently used, the below context is a start

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #allow(assignment).to receive(:submission_allowed).and_return(true)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #allow(AssignmentParticipant).to receive(:find).and_return(participant)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #expect(response).to redirect_to(action: :view, id: 1)

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #response = get :submit_file, params: request_params

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

          #end

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

          #method just returns in this context, how do we test that?

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Missing space after #.
    Open

            #response = get :download, params

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Incorrect indentation detected (column 8 instead of 6).
    Open

            #expect(response).to redirect_to(action: :edit, id: 1)

    This cops checks the indentation of comments.

    Example:

    # bad
      # comment here
    def method_name
    end
    
      # comment here
    a = 'hello'
    
    # yet another comment
      if true
        true
      end
    
    # good
    # comment here
    def method_name
    end
    
    # comment here
    a = 'hello'
    
    # yet another comment
    if true
      true
    end

    Incorrect indentation detected (column 8 instead of 6).
    Open

            #expect(response).to redirect_to(action: :edit, id: 1)

    This cops checks the indentation of comments.

    Example:

    # bad
      # comment here
    def method_name
    end
    
      # comment here
    a = 'hello'
    
    # yet another comment
      if true
        true
      end
    
    # good
    # comment here
    def method_name
    end
    
    # comment here
    a = 'hello'
    
    # yet another comment
    if true
      true
    end

    Missing space after #.
    Open

          #end

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Incorrect indentation detected (column 8 instead of 6).
    Open

            #expect(response).to redirect_to(action: :edit, id: 1)

    This cops checks the indentation of comments.

    Example:

    # bad
      # comment here
    def method_name
    end
    
      # comment here
    a = 'hello'
    
    # yet another comment
      if true
        true
      end
    
    # good
    # comment here
    def method_name
    end
    
    # comment here
    a = 'hello'
    
    # yet another comment
    if true
      true
    end

    Missing space after #.
    Open

            #response = get :folder_action, params

    This cop checks whether comments have a leading space after the # denoting the start of the comment. The leading space is not required for some RDoc special syntax, like #++, #--, #:nodoc, =begin- and =end comments, "shebang" directives, or rackup options.

    Example:

    # bad
    #Some comment
    
    # good
    # Some comment

    Space inside { missing.
    Open

            controller.params = {action: 'edit'}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside } missing.
    Open

            controller.params = {action: 'edit'}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside { missing.
    Open

            controller.params = {action: 'submit_hyperlink'}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside { missing.
    Open

            params = {folder_name: 'test_directory', name: nil}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside } missing.
    Open

            params = {folder_name: nil}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside } missing.
    Open

            params = {folder_name: 'unlikely_dir_name', name: 'nonexistantfile.no'}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Useless assignment to variable - response.
    Open

            response = get :download, params: params

    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

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

          testfile = instance_double(File, read: 'testing read', size: 5000000)

    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

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

                                        "Please upload one of the following: "\

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Space inside } missing.
    Open

            params = {folder_name: nil}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside } missing.
    Open

            params = {name: nil}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

            expect(flash[:error]).to eq "File extension does not match. "\

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

                                        "pdf, png, jpeg, zip, tar, gz, 7z, odt, docx, md, rb, mp4, txt"

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

            allow_any_instance_of(Rack::Test::UploadedFile::String).to receive(:original_filename).and_return("")

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Space inside { missing.
    Open

            params = {folder_name: nil}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside } missing.
    Open

            params = {folder_name: 'test_directory', name: nil}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside { missing.
    Open

            params = {folder_name: 'unlikely_dir_name', name: 'nonexistantfile.no'}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Useless assignment to variable - response.
    Open

            response = get :download, params: params

    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

    Useless assignment to variable - response.
    Open

            response = get :download, params: params

    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

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

                                        "pdf, png, jpeg, zip, tar, gz, 7z, odt, docx, md, rb, mp4, txt"

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Space inside } missing.
    Open

            params = {uploaded_file: file, id: 1}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside } missing.
    Open

            params = {folder_name: 'unlikely_dir_name', name: 'nonexistantfile.no'}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

                                        "Please upload one of the following: "\

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Space inside { missing.
    Open

            params = {folder_name: 'test_directory', name: nil}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside { missing.
    Open

            params = {name: nil}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

            params = {submission: "google.com", id: 21}

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Space inside { missing.
    Open

            params = {folder_name: 'unlikely_dir_name', name: 'nonexistantfile.no'}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside } missing.
    Open

                      id: 1}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

            expect(flash[:error]).to eq "File extension does not match. "\

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Space inside { missing.
    Open

            params = {uploaded_file: file,

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside } missing.
    Open

                      id: 1}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside } missing.
    Open

            params = {folder_name: 'test_directory', name: nil}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Useless assignment to variable - response.
    Open

            response = get :download, params: params

    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

    Space inside } missing.
    Open

                      id: 1}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside { missing.
    Open

            params = {name: nil}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

            allow_any_instance_of(Rack::Test::UploadedFile::String).to receive(:read).and_return("")

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Space inside { missing.
    Open

            params = {uploaded_file: file,

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Useless assignment to variable - response.
    Open

            response = get :download, params: params

    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

    Useless assignment to variable - response.
    Open

            response = get :download, params: params

    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

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

            params = {submission: "abc123", id: 21}

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Space inside } missing.
    Open

            params = {name: nil}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside { missing.
    Open

            params = {folder_name: nil}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Useless assignment to variable - response.
    Open

            response = get :download, params: params

    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

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

            allow_any_instance_of(Rack::Test::UploadedFile::String).to receive(:original_filename).and_return("")

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Space inside { missing.
    Open

            params = {uploaded_file: file, id: 1}

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Space inside { missing.
    Open

            params = {uploaded_file: file,

    Checks that braces used for hash literals have or don't have surrounding space depending on configuration.

    Example: EnforcedStyle: space

    # The `space` style enforces that hash literals have
    # surrounding space.
    
    # bad
    h = {a: 1, b: 2}
    
    # good
    h = { a: 1, b: 2 }

    Example: EnforcedStyle: no_space

    # The `no_space` style enforces that hash literals have
    # no surrounding space.
    
    # bad
    h = { a: 1, b: 2 }
    
    # good
    h = {a: 1, b: 2}

    Example: EnforcedStyle: compact

    # The `compact` style normally requires a space inside
    # hash braces, with the exception that successive left
    # braces or right braces are collapsed together in nested hashes.
    
    # bad
    h = { a: { b: 2 } }
    
    # good
    h = { a: { b: 2 }}

    Useless assignment to variable - response.
    Open

            response = get :download, params: params

    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

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

            allow_any_instance_of(Rack::Test::UploadedFile::String).to receive(:read).and_return("")

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

        it "file size 500 should succeed" do

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    Prefer single-quoted strings when you don't need string interpolation or special symbols.
    Open

        it "file size 5,000,000 should fail" do

    Checks if uses of quotes match the configured preference.

    Example: EnforcedStyle: single_quotes (default)

    # bad
    "No special symbols"
    "No string interpolation"
    "Just text"
    
    # good
    'No special symbols'
    'No string interpolation'
    'Just text'
    "Wait! What's #{this}!"

    Example: EnforcedStyle: double_quotes

    # bad
    'Just some text'
    'No special chars or interpolation'
    
    # good
    "Just some text"
    "No special chars or interpolation"
    "Every string in #{project} uses double_quotes"

    There are no issues that match your filters.

    Category
    Status