Showing 66 of 90 total issues
File proposal.rb
has 460 lines of code (exceeds 250 allowed). Consider refactoring. Open
module OpenConferenceWare
# == Schema Information
#
# Table name: proposals
Class Proposal
has 48 methods (exceeds 20 allowed). Consider refactoring. Open
class Proposal < OpenConferenceWare::Base
# Provide ::validate_url_attribute
include NormalizeUrlMixin
# Provide ::event_tracks? and other methods for accessing SETTING
File proposals_controller.rb
has 413 lines of code (exceeds 250 allowed). Consider refactoring. Open
module OpenConferenceWare
class ProposalsController < ApplicationController
before_filter :authentication_required, only: [:edit, :update, :destroy, :speaker_confirm, :speaker_decline, :proposal_login_required]
before_filter :assert_current_event_or_redirect
Method to_s_raw
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def to_s_raw
# Assume one date only, equal start/end
start_format_list = [nil, :wday, :month, :day, :year, :at, :hour, :min, :suffix, nil]
start_details = time_details(@start_time)
- Read upRead up
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
Class ApplicationController
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class ApplicationController < ActionController::Base
helper :all # include all helpers, all the time
# See ActionController::RequestForgeryProtection for details
File application_controller.rb
has 349 lines of code (exceeds 250 allowed). Consider refactoring. Open
module OpenConferenceWare
# Filters added to this controller apply to all controllers in the application.
# Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
Class ProposalsController
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class ProposalsController < ApplicationController
before_filter :authentication_required, only: [:edit, :update, :destroy, :speaker_confirm, :speaker_decline, :proposal_login_required]
before_filter :assert_current_event_or_redirect
before_filter :assert_proposal_status_published, only: [:sessions_index, :sessions_index_terse, :session_show]
Method to_icalendar
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def self.to_icalendar(items, opts={})
title = opts[:title] || "Schedule"
url_helper = opts[:url_helper]
calendar = Vpim::Icalendar.create2(Vpim::PRODID)
- Read upRead up
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
Class Event
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Event < OpenConferenceWare::Base
# Mixins
include SimpleSlugMixin
# Associations
Method get_current_event_and_assignment_status
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def get_current_event_and_assignment_status
invalid = false
# Try finding event using params:
event_id_key = controller_name == "events" ? :id : :event_id
- Read upRead up
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
Method new_array_from
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def self.new_array_from(items)
[].tap do |slices|
for block in ScheduleBlock.new_array_from(items)
if slice = slices.find{|slice| ! slice.overlaps?(block)}
slice.blocks << block
- Read upRead up
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
Method new_array_from
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def self.new_array_from(items)
[].tap do |sections|
for item in items
if section = sections.find{|section| section.overlaps?(item)}
section.items << item
- Read upRead up
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
Method update
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def update
# @proposal and @event set via #assign_proposal_and_event filter
# If proposal title editing is locked, prevent non-admin from modifying title.
if params[:proposal] && @event.proposal_titles_locked? && ! admin?
- Read upRead up
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
Method notify_speakers
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def notify_speakers
emailed = []
already_emailed = []
proposals = params[:proposal_ids].split(',')
proposals.each do |proposal_id|
- Read upRead up
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
Method normalize_event_path_or_redirect
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def normalize_event_path_or_redirect
# When running under a prefix (e.g., "thin --prefix /omg start"), this value will be set to "/omg", else "".
if request.format.to_sym == :html
if request.path.match(%r{^#{OpenConferenceWare.mounted_path("/events")}})
return false
- Read upRead up
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
Function bind_proposal_schedule_controls
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bind_proposal_schedule_controls() {
$('.proposal_schedule_control_container select').change(function(event) {
// Clears all time select elements if any are set to blank.
target = $(this);
Method seed_schedule
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def seed_schedule
e = OpenConferenceWare::Event.current
slots = []
slots << [10.hours, 11.hours, 13.hours + 30.minutes, 14.hours + 30.minutes, 15.hours + 45.minutes, 16.hours + 45.minutes].map{|offset| e.dates[0] + offset}
Method index
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
warn_about_incomplete_event
@kind = :proposals
Method warn_about_incomplete_event
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def warn_about_incomplete_event
if @event
if event_tracks? && @event.tracks.size == 0
if admin?
notify :notice, "This event needs a track, you should #{view_context.link_to 'create one', new_event_track_path(@event)}.".html_safe
- Read upRead up
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
Function bind_user_favorite_controls
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function bind_user_favorite_controls() {
$('.favorite').each(function() {
if( !logged_in() ) {
$(this).addClass('disabled');
}