ReadyResponder/ReadyResponder

View on GitHub

Showing 131 of 7,746 total issues

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

RSpec.describe EventsController do
  describe "routing" do

    it "routes to #index" do
      expect(get("/events")).to route_to("events#index")
Severity: Major
Found in spec/routing/events_routing_spec.rb and 8 other locations - About 2 hrs to fix
spec/routing/activities_routing_spec.rb on lines 3..31
spec/routing/channels_routing_spec.rb on lines 3..31
spec/routing/items_routing_spec.rb on lines 3..31
spec/routing/locations_routing_spec.rb on lines 3..31
spec/routing/moves_routing_spec.rb on lines 3..31
spec/routing/repairs_routing_spec.rb on lines 3..31
spec/routing/roles_routing_spec.rb on lines 3..31
spec/routing/timeslots_routing_spec.rb on lines 3..31

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

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 9 locations. Consider refactoring.
Open

RSpec.describe ActivitiesController do
  describe "routing" do

    it "routes to #index" do
      expect(get("/activities")).to route_to("activities#index")
Severity: Major
Found in spec/routing/activities_routing_spec.rb and 8 other locations - About 2 hrs to fix
spec/routing/channels_routing_spec.rb on lines 3..31
spec/routing/events_routing_spec.rb on lines 3..31
spec/routing/items_routing_spec.rb on lines 3..31
spec/routing/locations_routing_spec.rb on lines 3..31
spec/routing/moves_routing_spec.rb on lines 3..31
spec/routing/repairs_routing_spec.rb on lines 3..31
spec/routing/roles_routing_spec.rb on lines 3..31
spec/routing/timeslots_routing_spec.rb on lines 3..31

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

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 9 locations. Consider refactoring.
Open

RSpec.describe RolesController do
  describe "routing" do

    it "routes to #index" do
      expect(get("/roles")).to route_to("roles#index")
Severity: Major
Found in spec/routing/roles_routing_spec.rb and 8 other locations - About 2 hrs to fix
spec/routing/activities_routing_spec.rb on lines 3..31
spec/routing/channels_routing_spec.rb on lines 3..31
spec/routing/events_routing_spec.rb on lines 3..31
spec/routing/items_routing_spec.rb on lines 3..31
spec/routing/locations_routing_spec.rb on lines 3..31
spec/routing/moves_routing_spec.rb on lines 3..31
spec/routing/repairs_routing_spec.rb on lines 3..31
spec/routing/timeslots_routing_spec.rb on lines 3..31

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

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 9 locations. Consider refactoring.
Open

RSpec.describe LocationsController do
  describe "routing" do

    it "routes to #index" do
      expect(get("/locations")).to route_to("locations#index")
Severity: Major
Found in spec/routing/locations_routing_spec.rb and 8 other locations - About 2 hrs to fix
spec/routing/activities_routing_spec.rb on lines 3..31
spec/routing/channels_routing_spec.rb on lines 3..31
spec/routing/events_routing_spec.rb on lines 3..31
spec/routing/items_routing_spec.rb on lines 3..31
spec/routing/moves_routing_spec.rb on lines 3..31
spec/routing/repairs_routing_spec.rb on lines 3..31
spec/routing/roles_routing_spec.rb on lines 3..31
spec/routing/timeslots_routing_spec.rb on lines 3..31

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

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 9 locations. Consider refactoring.
Open

RSpec.describe ItemsController do
  describe "routing" do

    it "routes to #index" do
      expect(get("/items")).to route_to("items#index")
Severity: Major
Found in spec/routing/items_routing_spec.rb and 8 other locations - About 2 hrs to fix
spec/routing/activities_routing_spec.rb on lines 3..31
spec/routing/channels_routing_spec.rb on lines 3..31
spec/routing/events_routing_spec.rb on lines 3..31
spec/routing/locations_routing_spec.rb on lines 3..31
spec/routing/moves_routing_spec.rb on lines 3..31
spec/routing/repairs_routing_spec.rb on lines 3..31
spec/routing/roles_routing_spec.rb on lines 3..31
spec/routing/timeslots_routing_spec.rb on lines 3..31

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

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 9 locations. Consider refactoring.
Open

