ReadyResponder/ReadyResponder

View on GitHub

Showing 7,746 of 7,746 total issues

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

ActiveRecord::Schema.define(version: 2019_10_31_013911) do

  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"

Severity: Minor
Found in db/schema.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. [289/25]
Open

RSpec.describe Person do
  describe 'validations' do
    subject { build :person }
    it { is_expected.to validate_length_of(:state).is_equal_to 2 }
    it { is_expected.to validate_uniqueness_of(:icsid).case_insensitive }
Severity: Minor
Found in spec/models/person_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. [251/25]
Open

RSpec.describe Availability, type: :model do
  let(:a_person) { build(:person) }

  before(:example) do
    Timecop.freeze
Severity: Minor
Found in spec/models/availability_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. [195/25]
Open

RSpec.describe Timecard do
  before(:context) do
    @cj = create(:person, firstname: 'CJ')
  end
  
Severity: Minor
Found in spec/models/timecard_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. [204/100]
Open

class Person < ApplicationRecord
  has_paper_trail
  include Commentable
  include Loggable

Severity: Minor
Found in app/models/person.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. [185/25]
Open

RSpec.feature 'Event page' do
  context 'logged in as an Editor and given an event' do
    before(:all) do
      sign_in_as('Editor')
    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. [183/25]
Open

  context 'logged in as an Editor and given an event' do
    before(:all) do
      sign_in_as('Editor')
    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. [178/25]
Open

    context 'where members have differing availabilities' do
      before(:each) do
        Timecop.freeze

        @mrc = create(:department, name: 'Medical Reserve Dept.')

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

RSpec.feature 'Event page' do
  context 'logged in as an Editor and given an event with departments and rank' do
    before(:each) do
      sign_in_as('Editor')
    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. [166/25]
Open

      scenario 'shows availablity properly' do
        # av stands for available, pav stands for partially available
        # uav is unavailable
        # This person is available at the exact times
        av_hero_exactly_ontime = create(:person,

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

  context 'logged in as an Editor and given an event with departments and rank' do
    before(:each) do
      sign_in_as('Editor')
    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. [162/25]
Open

RSpec.describe "Events" do
  before(:each) do
    sign_in_as('Editor')
    @department = create(:department)
    @template = create(:event, title: "template title", is_template: true, departments: [@department])
Severity: Minor
Found in spec/features/events/events_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. [159/25]
Open

RSpec.describe "Person" do
  before(:each) { sign_in_as('Editor') }

  describe "views" do
    before(:each) 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. [157/25]
Open

RSpec.describe Event do

  describe 'validations' do
    subject { create(:event) }

Severity: Minor
Found in spec/models/event_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. [156/25]
Open

RSpec.describe 'receiving an availability message', type: :request do
  let!(:phone)  { create(:phone, content: '+11234567890') }
  let!(:person) { phone.person }
  let(:msg)     { { From: phone.content, Body: body } }

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 prototype has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

Searcher.prototype = new function() {
  // search is performed in chunks of 1000 for non-blocking user input
  var CHUNK_SIZE = 1000;
  // do not try to find more than 100 results
  var MAX_RESULTS = 100;
Severity: Minor
Found in spec/support/doc/js/searcher.js - About 1 day to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

RSpec.describe Timecard do
  before(:each) do
    @cj = create(:person, firstname: 'CJ')
    @tc = create(:timecard, person: @cj)
  end
Severity: Minor
Found in spec/features/timecards_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. [138/100]
Open

class Event < ApplicationRecord
  has_paper_trail
  include Loggable

  before_save :calc_duration, :trim_id_code
Severity: Minor
Found in app/models/event.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. [147/25]
Open

SimpleForm.setup do |config|
  config.error_notification_class = 'alert alert-danger'
  config.button_class = 'btn btn-primary'
  config.boolean_label_class = 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.

File schema.rb has 566 lines of code (exceeds 250 allowed). Consider refactoring.
Open

ActiveRecord::Schema.define(version: 2019_10_31_013911) do

  # These are extensions that must be enabled in order to support this database
  enable_extension "plpgsql"

Severity: Major
Found in db/schema.rb - About 1 day to fix
    Severity
    Category
    Status
    Source
    Language