expertiza/expertiza

View on GitHub

Showing 1,918 of 4,506 total issues

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

describe TreeDisplayController do
  # Airbrake-1517247902792549741
  describe '#list' do
    it 'should not redirect if current user is an instructor' do
      user = build(:instructor)

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

describe GradesHelper, type: :helper do
  let(:review_response) { build(:response, id: 1, map_id: 1) }
  let(:question) { build(:question) }
  let(:participant) { build(:participant, id: 1, assignment: assignment, user_id: 1, parent_id: 1) }
  let(:team) { build(:assignment_team, id: 1) }
Severity: Minor
Found in spec/helpers/grades_helper_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.

Class has too many lines. [264/100]
Open

class ImportFileController < ApplicationController
  include AuthorizationHelper

  def action_allowed?
    current_user_has_ta_privileges?

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [256/100]
Open

class TreeDisplayController < ApplicationController
  helper :application
  include SecurityHelper
  include AuthorizationHelper

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

describe LatePoliciesController do
  let(:instructor) { build(:instructor, id: 6) }

  before(:each) do
    stub_current_user(instructor, instructor.role.name, instructor.role)

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

describe TeamsController do
  # Performs authorization check for user
  include_context 'object initializations'

  describe 'action allowed method' do

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

describe ParticipantsController do
  let(:instructor) { build(:instructor, id: 6) }
  let(:student) { build(:student) }
  let(:student1) { build_stubbed(:student, id: 1, name: 'student') }
  let(:course_participant) { build(:course_participant) }

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

  describe 'creation page', js: true do
    before(:each) do
      (1..3).each do |i|
        create(:course, name: "Course #{i}")
      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.

Class has too many lines. [248/100]
Open

class Response < ApplicationRecord
  # Added for E1973. A team review will have a lock on it so only one user at a time may edit it.
  include Lockable
  include ResponseAnalytic
  include Scoring
Severity: Minor
Found in app/models/response.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

describe MentorManagement do
  # using let! so that state is automatically set up before each example group
  # this could also be accomplished with before(:each) and instance methods
  # but the rest of the code base makes use of let a lot, so this is consistent
  # with that, while achieving the same goal as before(:each)

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.

Class has too many lines. [247/100]
Open

class User < ApplicationRecord
  enum locale: Locale.code_name_to_db_encoding(Locale.available_locale_preferences)
  acts_as_authentic do |config|
    config.validates_uniqueness_of_email_field_options = { if: -> { false } } # Don't validate email uniqueness
    config.crypto_provider = Authlogic::CryptoProviders::Sha1
Severity: Minor
Found in app/models/user.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

describe 'Staggered deadline test' do
  before(:each) do
    # assignment and topic
    create(:assignment,
           name: 'Assignment1665',

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

describe SignUpTopic do
  let(:topic) { build(:topic) }
  let(:suggestion) { build(:suggestion, id: 1, assignment_id: 1) }
  let(:signed_up_team) { build(:signed_up_team) }
  let(:team) { create(:assignment_team, id: 1, name: 'team 1', users: [user, user2]) }
Severity: Minor
Found in spec/models/sign_up_topic_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.

Class has too many lines. [240/100]
Open

class Team < ApplicationRecord
  has_many :teams_users, dependent: :destroy
  has_many :users, through: :teams_users
  has_many :join_team_requests, dependent: :destroy
  has_one :team_node, foreign_key: :node_object_id, dependent: :destroy
Severity: Minor
Found in app/models/team.rb by rubocop

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Assignment Branch Condition size for import_from_hash is too high. [141.3/15]
Open

  def import_from_hash(session, params)
    if (params[:model] == 'AssignmentTeam') || (params[:model] == 'CourseTeam')
      contents_hash = eval(params[:contents_hash])
      @header_integrated_body = hash_rows_with_headers(contents_hash[:header], contents_hash[:body])
      errors = []

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 has too many lines. [236/100]
Open

class GradesController < ApplicationController
  helper :file
  helper :submitted_content
  helper :penalty
  include PenaltyHelper

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Class has too many lines. [232/100]
Open

class QuizQuestionnairesController < QuestionnairesController
  include AuthorizationHelper

  # Quiz questionnaire edit option to be allowed for student
  def action_allowed?

This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

    context 'when attributes are not nil and received from Rubrics' do
      let(:attributes) { [aq_attributes1, aq_attributes2] }

      before(:each) do
        allow(assignment_questionnaire1).to receive(:questionnaire_id).and_return(1)
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. [208/25]
Open

describe 'Assignment Topic Suggestion Test' do
  before(:each) do
    create(:assignment, name: 'Assignment_suggest_topic', allow_suggestions: true)
    create_list(:participant, 3)
    create(:assignment_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.

File review_mapping_helper_spec.rb has 798 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'spec_helper'
require 'rails_helper'

describe ReviewMappingHelper, type: :helper do
  let(:team) { build(:assignment_team, id: 1) }
Severity: Major
Found in spec/helpers/review_mapping_helper_spec.rb - About 1 day to fix
    Severity
    Category
    Status
    Source
    Language