snap-cloud/snapcon

View on GitHub

Showing 70 of 162 total issues

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

    def update
      if @lodging.update(lodging_params)
        redirect_to admin_conference_lodgings_path(conference_id: @conference.short_title),
                    notice: 'Lodging successfully updated.'
      else
Severity: Major
Found in app/controllers/admin/lodgings_controller.rb and 10 other locations - About 25 mins to fix
app/controllers/admin/difficulty_levels_controller.rb on lines 30..37
app/controllers/admin/event_types_controller.rb on lines 28..35
app/controllers/admin/resources_controller.rb on lines 27..34
app/controllers/admin/rooms_controller.rb on lines 28..35
app/controllers/admin/sponsors_controller.rb on lines 30..39
app/controllers/admin/sponsorship_levels_controller.rb on lines 29..38
app/controllers/admin/tickets_controller.rb on lines 31..38
app/controllers/admin/tracks_controller.rb on lines 58..65
app/controllers/admin/venues_controller.rb on lines 27..34
app/controllers/tracks_controller.rb on lines 33..40

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

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

    def update
      if @difficulty_level.update(difficulty_level_params)
        redirect_to admin_conference_program_difficulty_levels_path(conference_id: @conference.short_title),
                    notice: 'Difficulty level successfully updated.'
      else
Severity: Major
Found in app/controllers/admin/difficulty_levels_controller.rb and 10 other locations - About 25 mins to fix
app/controllers/admin/event_types_controller.rb on lines 28..35
app/controllers/admin/lodgings_controller.rb on lines 27..34
app/controllers/admin/resources_controller.rb on lines 27..34
app/controllers/admin/rooms_controller.rb on lines 28..35
app/controllers/admin/sponsors_controller.rb on lines 30..39
app/controllers/admin/sponsorship_levels_controller.rb on lines 29..38
app/controllers/admin/tickets_controller.rb on lines 31..38
app/controllers/admin/tracks_controller.rb on lines 58..65
app/controllers/admin/venues_controller.rb on lines 27..34
app/controllers/tracks_controller.rb on lines 33..40

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

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

    def destroy
      if @resource.destroy
        redirect_to admin_conference_resources_path(conference_id: @conference.short_title),
                    notice: 'Resource successfully destroyed.'
      else
Severity: Major
Found in app/controllers/admin/resources_controller.rb and 9 other locations - About 25 mins to fix
app/controllers/admin/difficulty_levels_controller.rb on lines 40..48
app/controllers/admin/event_types_controller.rb on lines 38..46
app/controllers/admin/lodgings_controller.rb on lines 37..45
app/controllers/admin/rooms_controller.rb on lines 38..45
app/controllers/admin/schedules_controller.rb on lines 61..68
app/controllers/admin/sponsors_controller.rb on lines 42..50
app/controllers/admin/sponsorship_levels_controller.rb on lines 41..49
app/controllers/admin/tickets_controller.rb on lines 76..84
app/controllers/admin/tracks_controller.rb on lines 68..75

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

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

    def destroy
      if @room.destroy
        redirect_to admin_conference_venue_rooms_path(conference_id: @conference.short_title),
                    notice: 'Room successfully deleted.'
      else
Severity: Major
Found in app/controllers/admin/rooms_controller.rb and 9 other locations - About 25 mins to fix
app/controllers/admin/difficulty_levels_controller.rb on lines 40..48
app/controllers/admin/event_types_controller.rb on lines 38..46
app/controllers/admin/lodgings_controller.rb on lines 37..45
app/controllers/admin/resources_controller.rb on lines 37..45
app/controllers/admin/schedules_controller.rb on lines 61..68
app/controllers/admin/sponsors_controller.rb on lines 42..50
app/controllers/admin/sponsorship_levels_controller.rb on lines 41..49
app/controllers/admin/tickets_controller.rb on lines 76..84
app/controllers/admin/tracks_controller.rb on lines 68..75

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

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

    def destroy
      if @sponsorship_level.destroy
        redirect_to admin_conference_sponsorship_levels_path(conference_id: @conference.short_title),
                    notice: 'Sponsorship level successfully deleted.'
      else