RSpec.describe RepairsController do
  describe "routing" do

    it "routes to #index" do
      expect(get("/repairs")).to route_to("repairs#index")
Severity: Major
Found in spec/routing/repairs_routing_spec.rb and 8 other locations - About 2 hrs to fix
spec/routing/activities_routing_spec.rb on lines 3..31
spec/routing/channels_routing_spec.rb on lines 3..31
spec/routing/events_routing_spec.rb on lines 3..31
spec/routing/items_routing_spec.rb on lines 3..31
spec/routing/locations_routing_spec.rb on lines 3..31
spec/routing/moves_routing_spec.rb on lines 3..31
spec/routing/roles_routing_spec.rb on lines 3..31
spec/routing/timeslots_routing_spec.rb on lines 3..31

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

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 2 locations. Consider refactoring.
Open

    it "returns a page for Inactive", js: true do
      visit inactive_people_path
      expect(page).to have_content('People') # This is in the nav bar
      expect(page).to have_content('Inactive People')
      within(".data-table-departments") do
Severity: Major
Found in spec/features/person_displays_spec.rb and 1 other location - About 1 hr to fix
spec/features/person_displays_spec.rb on lines 97..114

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

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 2 locations. Consider refactoring.
Open

    it "returns a page for Everybody", js: true do
      visit everybody_people_path
      expect(page).to have_content('People') # This is in the nav bar
      expect(page).to have_content('Everybody')
      within(".data-table-departments") do
