MiraitSystems/enju_trunk

View on GitHub

Showing 351 of 1,155 total issues

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

            if (/pm/i.test(a[i]) && hr < 12)
                hr += 12;
            else if (/am/i.test(a[i]) && hr >= 12)
                hr -= 12;
Severity: Major
Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
app/assets/javascripts/jquery.simplecalendarjp.js on lines 968..971

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

                    if (/pm/i.test(AP.innerHTML) && h < 12)
                        h += 12;
                    else if (/am/i.test(AP.innerHTML) && h == 12)
                        h = 0;
Severity: Major
Found in app/assets/javascripts/jquery.simplecalendarjp.js and 1 other location - About 1 hr to fix
app/assets/javascripts/jquery.simplecalendarjp.js on lines 1717..1720

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

  def update
    if params[:move]
      move_position(@user_group, params[:move])
      return
    end
Severity: Major
Found in app/controllers/user_groups_controller.rb and 2 other locations - About 1 hr to fix
app/controllers/identifier_types_controller.rb on lines 57..69
app/controllers/picture_files_controller.rb on lines 130..143

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

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

  def create
    @budget = Budget.new(params[:budget])

    respond_to do |format|
      if @budget.save
Severity: Major
Found in app/controllers/budgets_controller.rb and 1 other location - About 1 hr to fix
app/controllers/carrier_type_has_checkout_types_controller.rb on lines 50..61

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

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 update
    if params[:move]
      move_position(@identifier_type, params[:move])
      return
    end
Severity: Major
Found in app/controllers/identifier_types_controller.rb and 2 other locations - About 1 hr to fix
app/controllers/picture_files_controller.rb on lines 130..143
app/controllers/user_groups_controller.rb on lines 70..82

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

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 update
    # 並べ替え
    if params[:move]
      move_position(@picture_file, params[:move])
      return
Severity: Major
Found in app/controllers/picture_files_controller.rb and 2 other locations - About 1 hr to fix
app/controllers/identifier_types_controller.rb on lines 57..69
app/controllers/user_groups_controller.rb on lines 70..82

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

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

  def create
    @carrier_type_has_checkout_type = CarrierTypeHasCheckoutType.new(params[:carrier_type_has_checkout_type])

    respond_to do |format|
      if @carrier_type_has_checkout_type.save
app/controllers/budgets_controller.rb on lines 18..29

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

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

  def create
    @reserve_stat_has_manifestation = ReserveStatHasManifestation.new(params[:reserve_stat_has_manifestation])

    respond_to do |format|
      if @reserve_stat_has_manifestation.save
app/controllers/abbreviations_controller.rb on lines 23..33
app/controllers/areas_controller.rb on lines 32..41
app/controllers/budget_categories_controller.rb on lines 35..45
app/controllers/budget_types_controller.rb on lines 13..23
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/checkout_stat_has_users_controller.rb on lines 41..51
app/controllers/copy_requests_controller.rb on lines 21..30
app/controllers/departments_controller.rb on lines 13..22
app/controllers/keycodes_controller.rb on lines 16..25
app/controllers/manifestation_checkout_stats_controller.rb on lines 48..58
app/controllers/manifestation_reserve_stats_controller.rb on lines 47..57
app/controllers/reserve_stat_has_users_controller.rb on lines 41..51
app/controllers/series_statement_merge_lists_controller.rb on lines 42..52
app/controllers/series_statement_merges_controller.rb on lines 50..60
app/controllers/terms_controller.rb on lines 13..23
app/controllers/user_checkout_stats_controller.rb on lines 47..57
app/controllers/user_reserve_stats_controller.rb on lines 47..57

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

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

  def create
    @manifestation_checkout_stat = ManifestationCheckoutStat.new(params[:manifestation_checkout_stat])

    respond_to do |format|
      if @manifestation_checkout_stat.save
app/controllers/abbreviations_controller.rb on lines 23..33
app/controllers/areas_controller.rb on lines 32..41
app/controllers/budget_categories_controller.rb on lines 35..45
app/controllers/budget_types_controller.rb on lines 13..23
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/checkout_stat_has_users_controller.rb on lines 41..51
app/controllers/copy_requests_controller.rb on lines 21..30
app/controllers/departments_controller.rb on lines 13..22
app/controllers/keycodes_controller.rb on lines 16..25
app/controllers/manifestation_reserve_stats_controller.rb on lines 47..57
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/reserve_stat_has_users_controller.rb on lines 41..51
app/controllers/series_statement_merge_lists_controller.rb on lines 42..52
app/controllers/series_statement_merges_controller.rb on lines 50..60
app/controllers/terms_controller.rb on lines 13..23
app/controllers/user_checkout_stats_controller.rb on lines 47..57
app/controllers/user_reserve_stats_controller.rb on lines 47..57

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

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

  def create
    @keycode = Keycode.new(params[:keycode])
    respond_to do |format|
      if @keycode.save
        flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.keycode'))