Severity: Major
Found in app/controllers/admin/sponsorship_levels_controller.rb and 9 other locations - About 25 mins to fix
app/controllers/admin/difficulty_levels_controller.rb on lines 40..48
app/controllers/admin/event_types_controller.rb on lines 38..46
app/controllers/admin/lodgings_controller.rb on lines 37..45
app/controllers/admin/resources_controller.rb on lines 37..45
app/controllers/admin/rooms_controller.rb on lines 38..45
app/controllers/admin/schedules_controller.rb on lines 61..68
app/controllers/admin/sponsors_controller.rb on lines 42..50
app/controllers/admin/tickets_controller.rb on lines 76..84
app/controllers/admin/tracks_controller.rb on lines 68..75

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

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

    def destroy
      if @lodging.destroy
        redirect_to admin_conference_lodgings_path(conference_id: @conference.short_title),
                    notice: 'Lodging successfully deleted.'
      else
Severity: Major
Found in app/controllers/admin/lodgings_controller.rb and 9 other locations - About 25 mins to fix
app/controllers/admin/difficulty_levels_controller.rb on lines 40..48
app/controllers/admin/event_types_controller.rb on lines 38..46
app/controllers/admin/resources_controller.rb on lines 37..45
app/controllers/admin/rooms_controller.rb on lines 38..45
app/controllers/admin/schedules_controller.rb on lines 61..68
app/controllers/admin/sponsors_controller.rb on lines 42..50
app/controllers/admin/sponsorship_levels_controller.rb on lines 41..49
app/controllers/admin/tickets_controller.rb on lines 76..84
app/controllers/admin/tracks_controller.rb on lines 68..75

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

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

    def update
      if @resource.update(resource_params)
        redirect_to admin_conference_resources_path(conference_id: @conference.short_title),
                    notice: 'Resource successfully updated.'
      else
Severity: Major
Found in app/controllers/admin/resources_controller.rb and 10 other locations - About 25 mins to fix
app/controllers/admin/difficulty_levels_controller.rb on lines 30..37
app/controllers/admin/event_types_controller.rb on lines 28..35
app/controllers/admin/lodgings_controller.rb on lines 27..34
app/controllers/admin/rooms_controller.rb on lines 28..35
app/controllers/admin/sponsors_controller.rb on lines 30..39
app/controllers/admin/sponsorship_levels_controller.rb on lines 29..38
app/controllers/admin/tickets_controller.rb on lines 31..38
app/controllers/admin/tracks_controller.rb on lines 58..65
app/controllers/admin/venues_controller.rb on lines 27..34
app/controllers/tracks_controller.rb on lines 33..40

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

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

    def destroy
      if @schedule.destroy
        redirect_to admin_conference_schedules_path(conference_id: @conference.short_title),
                    notice: 'Schedule successfully deleted.'
      else
Severity: Major
Found in app/controllers/admin/schedules_controller.rb and 9 other locations - About 25 mins to fix
app/controllers/admin/difficulty_levels_controller.rb on lines 40..48
app/controllers/admin/event_types_controller.rb on lines 38..46
app/controllers/admin/lodgings_controller.rb on lines 37..45
app/controllers/admin/resources_controller.rb on lines 37..45
app/controllers/admin/rooms_controller.rb on lines 38..45
app/controllers/admin/sponsors_controller.rb on lines 42..50
app/controllers/admin/sponsorship_levels_controller.rb on lines 41..49
app/controllers/admin/tickets_controller.rb on lines 76..84
app/controllers/admin/tracks_controller.rb on lines 68..75

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

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

    def destroy
      if @event_type.destroy
        redirect_to admin_conference_program_event_types_path(conference_id: @conference.short_title),
                    notice: 'Event type successfully deleted.'
      else
