rubycentral/cfp-app

View on GitHub

Showing 46 of 126 total issues

Function palette has a Cognitive Complexity of 121 (exceeds 5 allowed). Consider refactoring.
Open

var palette = (function() {

  var proto = Array.prototype;
  var slice = function(arr, opt_begin, opt_end) {
    return proto.slice.apply(arr, proto.slice.call(arguments, 1));
Severity: Minor
Found in app/assets/javascripts/palette.js - About 2 days 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

File palette.js has 855 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/** @license
 *
 *     Colour Palette Generator script.
 *     Copyright (c) 2014 Google Inc.
 *
Severity: Major
Found in app/assets/javascripts/palette.js - About 2 days to fix

    Function palette has 239 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var palette = (function() {
    
      var proto = Array.prototype;
      var slice = function(arr, opt_begin, opt_end) {
        return proto.slice.apply(arr, proto.slice.call(arguments, 1));
    Severity: Major
    Found in app/assets/javascripts/palette.js - About 1 day to fix

      Class WebsiteDecorator has 43 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class WebsiteDecorator < ApplicationDecorator
        delegate_all
        delegate :title, :author, :description, to: :meta_data
      
        DEFAULT_LINKS = {
      Severity: Minor
      Found in app/decorators/website_decorator.rb - About 5 hrs to fix

        Class Proposal has 42 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class Proposal < ApplicationRecord
          include Proposal::State
        
          has_many :public_comments, dependent: :destroy
          has_many :internal_comments, dependent: :destroy
        Severity: Minor
        Found in app/models/proposal.rb - About 5 hrs to fix

          Class ProposalDecorator has 36 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class ProposalDecorator < ApplicationDecorator
            include Proposal::State
            decorates :proposal
            delegate_all
            decorates_association :speakers
          Severity: Minor
          Found in app/decorators/proposal_decorator.rb - About 4 hrs to fix

            Class Event has 36 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class Event < ApplicationRecord
              has_many :teammates, dependent: :destroy
              has_many :staff, through: :teammates, source: :user
              has_many :proposals, dependent: :destroy
              has_many :speakers
            Severity: Minor
            Found in app/models/event.rb - About 4 hrs to fix

              Function render has 103 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  let { sessionFormats, closeBulkTimeSlotModal, counts } = this.props;
                  let { timeError, day, startTimes, duration } = this.state;
              
                  const days = Object.keys(counts);
              Severity: Major
              Found in app/javascript/components/Schedule/BulkCreateModal.js - About 4 hrs to fix

                Function Scheme has 101 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  palette.Scheme = function(name, opt_groups) {
                    /**
                     * A map from a number to a colour palettes with given number of colours.
                     * @type {!Object<number, palette.Palette>}
                     */
                Severity: Major
                Found in app/assets/javascripts/palette.js - About 4 hrs to fix

                  Class ApplicationController has 32 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class ApplicationController < ActionController::Base
                    include Pundit::Authorization
                    include ActivateNavigation
                    rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
                  
                  
                  Severity: Minor
                  Found in app/controllers/application_controller.rb - About 4 hrs to fix

                    Function render has 98 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      render() {
                        const { slot, matchedSession, unscheduledSessions, tracks, sessionFormats, roomName } = this.props;
                    
                        const { sessionSelected } = this.state;
                    
                    
                    Severity: Major
                    Found in app/javascript/components/Schedule/TimeSlotModal.js - About 3 hrs to fix

                      File Schedule.js has 320 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React, { Component } from 'react';
                      import PropTypes from 'prop-types';
                      
                      import { Nav } from './Schedule/Nav';
                      import { Ruler } from './Schedule/Ruler';
                      Severity: Minor
                      Found in app/javascript/components/Schedule.js - About 3 hrs to fix

                        Function render has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          render() {
                            const {
                              counts,
                              dayViewing,
                              startTime,
                        Severity: Major
                        Found in app/javascript/components/Schedule.js - About 3 hrs to fix

                          Class TimeSlotDecorator has 28 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                          class Staff::TimeSlotDecorator < Draper::Decorator
                            decorates :time_slot
                            delegate_all
                          
                            def start_time
                          Severity: Minor
                          Found in app/decorators/staff/time_slot_decorator.rb - About 3 hrs to fix

                            Class EventStats has 22 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            class EventStats
                            
                              attr_reader :event
                            
                              def initialize(event)
                            Severity: Minor
                            Found in app/models/event_stats.rb - About 2 hrs to fix

                              Function render has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                render() {
                                  const {
                                    height,
                                    room,
                                    startTime,
                              Severity: Major
                              Found in app/javascript/components/Schedule/ScheduleColumn.js - About 2 hrs to fix

                                Function render has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  render() {
                                    const {
                                      slot,
                                      ripTime,
                                      startTime,
                                Severity: Major
                                Found in app/javascript/components/Schedule/ScheduleSlot.js - About 2 hrs to fix

                                  Class ProgramSession has 21 methods (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  class ProgramSession < ApplicationRecord
                                    LIVE = 'live' # confirmed accepted
                                    DRAFT = 'draft' # created by organizer, not ready to be published (live)
                                    UNCONFIRMED_ACCEPTED = 'unconfirmed accepted' # accepted, to be confirmed by speaker
                                    UNCONFIRMED_WAITLISTED = 'unconfirmed waitlisted'
                                  Severity: Minor
                                  Found in app/models/program_session.rb - About 2 hrs to fix

                                    Class EventsController has 21 methods (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    class Staff::EventsController < Staff::ApplicationController
                                      before_action :enable_staff_event_subnav
                                    
                                      helper_method :sticky_template_test_email
                                    
                                    
                                    Severity: Minor
                                    Found in app/controllers/staff/events_controller.rb - About 2 hrs to fix

                                      Function exports has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      module.exports = function (api) {
                                        var validEnv = ['development', 'test', 'production'];
                                        var currentEnv = api.env();
                                        var isDevelopmentEnv = api.env('development');
                                        var isProductionEnv = api.env('production');
                                      Severity: Minor
                                      Found in babel.config.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language