Severity: Major
Found in app/controllers/keycodes_controller.rb and 17 other locations - About 1 hr to fix
app/controllers/abbreviations_controller.rb on lines 23..33
app/controllers/areas_controller.rb on lines 32..41
app/controllers/budget_categories_controller.rb on lines 35..45
app/controllers/budget_types_controller.rb on lines 13..23
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/checkout_stat_has_users_controller.rb on lines 41..51
app/controllers/copy_requests_controller.rb on lines 21..30
app/controllers/departments_controller.rb on lines 13..22
app/controllers/manifestation_checkout_stats_controller.rb on lines 48..58
app/controllers/manifestation_reserve_stats_controller.rb on lines 47..57
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/reserve_stat_has_users_controller.rb on lines 41..51
app/controllers/series_statement_merge_lists_controller.rb on lines 42..52
app/controllers/series_statement_merges_controller.rb on lines 50..60
app/controllers/terms_controller.rb on lines 13..23
app/controllers/user_checkout_stats_controller.rb on lines 47..57
app/controllers/user_reserve_stats_controller.rb on lines 47..57

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

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

  def create
    @department = Department.new(params[:department])
      respond_to do |format|
      if @department.save
        flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.department'))
Severity: Major
Found in app/controllers/departments_controller.rb and 17 other locations - About 1 hr to fix
app/controllers/abbreviations_controller.rb on lines 23..33
app/controllers/areas_controller.rb on lines 32..41
app/controllers/budget_categories_controller.rb on lines 35..45
app/controllers/budget_types_controller.rb on lines 13..23
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/checkout_stat_has_users_controller.rb on lines 41..51
app/controllers/copy_requests_controller.rb on lines 21..30
app/controllers/keycodes_controller.rb on lines 16..25
app/controllers/manifestation_checkout_stats_controller.rb on lines 48..58
app/controllers/manifestation_reserve_stats_controller.rb on lines 47..57
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/reserve_stat_has_users_controller.rb on lines 41..51
app/controllers/series_statement_merge_lists_controller.rb on lines 42..52
app/controllers/series_statement_merges_controller.rb on lines 50..60
app/controllers/terms_controller.rb on lines 13..23
app/controllers/user_checkout_stats_controller.rb on lines 47..57
app/controllers/user_reserve_stats_controller.rb on lines 47..57

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

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

  def create
    @series_statement_merge = SeriesStatementMerge.new(params[:series_statement_merge])

    respond_to do |format|
      if @series_statement_merge.save
Severity: Major
Found in app/controllers/series_statement_merges_controller.rb and 17 other locations - About 1 hr to fix
app/controllers/abbreviations_controller.rb on lines 23..33
app/controllers/areas_controller.rb on lines 32..41
app/controllers/budget_categories_controller.rb on lines 35..45
app/controllers/budget_types_controller.rb on lines 13..23
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/checkout_stat_has_users_controller.rb on lines 41..51
app/controllers/copy_requests_controller.rb on lines 21..30
app/controllers/departments_controller.rb on lines 13..22
app/controllers/keycodes_controller.rb on lines 16..25
app/controllers/manifestation_checkout_stats_controller.rb on lines 48..58
app/controllers/manifestation_reserve_stats_controller.rb on lines 47..57
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/reserve_stat_has_users_controller.rb on lines 41..51
app/controllers/series_statement_merge_lists_controller.rb on lines 42..52
app/controllers/terms_controller.rb on lines 13..23
app/controllers/user_checkout_stats_controller.rb on lines 47..57
app/controllers/user_reserve_stats_controller.rb on lines 47..57

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

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

  def create
    @area = Area.new(params[:area])
      respond_to do |format|
      if @area.save
        flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.area'))
Severity: Major
Found in app/controllers/areas_controller.rb and 17 other locations - About 1 hr to fix
app/controllers/abbreviations_controller.rb on lines 23..33
app/controllers/budget_categories_controller.rb on lines 35..45
app/controllers/budget_types_controller.rb on lines 13..23
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/checkout_stat_has_users_controller.rb on lines 41..51
app/controllers/copy_requests_controller.rb on lines 21..30
app/controllers/departments_controller.rb on lines 13..22
app/controllers/keycodes_controller.rb on lines 16..25
app/controllers/manifestation_checkout_stats_controller.rb on lines 48..58
app/controllers/manifestation_reserve_stats_controller.rb on lines 47..57
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/reserve_stat_has_users_controller.rb on lines 41..51
app/controllers/series_statement_merge_lists_controller.rb on lines 42..52
app/controllers/series_statement_merges_controller.rb on lines 50..60
app/controllers/terms_controller.rb on lines 13..23
app/controllers/user_checkout_stats_controller.rb on lines 47..57
app/controllers/user_reserve_stats_controller.rb on lines 47..57

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

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

  def create
    @user_reserve_stat = UserReserveStat.new(params[:user_reserve_stat])

    respond_to do |format|
      if @user_reserve_stat.save
