ece517-p3/expertiza

View on GitHub

Showing 2,813 of 2,813 total issues

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

  describe '#compute_assignment_score' do
    before(:each) do
      allow(review_questionnaire).to receive(:symbol).and_return(:review)
      allow(assignment).to receive(:compute_total_score).with(any_args).and_return(100)
    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. [32/25]
Open

  describe '#delete' do
    before(:each) do
      allow(ReviewResponseMap).to receive(:where).with(reviewed_object_id: 1).and_return([review_response_map])
      allow(TeammateReviewResponseMap).to receive(:where).with(reviewed_object_id: 1).and_return([teammate_review_response_map])
    end
Severity: Minor
Found in spec/models/assignment_spec.rb by rubocop

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

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

  describe '#add_to_delayed_queue' do
    before(:each) do
      allow(AssignmentDueDate).to receive(:where).with(parent_id: 1).and_return([due_date])
      allow_any_instance_of(AssignmentForm).to receive(:find_min_from_now).with(any_args).and_return(666)
      allow(due_date).to receive(:update_attribute).with(:delayed_job_id, any_args).and_return('Succeed!')
Severity: Minor
Found in spec/models/assignment_form_spec.rb by rubocop

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

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

  describe '#save_topic_deadlines' do
    context 'when topic_due_date cannot be found' do
      it 'creates a new topic_due_date record and redirects to assignment#edit page' do
        assignment.due_dates = [due_date, due_date2]
        allow(SignUpTopic).to receive(:where).with(assignment_id: '1').and_return([topic])

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

    context 'when an assignment requires quiz' do
      before(:each) do
        @params = {aid: 1,
                   model: 'QuizQuestionnaire',
                   pid: 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.

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

  describe '#delete' do
    context 'when assignment is deleted successfully' do
      it 'shows a success flash message and redirects to tree_display#list page' do
        assignment_form = AssignmentForm.new
        allow(AssignmentForm).to receive(:new).and_return(assignment_form)

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

  describe '#action_allowed?' do
    context 'when params action is edit' do
      before(:each) do
        controller.params = {id: '1', action: 'edit'}
      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. [32/25]
Open

  describe "check if token is expired" do
    it "checks when token is expired" do
      local_token = "some random string"
      @password_retrival = PasswordReset.new
      @password_retrival.token = Digest::SHA1.hexdigest(local_token)

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

  describe "Due dates tab", js: true do
    before(:each) do
      @assignment = create(:assignment, name: 'public assignment for test')
      login_as("instructor6")
      visit "/assignments/#{@assignment.id}/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.

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

      params = {
        user: {name: 'instructor6',
               crypted_password: 'password',
               role_id: 2,
               password_salt: 1,
Severity: Major
Found in spec/controllers/users_controller_spec.rb and 2 other locations - About 55 mins to fix
spec/controllers/users_controller_spec.rb on lines 146..167
spec/controllers/users_controller_spec.rb on lines 176..197

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

      params = {
        user: {name: 'lily',
               crypted_password: 'password',
               role_id: 2,
               password_salt: 1,
Severity: Major
Found in spec/controllers/users_controller_spec.rb and 2 other locations - About 55 mins to fix
spec/controllers/users_controller_spec.rb on lines 176..197
spec/controllers/users_controller_spec.rb on lines 207..228

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

      params = {
        user: {name: 'instructor6',
               crypted_password: 'password',
               role_id: 2,
               password_salt: 1,
Severity: Major
Found in spec/controllers/users_controller_spec.rb and 2 other locations - About 55 mins to fix
spec/controllers/users_controller_spec.rb on lines 146..167
spec/controllers/users_controller_spec.rb on lines 207..228

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 44.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method populate_hash_for_all_students_all_reviews has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def populate_hash_for_all_students_all_reviews(assignment,
                                                 course_participant,
                                                 reviews,
                                                 hash_per_stu,
                                                 overall_review_grade_hash,
Severity: Major
Found in app/controllers/assessment360_controller.rb - About 50 mins to fix

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

      factory :participant, class: AssignmentParticipant do
        can_submit true
        can_review true
        assignment { Assignment.first || association(:assignment) }
        association :user, factory: :student
    Severity: Minor
    Found in spec/factories/factories.rb and 1 other location - About 50 mins to fix
    spec/factories/factories.rb on lines 264..278

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

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

      factory :course_participant, class: CourseParticipant do
        can_submit true
        can_review true
        course { Course.first || association(:course) }
        association :user, factory: :student
    Severity: Minor
    Found in spec/factories/factories.rb and 1 other location - About 50 mins to fix
    spec/factories/factories.rb on lines 247..261

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

    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

        unless @response_id.nil?
          first_question_in_questionnaire = Answer.where(response_id: @response_id).first.question_id
          questionnaire_id = Question.find(first_question_in_questionnaire).questionnaire_id
          questionnaire = Questionnaire.find(questionnaire_id)
          @maxscore = questionnaire.max_question_score
    Severity: Minor
    Found in app/controllers/popup_controller.rb and 1 other location - About 50 mins to fix
    app/controllers/popup_controller.rb on lines 13..22

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

    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

        unless @response_id.nil?
          first_question_in_questionnaire = Answer.where(response_id: @response_id).first.question_id
          questionnaire_id = Question.find(first_question_in_questionnaire).questionnaire_id
          questionnaire = Questionnaire.find(questionnaire_id)
          @maxscore = questionnaire.max_question_score
    Severity: Minor
    Found in app/controllers/popup_controller.rb and 1 other location - About 50 mins to fix
    app/controllers/popup_controller.rb on lines 303..312

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

    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

    File Content Disclosure in Action View
    Open

        actionview (4.2.7.1)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2019-5418

    Criticality: High

    URL: https://groups.google.com/forum/#!topic/rubyonrails-security/pFRKI96Sm8Q

    Solution: upgrade to >= 4.2.11.1, ~> 4.2.11, >= 5.0.7.2, ~> 5.0.7, >= 5.1.6.2, ~> 5.1.6, >= 5.2.2.1, ~> 5.2.2, >= 6.0.0.beta3

    Potential remote code execution of user-provided local names in ActionView
    Open

        actionview (4.2.7.1)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2020-8163

    Criticality: High

    URL: https://groups.google.com/forum/#!topic/rubyonrails-security/hWuKcHyoKh0

    Solution: upgrade to >= 4.2.11.2

    OS Command Injection in Rake
    Open

        rake (12.3.0)
    Severity: Critical
    Found in Gemfile.lock by bundler-audit

    Advisory: CVE-2020-8130

    Criticality: High

    URL: https://github.com/advisories/GHSA-jppv-gw3r-w3q8

    Solution: upgrade to >= 12.3.3

    Severity
    Category
    Status
    Source
    Language