YaleSTC/shifts

View on GitHub

Showing 294 of 294 total issues

File shift.rb has 453 lines of code (exceeds 250 allowed). Consider refactoring.
Open

class Shift < ActiveRecord::Base
  include ActionView::Helpers::DateHelper

  delegate :loc_group, to: 'location'
  belongs_to :calendar
Severity: Minor
Found in app/models/shift.rb - About 6 hrs to fix

    Class Shift has 47 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class Shift < ActiveRecord::Base
      include ActionView::Helpers::DateHelper
    
      delegate :loc_group, to: 'location'
      belongs_to :calendar
    Severity: Minor
    Found in app/models/shift.rb - About 6 hrs to fix

      Method calendar_day_preprocessing has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
      Open

        def calendar_day_preprocessing(day)
          @location_rows = {}
          @location_rows_timeslots = {}
      
      
      
      Severity: Minor
      Found in app/helpers/calendars_helper.rb - About 5 hrs 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

      Class User has 41 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class User < ActiveRecord::Base
        acts_as_authentic do |options|
          options.maintain_sessions false
        end
      
      
      Severity: Minor
      Found in app/models/user.rb - About 5 hrs to fix

        Method day_preprocessing has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
        Open

          def day_preprocessing(day)
            @location_rows = {}
        
            #for AJAX; needs cleanup if we have time
            @loc_groups = current_user.user_config.view_loc_groups.select{|l| !l.locations.empty?}
        Severity: Minor
        Found in app/helpers/shifts_helper.rb - About 5 hrs 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

        Method location_preprocessing has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

          def location_preprocessing(location, day)
            timeslots = @location_rows_timeslots[location]
            shifts = @location_rows[location].flatten
        
            #what times is this location open?
        Severity: Minor
        Found in app/helpers/shifts_helper.rb - About 4 hrs 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

        Method calendar_day_preprocessing has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
        Open

          def calendar_day_preprocessing(day)
            @location_rows = {}
            @location_rows_timeslots = {}
        
            #different calendars are different colors
        Severity: Minor
        Found in app/helpers/shifts_helper.rb - About 4 hrs 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

        Method save_import has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

          def save_import
            if params[:commit]=="Cancel"
              redirect_to import_department_users_path(@department) and return
            end
            @users=params[:users_to_import].collect{|i| params[:user][i]}
        Severity: Minor
        Found in app/controllers/users_controller.rb - About 4 hrs 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

        Similar blocks of code found in 17 locations. Consider refactoring.
        Open

        describe RestrictionsController do
          fixtures :all
          render_views
          
          it "index action should render index template" do
        Severity: Major
        Found in spec_old/controllers/restrictions_controller_spec.rb and 16 other locations - About 4 hrs to fix
        spec_old/controllers/calendars_controller_spec.rb on lines 3..55
        spec_old/controllers/categories_controller_spec.rb on lines 3..55
        spec_old/controllers/locations_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_item_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/punch_clocks_controller_spec.rb on lines 3..55
        spec_old/controllers/repeating_events_controller_spec.rb on lines 3..55
        spec_old/controllers/report_items_controller_spec.rb on lines 3..55
        spec_old/controllers/reports_controller_spec.rb on lines 3..55
        spec_old/controllers/shifts_controller_spec.rb on lines 3..55
        spec_old/controllers/sub_requests_controller_spec.rb on lines 3..55
        spec_old/controllers/time_slots_controller_spec.rb on lines 3..55
        spec_old/controllers/user_configs_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_entries_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_fields_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profiles_controller_spec.rb on lines 3..55

        Duplicated Code

        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).

        Tuning

        This issue has a mass of 155.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 17 locations. Consider refactoring.
        Open

        describe LocationsController do
          fixtures :all
          render_views
          
          it "index action should render index template" do
        Severity: Major
        Found in spec_old/controllers/locations_controller_spec.rb and 16 other locations - About 4 hrs to fix
        spec_old/controllers/calendars_controller_spec.rb on lines 3..55
        spec_old/controllers/categories_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_item_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/punch_clocks_controller_spec.rb on lines 3..55
        spec_old/controllers/repeating_events_controller_spec.rb on lines 3..55
        spec_old/controllers/report_items_controller_spec.rb on lines 3..55
        spec_old/controllers/reports_controller_spec.rb on lines 3..55
        spec_old/controllers/restrictions_controller_spec.rb on lines 3..55
        spec_old/controllers/shifts_controller_spec.rb on lines 3..55
        spec_old/controllers/sub_requests_controller_spec.rb on lines 3..55
        spec_old/controllers/time_slots_controller_spec.rb on lines 3..55
        spec_old/controllers/user_configs_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_entries_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_fields_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profiles_controller_spec.rb on lines 3..55

        Duplicated Code

        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).

        Tuning

        This issue has a mass of 155.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 17 locations. Consider refactoring.
        Open

        describe CategoriesController do
          fixtures :all
          render_views
          
          it "index action should render index template" do
        Severity: Major
        Found in spec_old/controllers/categories_controller_spec.rb and 16 other locations - About 4 hrs to fix
        spec_old/controllers/calendars_controller_spec.rb on lines 3..55
        spec_old/controllers/locations_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_item_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/punch_clocks_controller_spec.rb on lines 3..55
        spec_old/controllers/repeating_events_controller_spec.rb on lines 3..55
        spec_old/controllers/report_items_controller_spec.rb on lines 3..55
        spec_old/controllers/reports_controller_spec.rb on lines 3..55
        spec_old/controllers/restrictions_controller_spec.rb on lines 3..55
        spec_old/controllers/shifts_controller_spec.rb on lines 3..55
        spec_old/controllers/sub_requests_controller_spec.rb on lines 3..55
        spec_old/controllers/time_slots_controller_spec.rb on lines 3..55
        spec_old/controllers/user_configs_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_entries_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_fields_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profiles_controller_spec.rb on lines 3..55

        Duplicated Code

        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).

        Tuning

        This issue has a mass of 155.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 17 locations. Consider refactoring.
        Open

        describe UserProfileFieldsController do
          fixtures :all
          render_views
          
          it "index action should render index template" do
        spec_old/controllers/calendars_controller_spec.rb on lines 3..55
        spec_old/controllers/categories_controller_spec.rb on lines 3..55
        spec_old/controllers/locations_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_item_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/punch_clocks_controller_spec.rb on lines 3..55
        spec_old/controllers/repeating_events_controller_spec.rb on lines 3..55
        spec_old/controllers/report_items_controller_spec.rb on lines 3..55
        spec_old/controllers/reports_controller_spec.rb on lines 3..55
        spec_old/controllers/restrictions_controller_spec.rb on lines 3..55
        spec_old/controllers/shifts_controller_spec.rb on lines 3..55
        spec_old/controllers/sub_requests_controller_spec.rb on lines 3..55
        spec_old/controllers/time_slots_controller_spec.rb on lines 3..55
        spec_old/controllers/user_configs_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_entries_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profiles_controller_spec.rb on lines 3..55

        Duplicated Code

        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).

        Tuning

        This issue has a mass of 155.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 17 locations. Consider refactoring.
        Open

        describe SubRequestsController do
          fixtures :all
          render_views
          
          it "index action should render index template" do
        Severity: Major
        Found in spec_old/controllers/sub_requests_controller_spec.rb and 16 other locations - About 4 hrs to fix
        spec_old/controllers/calendars_controller_spec.rb on lines 3..55
        spec_old/controllers/categories_controller_spec.rb on lines 3..55
        spec_old/controllers/locations_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_item_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/punch_clocks_controller_spec.rb on lines 3..55
        spec_old/controllers/repeating_events_controller_spec.rb on lines 3..55
        spec_old/controllers/report_items_controller_spec.rb on lines 3..55
        spec_old/controllers/reports_controller_spec.rb on lines 3..55
        spec_old/controllers/restrictions_controller_spec.rb on lines 3..55
        spec_old/controllers/shifts_controller_spec.rb on lines 3..55
        spec_old/controllers/time_slots_controller_spec.rb on lines 3..55
        spec_old/controllers/user_configs_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_entries_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_fields_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profiles_controller_spec.rb on lines 3..55

        Duplicated Code

        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).

        Tuning

        This issue has a mass of 155.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 17 locations. Consider refactoring.
        Open

        describe ShiftsController do
          fixtures :all
          render_views
          
          it "index action should render index template" do
        Severity: Major
        Found in spec_old/controllers/shifts_controller_spec.rb and 16 other locations - About 4 hrs to fix
        spec_old/controllers/calendars_controller_spec.rb on lines 3..55
        spec_old/controllers/categories_controller_spec.rb on lines 3..55
        spec_old/controllers/locations_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_item_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/punch_clocks_controller_spec.rb on lines 3..55
        spec_old/controllers/repeating_events_controller_spec.rb on lines 3..55
        spec_old/controllers/report_items_controller_spec.rb on lines 3..55
        spec_old/controllers/reports_controller_spec.rb on lines 3..55
        spec_old/controllers/restrictions_controller_spec.rb on lines 3..55
        spec_old/controllers/sub_requests_controller_spec.rb on lines 3..55
        spec_old/controllers/time_slots_controller_spec.rb on lines 3..55
        spec_old/controllers/user_configs_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_entries_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_fields_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profiles_controller_spec.rb on lines 3..55

        Duplicated Code

        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).

        Tuning

        This issue has a mass of 155.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 17 locations. Consider refactoring.
        Open

        describe TimeSlotsController do
          fixtures :all
          render_views
          
          it "index action should render index template" do
        Severity: Major
        Found in spec_old/controllers/time_slots_controller_spec.rb and 16 other locations - About 4 hrs to fix
        spec_old/controllers/calendars_controller_spec.rb on lines 3..55
        spec_old/controllers/categories_controller_spec.rb on lines 3..55
        spec_old/controllers/locations_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_item_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/punch_clocks_controller_spec.rb on lines 3..55
        spec_old/controllers/repeating_events_controller_spec.rb on lines 3..55
        spec_old/controllers/report_items_controller_spec.rb on lines 3..55
        spec_old/controllers/reports_controller_spec.rb on lines 3..55
        spec_old/controllers/restrictions_controller_spec.rb on lines 3..55
        spec_old/controllers/shifts_controller_spec.rb on lines 3..55
        spec_old/controllers/sub_requests_controller_spec.rb on lines 3..55
        spec_old/controllers/user_configs_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_entries_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_fields_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profiles_controller_spec.rb on lines 3..55

        Duplicated Code

        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).

        Tuning

        This issue has a mass of 155.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 17 locations. Consider refactoring.
        Open

        describe ReportItemsController do
          fixtures :all
          render_views
          
          it "index action should render index template" do
        Severity: Major
        Found in spec_old/controllers/report_items_controller_spec.rb and 16 other locations - About 4 hrs to fix
        spec_old/controllers/calendars_controller_spec.rb on lines 3..55
        spec_old/controllers/categories_controller_spec.rb on lines 3..55
        spec_old/controllers/locations_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_item_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/punch_clocks_controller_spec.rb on lines 3..55
        spec_old/controllers/repeating_events_controller_spec.rb on lines 3..55
        spec_old/controllers/reports_controller_spec.rb on lines 3..55
        spec_old/controllers/restrictions_controller_spec.rb on lines 3..55
        spec_old/controllers/shifts_controller_spec.rb on lines 3..55
        spec_old/controllers/sub_requests_controller_spec.rb on lines 3..55
        spec_old/controllers/time_slots_controller_spec.rb on lines 3..55
        spec_old/controllers/user_configs_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_entries_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_fields_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profiles_controller_spec.rb on lines 3..55

        Duplicated Code

        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).

        Tuning

        This issue has a mass of 155.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 17 locations. Consider refactoring.
        Open

        describe UserProfilesController do
          fixtures :all
          render_views
          
          it "index action should render index template" do
        Severity: Major
        Found in spec_old/controllers/user_profiles_controller_spec.rb and 16 other locations - About 4 hrs to fix
        spec_old/controllers/calendars_controller_spec.rb on lines 3..55
        spec_old/controllers/categories_controller_spec.rb on lines 3..55
        spec_old/controllers/locations_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_item_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/punch_clocks_controller_spec.rb on lines 3..55
        spec_old/controllers/repeating_events_controller_spec.rb on lines 3..55
        spec_old/controllers/report_items_controller_spec.rb on lines 3..55
        spec_old/controllers/reports_controller_spec.rb on lines 3..55
        spec_old/controllers/restrictions_controller_spec.rb on lines 3..55
        spec_old/controllers/shifts_controller_spec.rb on lines 3..55
        spec_old/controllers/sub_requests_controller_spec.rb on lines 3..55
        spec_old/controllers/time_slots_controller_spec.rb on lines 3..55
        spec_old/controllers/user_configs_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_entries_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_fields_controller_spec.rb on lines 3..55

        Duplicated Code

        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).

        Tuning

        This issue has a mass of 155.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 17 locations. Consider refactoring.
        Open

        describe ReportsController do
          fixtures :all
          render_views
          
          it "index action should render index template" do
        Severity: Major
        Found in spec_old/controllers/reports_controller_spec.rb and 16 other locations - About 4 hrs to fix
        spec_old/controllers/calendars_controller_spec.rb on lines 3..55
        spec_old/controllers/categories_controller_spec.rb on lines 3..55
        spec_old/controllers/locations_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_item_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/punch_clocks_controller_spec.rb on lines 3..55
        spec_old/controllers/repeating_events_controller_spec.rb on lines 3..55
        spec_old/controllers/report_items_controller_spec.rb on lines 3..55
        spec_old/controllers/restrictions_controller_spec.rb on lines 3..55
        spec_old/controllers/shifts_controller_spec.rb on lines 3..55
        spec_old/controllers/sub_requests_controller_spec.rb on lines 3..55
        spec_old/controllers/time_slots_controller_spec.rb on lines 3..55
        spec_old/controllers/user_configs_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_entries_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_fields_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profiles_controller_spec.rb on lines 3..55

        Duplicated Code

        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).

        Tuning

        This issue has a mass of 155.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 17 locations. Consider refactoring.
        Open

        describe PayformItemSetsController do
          fixtures :all
          render_views
          
          it "index action should render index template" do
        Severity: Major
        Found in spec_old/controllers/payform_item_sets_controller_spec.rb and 16 other locations - About 4 hrs to fix
        spec_old/controllers/calendars_controller_spec.rb on lines 3..55
        spec_old/controllers/categories_controller_spec.rb on lines 3..55
        spec_old/controllers/locations_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/punch_clocks_controller_spec.rb on lines 3..55
        spec_old/controllers/repeating_events_controller_spec.rb on lines 3..55
        spec_old/controllers/report_items_controller_spec.rb on lines 3..55
        spec_old/controllers/reports_controller_spec.rb on lines 3..55
        spec_old/controllers/restrictions_controller_spec.rb on lines 3..55
        spec_old/controllers/shifts_controller_spec.rb on lines 3..55
        spec_old/controllers/sub_requests_controller_spec.rb on lines 3..55
        spec_old/controllers/time_slots_controller_spec.rb on lines 3..55
        spec_old/controllers/user_configs_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_entries_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_fields_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profiles_controller_spec.rb on lines 3..55

        Duplicated Code

        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).

        Tuning

        This issue has a mass of 155.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 17 locations. Consider refactoring.
        Open

        describe UserConfigsController do
          fixtures :all
          render_views
          
          it "index action should render index template" do
        Severity: Major
        Found in spec_old/controllers/user_configs_controller_spec.rb and 16 other locations - About 4 hrs to fix
        spec_old/controllers/calendars_controller_spec.rb on lines 3..55
        spec_old/controllers/categories_controller_spec.rb on lines 3..55
        spec_old/controllers/locations_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_item_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/payform_sets_controller_spec.rb on lines 3..55
        spec_old/controllers/punch_clocks_controller_spec.rb on lines 3..55
        spec_old/controllers/repeating_events_controller_spec.rb on lines 3..55
        spec_old/controllers/report_items_controller_spec.rb on lines 3..55
        spec_old/controllers/reports_controller_spec.rb on lines 3..55
        spec_old/controllers/restrictions_controller_spec.rb on lines 3..55
        spec_old/controllers/shifts_controller_spec.rb on lines 3..55
        spec_old/controllers/sub_requests_controller_spec.rb on lines 3..55
        spec_old/controllers/time_slots_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_entries_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profile_fields_controller_spec.rb on lines 3..55
        spec_old/controllers/user_profiles_controller_spec.rb on lines 3..55

        Duplicated Code

        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).

        Tuning

        This issue has a mass of 155.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language