Severity: Major
Found in app/controllers/admin/event_types_controller.rb and 9 other locations - About 25 mins to fix
app/controllers/admin/difficulty_levels_controller.rb on lines 40..48
app/controllers/admin/lodgings_controller.rb on lines 37..45
app/controllers/admin/resources_controller.rb on lines 37..45
app/controllers/admin/rooms_controller.rb on lines 38..45
app/controllers/admin/schedules_controller.rb on lines 61..68
app/controllers/admin/sponsors_controller.rb on lines 42..50
app/controllers/admin/sponsorship_levels_controller.rb on lines 41..49
app/controllers/admin/tickets_controller.rb on lines 76..84
app/controllers/admin/tracks_controller.rb on lines 68..75

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

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

    def destroy
      if @sponsor.destroy
        redirect_to admin_conference_sponsors_path(conference_id: @conference.short_title),
                    notice: 'Sponsor successfully deleted.'
      else
Severity: Major
Found in app/controllers/admin/sponsors_controller.rb and 9 other locations - About 25 mins to fix
app/controllers/admin/difficulty_levels_controller.rb on lines 40..48
app/controllers/admin/event_types_controller.rb on lines 38..46
app/controllers/admin/lodgings_controller.rb on lines 37..45
app/controllers/admin/resources_controller.rb on lines 37..45
app/controllers/admin/rooms_controller.rb on lines 38..45
app/controllers/admin/schedules_controller.rb on lines 61..68
app/controllers/admin/sponsorship_levels_controller.rb on lines 41..49
app/controllers/admin/tickets_controller.rb on lines 76..84
app/controllers/admin/tracks_controller.rb on lines 68..75

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

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

    def update
      if @event_type.update(event_type_params)
        redirect_to admin_conference_program_event_types_path(conference_id: @conference.short_title),
                    notice: 'Event type successfully updated.'
      else
Severity: Major
Found in app/controllers/admin/event_types_controller.rb and 10 other locations - About 25 mins to fix
app/controllers/admin/difficulty_levels_controller.rb on lines 30..37
app/controllers/admin/lodgings_controller.rb on lines 27..34
app/controllers/admin/resources_controller.rb on lines 27..34
app/controllers/admin/rooms_controller.rb on lines 28..35
app/controllers/admin/sponsors_controller.rb on lines 30..39
app/controllers/admin/sponsorship_levels_controller.rb on lines 29..38
app/controllers/admin/tickets_controller.rb on lines 31..38
app/controllers/admin/tracks_controller.rb on lines 58..65
app/controllers/admin/venues_controller.rb on lines 27..34
app/controllers/tracks_controller.rb on lines 33..40

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

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

    def destroy
      if @ticket.destroy
        redirect_to admin_conference_tickets_path(conference_id: @conference.short_title),
                    notice: 'Ticket successfully deleted.'
      else
Severity: Major
Found in app/controllers/admin/tickets_controller.rb and 9 other locations - About 25 mins to fix
app/controllers/admin/difficulty_levels_controller.rb on lines 40..48
app/controllers/admin/event_types_controller.rb on lines 38..46
app/controllers/admin/lodgings_controller.rb on lines 37..45
app/controllers/admin/resources_controller.rb on lines 37..45
app/controllers/admin/rooms_controller.rb on lines 38..45
app/controllers/admin/schedules_controller.rb on lines 61..68
app/controllers/admin/sponsors_controller.rb on lines 42..50
app/controllers/admin/sponsorship_levels_controller.rb on lines 41..49
app/controllers/admin/tracks_controller.rb on lines 68..75

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

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

    def update
      if @sponsorship_level.update(sponsorship_level_params)
        redirect_to admin_conference_sponsorship_levels_path(
          conference_id: @conference.short_title
        ),