Severity: Major
Found in app/controllers/user_reserve_stats_controller.rb and 17 other locations - About 1 hr to fix
app/controllers/abbreviations_controller.rb on lines 23..33
app/controllers/areas_controller.rb on lines 32..41
app/controllers/budget_categories_controller.rb on lines 35..45
app/controllers/budget_types_controller.rb on lines 13..23
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/checkout_stat_has_users_controller.rb on lines 41..51
app/controllers/copy_requests_controller.rb on lines 21..30
app/controllers/departments_controller.rb on lines 13..22
app/controllers/keycodes_controller.rb on lines 16..25
app/controllers/manifestation_checkout_stats_controller.rb on lines 48..58
app/controllers/manifestation_reserve_stats_controller.rb on lines 47..57
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/reserve_stat_has_users_controller.rb on lines 41..51
app/controllers/series_statement_merge_lists_controller.rb on lines 42..52
app/controllers/series_statement_merges_controller.rb on lines 50..60
app/controllers/terms_controller.rb on lines 13..23
app/controllers/user_checkout_stats_controller.rb on lines 47..57

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

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

  def create
    @copy_request = CopyRequest.new(params[:copy_request])
    respond_to do |format|
      if @copy_request.save
        flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.copy_request'))
Severity: Major
Found in app/controllers/copy_requests_controller.rb and 17 other locations - About 1 hr to fix
app/controllers/abbreviations_controller.rb on lines 23..33
app/controllers/areas_controller.rb on lines 32..41
app/controllers/budget_categories_controller.rb on lines 35..45
app/controllers/budget_types_controller.rb on lines 13..23
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/checkout_stat_has_users_controller.rb on lines 41..51
app/controllers/departments_controller.rb on lines 13..22
app/controllers/keycodes_controller.rb on lines 16..25
app/controllers/manifestation_checkout_stats_controller.rb on lines 48..58
app/controllers/manifestation_reserve_stats_controller.rb on lines 47..57
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/reserve_stat_has_users_controller.rb on lines 41..51
app/controllers/series_statement_merge_lists_controller.rb on lines 42..52
app/controllers/series_statement_merges_controller.rb on lines 50..60
app/controllers/terms_controller.rb on lines 13..23
app/controllers/user_checkout_stats_controller.rb on lines 47..57
app/controllers/user_reserve_stats_controller.rb on lines 47..57

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

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

  def create
    @checkout_stat_has_manifestation = CheckoutStatHasManifestation.new(params[:checkout_stat_has_manifestation])

    respond_to do |format|
      if @checkout_stat_has_manifestation.save
app/controllers/abbreviations_controller.rb on lines 23..33
app/controllers/areas_controller.rb on lines 32..41
app/controllers/budget_categories_controller.rb on lines 35..45
app/controllers/budget_types_controller.rb on lines 13..23
app/controllers/checkout_stat_has_users_controller.rb on lines 41..51
app/controllers/copy_requests_controller.rb on lines 21..30
app/controllers/departments_controller.rb on lines 13..22
app/controllers/keycodes_controller.rb on lines 16..25
app/controllers/manifestation_checkout_stats_controller.rb on lines 48..58
app/controllers/manifestation_reserve_stats_controller.rb on lines 47..57
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/reserve_stat_has_users_controller.rb on lines 41..51
app/controllers/series_statement_merge_lists_controller.rb on lines 42..52
app/controllers/series_statement_merges_controller.rb on lines 50..60
app/controllers/terms_controller.rb on lines 13..23
app/controllers/user_checkout_stats_controller.rb on lines 47..57
app/controllers/user_reserve_stats_controller.rb on lines 47..57

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

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

  def create
    @budget_type = BudgetType.new(params[:budget_type])

    respond_to do |format|
      if @budget_type.save
