expertiza/expertiza

View on GitHub

Showing 4,497 of 4,497 total issues

Assignment Branch Condition size for create is too high. [71.62/15]
Open

  def create
    user = User.find_by(name: params[:user][:name].strip)
    unless user
      urlCreate = url_for controller: 'users', action: 'new'
      flash[:error] = "\"#{params[:user][:name].strip}\" is not defined. Please <a href=\"#{urlCreate}\">create</a> this user before continuing."

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

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

describe QuestionnaireNode do
  let(:questionnaire) { build(:questionnaire) }
  let(:questionnaire2) { build(:questionnaire) }
  let(:questionnaire3) { build(:questionnaire) }
  let(:questionnaire_node) { build(:questionnaire_node) }

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

describe 'internationalization', js: true do
  before(:each) do
    instructor = create(:instructor, name: 'hindi_instructor')
    student = create(:student)

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.

Assignment Branch Condition size for assignment_tagging_progress is too high. [69.75/15]
Open

  def assignment_tagging_progress
    teams = Team.where(parent_id: assignment_id)
    questions = Question.where(questionnaire_id: questionnaire.id, type: question_type)
    questions_ids = questions.map(&:id)
    user_answer_tagging = []
Severity: Minor
Found in app/models/tag_prompt_deployment.rb by rubocop

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

Assignment Branch Condition size for create is too high. [68.48/15]
Open

  def create
    existing_teams = AssignmentTeam.where name: params[:team][:name], parent_id: student.parent_id
    # check if the team name is in use
    if existing_teams.empty?
      if params[:team][:name].blank?

This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

File assignment.rb has 491 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class Assignment < ApplicationRecord
  require 'analytic/assignment_analytic'
  include Scoring
  include AssignmentAnalytic
  include ReviewAssignment
Severity: Minor
Found in app/models/assignment.rb - About 7 hrs to fix

    Assignment Branch Condition size for edit is too high. [67.36/15]
    Open

      def edit(_count)
        html = '<td align="center"><a rel="nofollow" data-method="delete" href="/questions/' + id.to_s + '">Remove</a></td>'
        html += '<td><input size="6" value="' + seq.to_s + '" name="question[' + id.to_s + '][seq]"'
        html += ' id="question_' + id.to_s + '_seq" type="text"></td>'
        html += '<td><textarea cols="50" rows="1" name="question[' + id.to_s + '][txt]"'
    Severity: Minor
    Found in app/models/cake.rb by rubocop

    This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

    Class Assignment has 54 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Assignment < ApplicationRecord
      require 'analytic/assignment_analytic'
      include Scoring
      include AssignmentAnalytic
      include ReviewAssignment
    Severity: Major
    Found in app/models/assignment.rb - About 7 hrs to fix

      Assignment Branch Condition size for delete_signup_as_instructor is too high. [66.6/15]
      Open

        def delete_signup_as_instructor
          # find participant using assignment using team and topic ids
          team = Team.find(params[:id])
          assignment = Assignment.find(team.parent_id)
          user = TeamsUser.find_by(team_id: team.id).user

      This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

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

        describe 'response_report' do
          before(:each) do
            stub_const('WEBSERVICE_CONFIG', 'summary_webservice_url' => 'expertiza.ncsu.edu')
          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. [111/25]
      Open

      describe RolesController do
        let(:super_admin) { build(:superadmin, id: 1, role_id: 5) }
        let(:student) { build(:student, id: 1, role_id: 1) }
        let(:student_role) { build(:role_of_student, id: 1, name: 'Student_role_test', description: '', parent_id: nil, default_page_id: nil) }
        let(:instructor_role) { build(:role_of_instructor, id: 2, name: 'Instructor_role_test', description: '', parent_id: nil, default_page_id: nil) }

      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.

      Function methods has 187 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var methods = (function () {
          // private properties and methods go here
          var c = {
            bcClass: 'sf-breadcrumb',
            menuClass: 'sf-js-enabled',
      Severity: Major
      Found in app/assets/javascripts/superfish.js - About 7 hrs to fix

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

        describe ResponseMap do
          let(:team) { build(:assignment_team, id: 1, name: 'team no name', assignment: assignment, users: [student], parent_id: 1) }
          let(:team1) { build(:assignment_team, id: 2, name: 'team has name', assignment: assignment, users: [student1]) }
          let(:team2) { build(:assignment_team, id: 3, name: 'team has a name', assignment: assignment, users: [student2]) }
          let(:participant) { build(:participant, id: 1, parent_id: 1, user: student) }
        Severity: Minor
        Found in spec/models/response_map_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. [110/25]
        Open

          describe '#four_node_cycles' do
            context 'when the reviewers of current reviewer (ap3) does not include current assignment participant' do
              it 'skips this reviewer (ap3) and returns corresponding collusion cycles' do
                # Sets up stubs for test
                allow(ReviewResponseMap).to receive(:where).with('reviewee_id = ?', team1.id).and_return([response_map_team_1_2])
        Severity: Minor
        Found in spec/models/collusion_cycle_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. [109/25]
        Open

        describe Ta do
          let!(:ta) { create(:teaching_assistant, id: 999) }
          let(:course1) { build(:course, id: 1, name: 'ECE517') }
          let(:course2) { build(:course, id: 2, name: 'ECE506') }
          let(:instructor) { build(:instructor, id: 6) }
        Severity: Minor
        Found in spec/models/ta_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. [109/25]
        Open

        describe LatePolicy do
          let(:late_policy) { build(:late_policy) }
          let(:calculated_penalty) { build(:calculated_penalty) }
          let(:participant) { build(:participant) }
          let(:assignment_due_date) { build(:assignment_due_date) }
        Severity: Minor
        Found in spec/models/late_policy_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. [109/25]
        Open

        describe "check 'Begin review' showing up before due date and 'Assign grade' after due date" do
          let(:team) { build(:assignment_team, id: 1, name: 'team1') }
        
          it 'Begin review' do
            instructor6 = create(:instructor) # create instructor6

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

        class ReviewMappingController < ApplicationController
          include AuthorizationHelper
        
          autocomplete :user, :name
          # helper :dynamic_review_assignment
        Severity: Minor
        Found in app/controllers/review_mapping_controller.rb - About 7 hrs to fix

          Assignment Branch Condition size for edit is too high. [63.69/15]
          Open

            def edit
              quiz_question_choices = QuizQuestionChoice.where(question_id: id)
          
              html = '<tr><td>'
              html += '<textarea cols="100" name="question[' + id.to_s + '][txt]" '
          Severity: Minor
          Found in app/models/true_false.rb by rubocop

          This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric

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

          describe 'due_date_functions' do
            before(:each) do
              @deadline_type = build(:deadline_type)
              @deadline_right = build(:deadline_right)
              @assignment_due_date = build(:assignment_due_date, deadline_type: @deadline_type,
          Severity: Minor
          Found in spec/models/due_date_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.

          Severity
          Category
          Status
          Source
          Language