Severity: Major
Found in spec/features/person_displays_spec.rb and 1 other location - About 1 hr to fix
spec/features/person_displays_spec.rb on lines 77..94

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

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

      before(:each) do

        @department = create(:department)
        @event = create(:event, title: 'The Event', id_code: 'event0132',
                        start_time: 1.day.ago, end_time: 1.day.from_now,
Severity: Major
Found in spec/features/requirement_assignment_page_spec.rb and 1 other location - About 1 hr to fix
spec/features/assignment_page_spec.rb on lines 10..20

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

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

      before(:each) do

        @department = create(:department)
        @event = create(:event, title: 'The Event', id_code: 'event0132',
                        start_time: 1.day.ago, end_time: 1.day.from_now,
Severity: Major
Found in spec/features/assignment_page_spec.rb and 1 other location - About 1 hr to fix
spec/features/requirement_assignment_page_spec.rb on lines 10..20

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

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 2 locations. Consider refactoring.
Open

  config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
    b.use :html5
    b.use :placeholder
    b.optional :maxlength
    b.optional :pattern
Severity: Major
Found in config/initializers/simple_form_bootstrap.rb and 1 other location - About 1 hr to fix
config/initializers/simple_form_bootstrap.rb on lines 7..19

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

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 2 locations. Consider refactoring.
Open

  config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
    b.use :html5
    b.use :placeholder
    b.optional :maxlength
    b.optional :pattern
Severity: Major
Found in config/initializers/simple_form_bootstrap.rb and 1 other location - About 1 hr to fix
config/initializers/simple_form_bootstrap.rb on lines 111..123

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

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 4 locations. Consider refactoring.
Open

      it "rounds times in the fourth quarter of an hour correctly" do
        event.start_time = event.start_time.change(:hour => 9, :min => 46,
                                                     :sec => 35, :usec => 231)
        event.end_time = event.end_time.change(:hour => 9, :min => 59,
                                                     :sec => 35, :usec => 231)
Severity: Major
Found in spec/services/time_rounding_service_spec.rb and 3 other locations - About 1 hr to fix
spec/services/time_rounding_service_spec.rb on lines 10..19
spec/services/time_rounding_service_spec.rb on lines 22..31
spec/services/time_rounding_service_spec.rb on lines 34..43

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

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 4 locations. Consider refactoring.
Open

      it "rounds times in the third quarter of an hour correctly" do
        event.start_time = event.start_time.change(:hour => 9, :min => 31,
                                                     :sec => 35, :usec => 231)
        event.end_time = event.end_time.change(:hour => 9, :min => 44,
                                                     :sec => 35, :usec => 231)
Severity: Major
Found in spec/services/time_rounding_service_spec.rb and 3 other locations - About 1 hr to fix
spec/services/time_rounding_service_spec.rb on lines 10..19
spec/services/time_rounding_service_spec.rb on lines 22..31
spec/services/time_rounding_service_spec.rb on lines 46..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 53.

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 4 locations. Consider refactoring.
Open

      it "rounds times in the second quarter of an hour correctly" do
        event.start_time = event.start_time.change(:hour => 9, :min => 16,
                                                     :sec => 35, :usec => 231)
        event.end_time = event.end_time.change(:hour => 9, :min => 19,
                                                     :sec => 35, :usec => 231)
Severity: Major
Found in spec/services/time_rounding_service_spec.rb and 3 other locations - About 1 hr to fix
spec/services/time_rounding_service_spec.rb on lines 10..19
spec/services/time_rounding_service_spec.rb on lines 34..43
spec/services/time_rounding_service_spec.rb on lines 46..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 53.

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 4 locations. Consider refactoring.
Open

      it "rounds times in the first quarter of an hour correctly" do
        event.start_time = event.start_time.change(:hour => 9, :min => 1,
                                                     :sec => 35, :usec => 231)
        event.end_time = event.end_time.change(:hour => 9, :min => 14,
                                                     :sec => 35, :usec => 231)
Severity: Major
Found in spec/services/time_rounding_service_spec.rb and 3 other locations - About 1 hr to fix
spec/services/time_rounding_service_spec.rb on lines 22..31
spec/services/time_rounding_service_spec.rb on lines 34..43
spec/services/time_rounding_service_spec.rb on lines 46..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 53.

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 2 locations. Consider refactoring.
Open

    case event_codename
    when "custom"
      # unavailable custom 1/15/2017 0800 01/15/2021 Work
      unless start_time.is_a? Time and end_time.is_a? Time
        return "Error! Sample => unavailable custom 2016-11-23 00:01 2017-12-31 17:00 Leave of absense <="
Severity: Major
Found in app/services/msg/unavailable.rb and 1 other location - About 1 hr to fix
app/services/msg/available.rb on lines 3..15

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

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 2 locations. Consider refactoring.
Open

    case event_codename
    when "custom"
      # available custom 1/15/2017 0800 01/15/2021 Work
      unless start_time.is_a? Time and end_time.is_a? Time
        return "Error! Sample => available custom 2016-11-23 00:01 2017-12-31 17:00 Leave of absense <="
Severity: Major
Found in app/services/msg/available.rb and 1 other location - About 1 hr to fix
app/services/msg/unavailable.rb on lines 3..15

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

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 4 locations. Consider refactoring.
Open

  def create
    @move = Move.new(move_params)

    respond_to do |format|
      if @move.save
Severity: Major
Found in app/controllers/moves_controller.rb and 3 other locations - About 1 hr to fix
app/controllers/locations_controller.rb on lines 45..54
app/controllers/resource_types_controller.rb on lines 45..54
app/controllers/roles_controller.rb on lines 43..52

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

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 4 locations. Consider refactoring.
Open

  def create
    @role = Role.new(role_params)

    respond_to do |format|
      if @role.save
Severity: Major
Found in app/controllers/roles_controller.rb and 3 other locations - About 1 hr to fix
app/controllers/locations_controller.rb on lines 45..54
app/controllers/moves_controller.rb on lines 45..54
app/controllers/resource_types_controller.rb on lines 45..54

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

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