Severity: Major
Found in app/controllers/budget_types_controller.rb and 17 other locations - About 1 hr to fix
app/controllers/abbreviations_controller.rb on lines 23..33
app/controllers/areas_controller.rb on lines 32..41
app/controllers/budget_categories_controller.rb on lines 35..45
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/checkout_stat_has_users_controller.rb on lines 41..51
app/controllers/copy_requests_controller.rb on lines 21..30
app/controllers/departments_controller.rb on lines 13..22
app/controllers/keycodes_controller.rb on lines 16..25
app/controllers/manifestation_checkout_stats_controller.rb on lines 48..58
app/controllers/manifestation_reserve_stats_controller.rb on lines 47..57
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/reserve_stat_has_users_controller.rb on lines 41..51
app/controllers/series_statement_merge_lists_controller.rb on lines 42..52
app/controllers/series_statement_merges_controller.rb on lines 50..60
app/controllers/terms_controller.rb on lines 13..23
app/controllers/user_checkout_stats_controller.rb on lines 47..57
app/controllers/user_reserve_stats_controller.rb on lines 47..57

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

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

  def create
    @manifestation_reserve_stat = ManifestationReserveStat.new(params[:manifestation_reserve_stat])

    respond_to do |format|
      if @manifestation_reserve_stat.save
Severity: Major
Found in app/controllers/manifestation_reserve_stats_controller.rb and 17 other locations - About 1 hr to fix
app/controllers/abbreviations_controller.rb on lines 23..33
app/controllers/areas_controller.rb on lines 32..41
app/controllers/budget_categories_controller.rb on lines 35..45
app/controllers/budget_types_controller.rb on lines 13..23
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/checkout_stat_has_users_controller.rb on lines 41..51
app/controllers/copy_requests_controller.rb on lines 21..30
app/controllers/departments_controller.rb on lines 13..22
app/controllers/keycodes_controller.rb on lines 16..25
app/controllers/manifestation_checkout_stats_controller.rb on lines 48..58
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/reserve_stat_has_users_controller.rb on lines 41..51
app/controllers/series_statement_merge_lists_controller.rb on lines 42..52
app/controllers/series_statement_merges_controller.rb on lines 50..60
app/controllers/terms_controller.rb on lines 13..23
app/controllers/user_checkout_stats_controller.rb on lines 47..57
app/controllers/user_reserve_stats_controller.rb on lines 47..57

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

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

  def create
    @term = Term.new(params[:term])

    respond_to do |format|
      if @term.save
Severity: Major
Found in app/controllers/terms_controller.rb and 17 other locations - About 1 hr to fix
app/controllers/abbreviations_controller.rb on lines 23..33
app/controllers/areas_controller.rb on lines 32..41
app/controllers/budget_categories_controller.rb on lines 35..45
app/controllers/budget_types_controller.rb on lines 13..23
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/checkout_stat_has_users_controller.rb on lines 41..51
app/controllers/copy_requests_controller.rb on lines 21..30
app/controllers/departments_controller.rb on lines 13..22
app/controllers/keycodes_controller.rb on lines 16..25
app/controllers/manifestation_checkout_stats_controller.rb on lines 48..58
app/controllers/manifestation_reserve_stats_controller.rb on lines 47..57
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/reserve_stat_has_users_controller.rb on lines 41..51
app/controllers/series_statement_merge_lists_controller.rb on lines 42..52
app/controllers/series_statement_merges_controller.rb on lines 50..60
app/controllers/user_checkout_stats_controller.rb on lines 47..57
app/controllers/user_reserve_stats_controller.rb on lines 47..57

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

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

  def create
    @abbreviation = Abbreviation.new(params[:abbreviation])

    respond_to do |format|
      if @abbreviation.save
Severity: Major
Found in app/controllers/abbreviations_controller.rb and 17 other locations - About 1 hr to fix
app/controllers/areas_controller.rb on lines 32..41
app/controllers/budget_categories_controller.rb on lines 35..45
app/controllers/budget_types_controller.rb on lines 13..23
app/controllers/checkout_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/checkout_stat_has_users_controller.rb on lines 41..51
app/controllers/copy_requests_controller.rb on lines 21..30
app/controllers/departments_controller.rb on lines 13..22
app/controllers/keycodes_controller.rb on lines 16..25
app/controllers/manifestation_checkout_stats_controller.rb on lines 48..58
app/controllers/manifestation_reserve_stats_controller.rb on lines 47..57
app/controllers/reserve_stat_has_manifestations_controller.rb on lines 41..51
app/controllers/reserve_stat_has_users_controller.rb on lines 41..51
app/controllers/series_statement_merge_lists_controller.rb on lines 42..52
app/controllers/series_statement_merges_controller.rb on lines 50..60
app/controllers/terms_controller.rb on lines 13..23
app/controllers/user_checkout_stats_controller.rb on lines 47..57
app/controllers/user_reserve_stats_controller.rb on lines 47..57

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

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