osbridge/openconferenceware

View on GitHub

Very high overall complexity: 791

module OpenConferenceWare

  # == Schema Information
  #
  # Table name: proposals
Found in OpenConferenceWare::Proposal - About 1 wk to fix

When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

Refactorings

Further Reading

Very high overall complexity: 588

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
Found in OpenConferenceWare::ProposalsController - About 5 days to fix

When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

Refactorings

Further Reading

Very high overall complexity: 516

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
Found in OpenConferenceWare::ApplicationController - About 4 days to fix

When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

Refactorings

Further Reading

Complex class definition

module OpenConferenceWare

  # == Schema Information
  #
  # Table name: proposals
Found in OpenConferenceWare::Proposal - About 4 days to fix

    Very complex method in #assign_prefetched_hashes

        def assign_prefetched_hashes
          @users                    = Defer { @event.users }
          @users_hash               = Defer { Hash[@users.map{|t| [t.id, t]}] }
          @speakers                 = Defer { @event.speakers }
          @speakers_hash            = Defer { Hash[@speakers.map{|t| [t.id, t]}] }
    Found in OpenConferenceWare::ApplicationController - About 2 days to fix

    Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

    Refactorings

    Read More

    Very complex method in #update

        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?
    Found in OpenConferenceWare::ProposalsController - About 2 days to fix

    Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

    Refactorings

    Read More

    Complex class definition

    module OpenConferenceWare
    
      # == Schema Information
      #
      # Table name: users
    Found in OpenConferenceWare::User - About 1 day to fix

      Very complex method in .sort

          def self.sort(proposals, field="title", is_ascending=true, random_seed = nil)
            return proposals if proposals.empty?
      
            proposals = \
              case field.to_sym
      Found in OpenConferenceWare::Proposal - About 1 day to fix

      Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

      Refactorings

      Read More

      Very complex method in #index

          def index
            unless @event
              flash[:failure] = "Can't display selector votes without an event!"
              return redirect_back_or_to(root_path)
            end
      Found in OpenConferenceWare::SelectorVotesController - About 1 day to fix

      Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

      Refactorings

      Read More

      Very complex method in .to_icalendar

          def self.to_icalendar(items, opts={})
            title = opts[:title] || "Schedule"
            url_helper = opts[:url_helper]
      
            calendar = Vpim::Icalendar.create2(Vpim::PRODID)
      Found in OpenConferenceWare::Proposal - About 1 day to fix

      Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

      Refactorings

      Read More

      High overall complexity: 222

      module OpenConferenceWare
      
        # == Schema Information
        #
        # Table name: events
      Found in OpenConferenceWare::Event - About 1 day to fix

      When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

      Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

      Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

      Refactorings

      Further Reading

      Similar code found in 1 other location

      module OpenConferenceWare
        class ScheduleItemsController < ApplicationController
          before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
          before_filter :assert_current_event_or_redirect
          before_filter :normalize_event_path_or_redirect, only: [:index]
      app/controllers/open_conference_ware/session_types_controller.rb on lines 70..80

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      Similar code found in 1 other location

      module OpenConferenceWare
        class SessionTypesController < ApplicationController
          before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
          before_filter :assert_current_event_or_redirect
          before_filter :normalize_event_path_or_redirect, only: [:index]
      app/controllers/open_conference_ware/schedule_items_controller.rb on lines 71..81

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Refactorings

      Further Reading

      High overall complexity: 214

      module OpenConferenceWare
      
        # == Schema Information
        #
        # Table name: users
      Found in OpenConferenceWare::User - About 1 day to fix

      When classes take on too many responsibilities, they grow. A large number of instance variables or methods can make a class hard to understand. Large classes tend to have lower cohesion and higher churn.

      Often large classes have methods that do not operate on all of the class state. Identifying the groups of data that are used together can point to seams to split out additional collaborator classes or value objects.

      Another trick is to look for repeated prefixes or suffixes in method and variable names, or repeated parameter names, and use them to guide extractions.

      Refactorings

      Further Reading

      Complex class definition

      module OpenConferenceWare
      
        # = FauxRoutesMixin
        #
        # The FauxRoutesMixin generates a bunch of route helpers for the
      Found in OpenConferenceWare::FauxRoutesMixin::Methods - About 1 day to fix

        Similar code found in 1 other location

        module OpenConferenceWare
          class RoomsController < ApplicationController
            before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
            before_filter :assert_current_event_or_redirect
            before_filter :normalize_event_path_or_redirect, only: [:index]
        Found in OpenConferenceWare::RoomsController and 1 other location - About 1 day to fix
        app/controllers/open_conference_ware/tracks_controller.rb on lines 51..61

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Refactorings

        Further Reading

        Similar code found in 1 other location

        module OpenConferenceWare
          class TracksController < ApplicationController
            before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
            before_filter :assert_current_event_or_redirect
            before_filter :normalize_event_path_or_redirect, only: [:index]
        Found in OpenConferenceWare::TracksController and 1 other location - About 1 day to fix
        app/controllers/open_conference_ware/rooms_controller.rb on lines 55..65

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Refactorings

        Further Reading

        Similar code found in 1 other location

        module OpenConferenceWare
          module Manage
            class EventsController < ApplicationController
              before_filter :require_admin
              before_filter :assert_current_event_or_redirect, only: [:show, :edit, :update, :destroy]
        app/controllers/open_conference_ware/manage/snippets_controller.rb on lines 77..84

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Refactorings

        Further Reading

        Similar code found in 1 other location

        module OpenConferenceWare
          module Manage
            class SnippetsController < ApplicationController
              before_filter :require_admin
        
        
        app/controllers/open_conference_ware/manage/events_controller.rb on lines 76..83

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Refactorings

        Further Reading

        Complex method in #to_s_raw

            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)
        Found in OpenConferenceWare::TimeRange - About 7 hrs to fix

        Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

        Refactorings

        Read More

        Complex method in #index

            def index
              warn_about_incomplete_event
        
              @kind = :proposals
        
        
        Found in OpenConferenceWare::ProposalsController - About 6 hrs to fix

        Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

        Refactorings

        Read More

        Complex method in #create

            def create
              @selector_vote = SelectorVote.find_or_initialize_by(user_id: current_user.id, proposal_id: params[:proposal_id].to_i)
              @selector_vote.assign_attributes(selector_vote_params)
        
              respond_to do |format|
        Found in OpenConferenceWare::SelectorVotesController - About 6 hrs to fix

        Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

        Refactorings

        Read More

        Complex method in #create

            def create
              if params[:quagmire].present?
                flash[:failure] = "Comment rejected because you're behaving like a robot, please leave the 'Leave blank' field blank."
                redirect_to(:back) rescue redirect_to proposals_path()
                return
        Found in OpenConferenceWare::CommentsController - About 6 hrs to fix

        Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

        Refactorings

        Read More

        Complex class definition

        module OpenConferenceWare
          class Engine < ::Rails::Engine
            isolate_namespace OpenConferenceWare
        
            config.autoload_paths += [
        Found in OpenConferenceWare::Engine - About 5 hrs to fix

          Similar code found in 1 other location

          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
          app/controllers/open_conference_ware/proposals_controller.rb on lines 222..225

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Similar code found in 1 other location

          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
          app/controllers/open_conference_ware/proposals_controller.rb on lines 273..277

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Complex method in #index

              def index
                @user_favorites = Defer {
                  view_cache_key = "favorites,user_#{@user.id}.#{request.format},join_#{params[:join]}"
                  Rails.cache.fetch(view_cache_key) {
                    # The :join argument is sent by the AJAX UI to fetch a terse list of
          Found in OpenConferenceWare::UserFavoritesController - About 5 hrs to fix

          Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

          Refactorings

          Read More

          Complex method in #create

              def create
                @proposal = @event.proposals.new(proposal_params)
                @proposal.add_user(current_user) if logged_in?
                @proposal.transition = transition_from_params if admin?
          
          
          Found in OpenConferenceWare::ProposalsController - About 5 hrs to fix

          Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

          Refactorings

          Read More

          Complex method in #modify

              def modify
                unless params[:proposal_id].blank? || params[:mode].blank? || !['add','remove'].include?(params[:mode])
                  @user_favorite = \
                    case params[:mode]
                    when 'add'
          Found in OpenConferenceWare::UserFavoritesController - About 5 hrs to fix

          Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

          Refactorings

          Read More

          Similar code found in 1 other location

          module OpenConferenceWare
          
            # == Schema Information
            #
            # Table name: proposals
          Found in OpenConferenceWare::Proposal and 1 other location - About 4 hrs to fix
          app/models/open_conference_ware/proposal.rb on lines 621..632

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Similar code found in 1 other location

          module OpenConferenceWare
          
            # == Schema Information
            #
            # Table name: proposals
          Found in OpenConferenceWare::Proposal and 1 other location - About 4 hrs to fix
          app/models/open_conference_ware/proposal.rb on lines 636..647

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Complex method in #normalize_event_path_or_redirect

              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
          Found in OpenConferenceWare::ApplicationController - About 4 hrs to fix

          Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

          Refactorings

          Read More

          Complex method in .new_array_from

              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
          Found in OpenConferenceWare::ScheduleSlice - About 4 hrs to fix

          Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

          Refactorings

          Read More

          Similar code found in 1 other location

          module OpenConferenceWare
            class ScheduleItemsController < ApplicationController
              before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
              before_filter :assert_current_event_or_redirect
              before_filter :normalize_event_path_or_redirect, only: [:index]
          app/controllers/open_conference_ware/tracks_controller.rb on lines 12..18

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Similar code found in 1 other location

          module OpenConferenceWare
            class TracksController < ApplicationController
              before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
              before_filter :assert_current_event_or_redirect
              before_filter :normalize_event_path_or_redirect, only: [:index]
          Found in OpenConferenceWare::TracksController and 1 other location - About 4 hrs to fix
          app/controllers/open_conference_ware/schedule_items_controller.rb on lines 12..18

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Similar code found in 2 other locations

          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
          app/controllers/open_conference_ware/application_controller.rb on lines 463..463
          app/controllers/open_conference_ware/application_controller.rb on lines 464..464

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Similar code found in 2 other locations

          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
          app/controllers/open_conference_ware/application_controller.rb on lines 463..463
          app/controllers/open_conference_ware/application_controller.rb on lines 465..465

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Similar code found in 2 other locations

          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
          app/controllers/open_conference_ware/application_controller.rb on lines 464..464
          app/controllers/open_conference_ware/application_controller.rb on lines 465..465

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Similar code found in 1 other location

          module OpenConferenceWare
            class RoomsController < ApplicationController
              before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
              before_filter :assert_current_event_or_redirect
              before_filter :normalize_event_path_or_redirect, only: [:index]
          Found in OpenConferenceWare::RoomsController and 1 other location - About 4 hrs to fix
          app/controllers/open_conference_ware/session_types_controller.rb on lines 12..18

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Similar code found in 2 other locations

          module OpenConferenceWare
            class ScheduleItemsController < ApplicationController
              before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
              before_filter :assert_current_event_or_redirect
              before_filter :normalize_event_path_or_redirect, only: [:index]
          app/controllers/open_conference_ware/session_types_controller.rb on lines 24..30
          app/controllers/open_conference_ware/tracks_controller.rb on lines 24..30

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Similar code found in 1 other location

          module OpenConferenceWare
            class ScheduleItemsController < ApplicationController
              before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
              before_filter :assert_current_event_or_redirect
              before_filter :normalize_event_path_or_redirect, only: [:index]
          app/controllers/open_conference_ware/session_types_controller.rb on lines 36..41

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Similar code found in 2 other locations

          module OpenConferenceWare
            class SessionTypesController < ApplicationController
              before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
              before_filter :assert_current_event_or_redirect
              before_filter :normalize_event_path_or_redirect, only: [:index]
          app/controllers/open_conference_ware/schedule_items_controller.rb on lines 24..30
          app/controllers/open_conference_ware/tracks_controller.rb on lines 24..30

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Similar code found in 1 other location

          module OpenConferenceWare
            class SessionTypesController < ApplicationController
              before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
              before_filter :assert_current_event_or_redirect
              before_filter :normalize_event_path_or_redirect, only: [:index]
          app/controllers/open_conference_ware/rooms_controller.rb on lines 12..18

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Similar code found in 1 other location

          module OpenConferenceWare
            class SessionTypesController < ApplicationController
              before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
              before_filter :assert_current_event_or_redirect
              before_filter :normalize_event_path_or_redirect, only: [:index]
          app/controllers/open_conference_ware/schedule_items_controller.rb on lines 36..42

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Similar code found in 2 other locations

          module OpenConferenceWare
            class TracksController < ApplicationController
              before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
              before_filter :assert_current_event_or_redirect
              before_filter :normalize_event_path_or_redirect, only: [:index]
          Found in OpenConferenceWare::TracksController and 2 other locations - About 4 hrs to fix
          app/controllers/open_conference_ware/schedule_items_controller.rb on lines 24..30
          app/controllers/open_conference_ware/session_types_controller.rb on lines 24..30

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Refactorings

          Further Reading

          Complex method in #base_show

              def base_show
                if selector? && @event.accept_selector_votes?
                  @selector_vote = @proposal.selector_votes.find_or_initialize_by(user_id: current_user.id)
                end
          
          
          Found in OpenConferenceWare::ProposalsController - About 4 hrs to fix

          Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

          Refactorings

          Read More

          Complex class definition

          require 'open_conference_ware/dependencies'
          require "open_conference_ware/engine"
          
          module OpenConferenceWare
            def self.configure(&block)
          Found in OpenConferenceWare - About 3 hrs to fix

            Similar code found in 1 other location

            module OpenConferenceWare
              class ScheduleItemsController < ApplicationController
                before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
                before_filter :assert_current_event_or_redirect
                before_filter :normalize_event_path_or_redirect, only: [:index]
            app/controllers/open_conference_ware/session_types_controller.rb on lines 87..93

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Refactorings

            Further Reading

            Similar code found in 1 other location

            module OpenConferenceWare
              class SessionTypesController < ApplicationController
                before_filter :require_admin, only: [:new, :create, :edit, :update, :destroy]
                before_filter :assert_current_event_or_redirect
                before_filter :normalize_event_path_or_redirect, only: [:index]
            app/controllers/open_conference_ware/schedule_items_controller.rb on lines 88..94

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Refactorings

            Further Reading

            Complex method in #notify_speakers

                  def notify_speakers
                    emailed = []
                    already_emailed = []
                    proposals = params[:proposal_ids].split(',')
                    proposals.each do |proposal_id|
            Found in OpenConferenceWare::Manage::EventsController - About 3 hrs to fix

            Long or complex methods can make code harder to understand. In most circumstances, methods are best as a small chunk of code (the "how") with a clear, understandable name (the "what"). Long methods can also lead to duplication, as it's harder to reuse logic that is tightly coupled to surrounding code.

            Refactorings

            Read More