Severity: Major
Found in app/controllers/admin/sponsorship_levels_controller.rb and 10 other locations - About 25 mins to fix
app/controllers/admin/difficulty_levels_controller.rb on lines 30..37
app/controllers/admin/event_types_controller.rb on lines 28..35
app/controllers/admin/lodgings_controller.rb on lines 27..34
app/controllers/admin/resources_controller.rb on lines 27..34
app/controllers/admin/rooms_controller.rb on lines 28..35
app/controllers/admin/sponsors_controller.rb on lines 30..39
app/controllers/admin/tickets_controller.rb on lines 31..38
app/controllers/admin/tracks_controller.rb on lines 58..65
app/controllers/admin/venues_controller.rb on lines 27..34
app/controllers/tracks_controller.rb on lines 33..40

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

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

    def update
      if @room.update(room_params)
        redirect_to admin_conference_venue_rooms_path(conference_id: @conference.short_title),
                    notice: 'Room successfully updated.'
      else
Severity: Major
Found in app/controllers/admin/rooms_controller.rb and 10 other locations - About 25 mins to fix
app/controllers/admin/difficulty_levels_controller.rb on lines 30..37
app/controllers/admin/event_types_controller.rb on lines 28..35
app/controllers/admin/lodgings_controller.rb on lines 27..34
app/controllers/admin/resources_controller.rb on lines 27..34
app/controllers/admin/sponsors_controller.rb on lines 30..39
app/controllers/admin/sponsorship_levels_controller.rb on lines 29..38
app/controllers/admin/tickets_controller.rb on lines 31..38
app/controllers/admin/tracks_controller.rb on lines 58..65
app/controllers/admin/venues_controller.rb on lines 27..34
app/controllers/tracks_controller.rb on lines 33..40

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

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

  def difficulty_dropdown(event, difficulties, conference_id)
    selection = event.difficulty_level.try(:title) || 'Difficulty'
    options = difficulties.collect do |difficulty|
      [
        difficulty.title,
Severity: Minor
Found in app/helpers/events_helper.rb and 2 other locations - About 25 mins to fix
app/helpers/events_helper.rb on lines 59..71
app/helpers/events_helper.rb on lines 75..87

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

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

  def track_dropdown(event, tracks, conference_id)
    selection = event.track.try(:name) || 'Track'
    options = tracks.collect do |track|
      [
        track.name,
Severity: Minor
Found in app/helpers/events_helper.rb and 2 other locations - About 25 mins to fix
app/helpers/events_helper.rb on lines 59..71
app/helpers/events_helper.rb on lines 91..103

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

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

  def event_type_dropdown(event, event_types, conference_id)
    selection = event.event_type.try(:title) || 'Event Type'
    options = event_types.collect do |event_type|
      [
        event_type.title,
Severity: Minor
Found in app/helpers/events_helper.rb and 2 other locations - About 25 mins to fix
app/helpers/events_helper.rb on lines 75..87
app/helpers/events_helper.rb on lines 91..103

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

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

      if alert.blank?
        flash[:notice] = notice
        redirect_back_or_to(admin_conference_program_events_path(conference_id: @conference.short_title)) && return
      else
        flash[:error] = alert
Severity: Minor
Found in app/controllers/admin/events_controller.rb and 1 other location - About 25 mins to fix
app/controllers/admin/booths_controller.rb on lines 123..129

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

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

      if alert.blank?
        flash[:notice] = notice
        redirect_back_or_to(admin_conference_booths_path(conference_id: @conference.short_title)) && return
      else
        flash[:error] = alert
Severity: Minor
Found in app/controllers/admin/booths_controller.rb and 1 other location - About 25 mins to fix
app/controllers/admin/events_controller.rb on lines 207..213

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

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

    user_name = User.find_by(id: user_id).try(:name) || current_or_last_object_state('User', user_id).try(:name) || PaperTrail::Version.where(item_type: 'User', item_id: user_id).last.changeset[:name].second

    unless user_id
Severity: Minor
Found in app/helpers/versions_helper.rb and 1 other location - About 20 mins to fix
app/helpers/versions_helper.rb on lines 74..74

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

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